[java] IDEA-356790 Provide dedicated icon for messages_XX.properties files
GitOrigin-RevId: d12bfbe6f70ce1ad116aef938eb6ff7512f90fe8
@@ -65,12 +65,6 @@ class IntellijIconClassGeneratorConfig : IconClasses() {
|
||||
iconDirectory = "icons/com/jetbrains/pythonCore",
|
||||
)
|
||||
|
||||
"intellij.gnuGetText"-> IntellijIconClassGeneratorModuleConfig(
|
||||
className = "LocalizationIcons",
|
||||
packageName = "com.jetbrains.localization.lcons",
|
||||
iconDirectory = "icons/com/jetbrains/localization",
|
||||
)
|
||||
|
||||
"intellij.notebooks.jupyter.core"-> IntellijIconClassGeneratorModuleConfig(
|
||||
className = "JupyterCoreIcons",
|
||||
packageName = "com.intellij.notebooks.jupyter.core.icons",
|
||||
|
||||
@@ -222,6 +222,7 @@
|
||||
"html.svg": "fileTypes/html.svg",
|
||||
"ideaModule.svg": "nodes/ideaModule.svg",
|
||||
"idl.svg": "fileTypes/idl.svg",
|
||||
"i18n.svg": "fileTypes/i18n.svg",
|
||||
"ignored.svg": "vcs/ignore_file.svg",
|
||||
"java.svg": [
|
||||
"fileTypes/java.svg",
|
||||
|
||||
|
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 764 B |
15
platform/icons/src/fileTypes/i18n.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<polygon fill="#9AA7B0" fill-opacity=".8" points="7 1 3 5 7 5"/>
|
||||
<polygon fill="#9AA7B0" fill-opacity=".8" points="8 1 8 6 3 6 3 8 13 8 13 1"/>
|
||||
<polygon fill="#40B6E0" fill-opacity=".7" points="1 16 16 16 16 9 1 9"/>
|
||||
<polygon fill="#231F20" fill-opacity=".7" points="1.1 0 0 .443 .157 1.225 1 1 1 5 2 5 2 0" transform="translate(4 10)"/>
|
||||
<g fill="#231F20" fill-opacity=".7" transform="translate(2 10)">
|
||||
<rect width="1" height="1"/>
|
||||
<rect width="1" height="3" y="2"/>
|
||||
</g>
|
||||
<path fill="#231F20" fill-opacity=".7" d="M2.517,6.062 C1.4165,6.062 0.6,5.494 0.6,4.6278 L0.6,4.6136 C0.6,4.0101 0.8769,3.6551 1.4023,3.4137 C1.0189,3.1794 0.7704,2.8599 0.7704,2.3274 L0.7704,2.3132 C0.7704,1.5535 1.4662,0.95 2.517,0.95 C3.5678,0.95 4.2636,1.5464 4.2636,2.3132 L4.2636,2.3274 C4.2636,2.8599 4.0151,3.1794 3.6317,3.4137 C4.1358,3.6764 4.434,3.9959 4.434,4.5852 L4.434,4.5994 C4.434,5.5224 3.6175,6.062 2.517,6.062 Z M2.517,3.0516 C2.9501,3.0516 3.227,2.796 3.227,2.4481 L3.227,2.4339 C3.227,2.1286 2.9643,1.8517 2.517,1.8517 C2.0697,1.8517 1.807,2.1215 1.807,2.4268 L1.807,2.441 C1.807,2.7889 2.0839,3.0516 2.517,3.0516 Z M2.517,5.1603 C3.0566,5.1603 3.3761,4.8905 3.3761,4.5426 L3.3761,4.5284 C3.3761,4.145 3.014,3.9178 2.517,3.9178 C2.02,3.9178 1.6579,4.145 1.6579,4.5284 L1.6579,4.5426 C1.6579,4.8834 1.9774,5.1603 2.517,5.1603 Z" transform="translate(6 9)"/>
|
||||
<path fill="#231F20" fill-opacity=".7" d="M-4.4408921e-16,4 L-4.4408921e-16,8.8817842e-16 L0.8906,8.8817842e-16 L0.8906,0.7369 C1.1388,0.3792 1.4965,8.8817842e-16 2.0951,8.8817842e-16 C2.9638,8.8817842e-16 3.5,0.6493 3.5,1.5399 L3.5,4 L2.5,4 L2.5,1.81 C2.5,1.2114 2.1703,1 1.7593,1 C1.3483,1 0.9,1.226 0.9,1.8246 L0.9,4 L-4.4408921e-16,4 Z" transform="translate(11 11)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -429,6 +429,7 @@ f:com.intellij.icons.AllIcons$FileTypes
|
||||
- sf:Hprof:javax.swing.Icon
|
||||
- sf:Htaccess:javax.swing.Icon
|
||||
- sf:Html:javax.swing.Icon
|
||||
- sf:I18n:javax.swing.Icon
|
||||
- sf:Idl:javax.swing.Icon
|
||||
- sf:Image:javax.swing.Icon
|
||||
- sf:Java:javax.swing.Icon
|
||||
|
||||
@@ -466,6 +466,7 @@ public class AllIcons {
|
||||
/** 16x16 */ public static final @NotNull Icon Hprof = load("fileTypes/hprof.svg", 2107471584, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Htaccess = load("fileTypes/htaccess.svg", -1026396371, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Html = load("expui/fileTypes/html.svg", "fileTypes/html.svg", 944305592, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon I18n = load("expui/fileTypes/i18n.svg", "fileTypes/i18n.svg", 1594775427, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Idl = load("expui/fileTypes/idl.svg", "fileTypes/idl.svg", 1130770662, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Image = load("expui/fileTypes/image.svg", "fileTypes/image.svg", -266191706, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Java = load("expui/fileTypes/java.svg", "fileTypes/java.svg", 1296658493, 0);
|
||||
|
||||
@@ -26,7 +26,6 @@ public final class DevKitIcons {
|
||||
/** 12x12 */ public static final @NotNull Icon Properties = load("icons/expui/gutter/properties@14x14.svg", "icons/gutter/properties.svg", -818710709, 2);
|
||||
}
|
||||
|
||||
/** 16x16 */ public static final @NotNull Icon LocalizationFile = load("icons/expui/localizationFile.svg", "icons/localizationFile.svg", -1571747209, 2);
|
||||
/** 16x16 */ public static final @NotNull Icon PluginV2 = load("icons/expui/pluginV2.svg", 1719825147, 2);
|
||||
/** 16x16 */ public static final @NotNull Icon RemoteMapping = load("icons/expui/remoteMapping.svg", "icons/remoteMapping.svg", 1371307852, 2);
|
||||
/** 16x16 */ public static final @NotNull Icon Sdk_closed = load("icons/expui/sdkClosed.svg", "icons/sdk_closed.svg", -1355048140, 2);
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.39756 11.093C6.553 10.58 5.09123 9.34115 5.06009 9.3678C4.28492 9.9837 3.46716 10.544 2.61295 11.0446C2.10273 11.3389 1.58328 11.4124 1.26322 10.9768C1.20602 10.8961 1.16568 10.8047 1.14462 10.7081C1.12357 10.6114 1.12222 10.5115 1.14067 10.4143C1.15912 10.3172 1.19699 10.2247 1.252 10.1425C1.30701 10.0603 1.37804 9.99003 1.46084 9.93591C1.46715 9.93301 3.27465 8.75421 3.87742 8.2332C3.17204 7.46663 2.61124 6.57872 2.22214 5.61239C2.14727 5.42519 2.14594 5.2166 2.21842 5.02847C2.2909 4.84033 2.43183 4.68655 2.61295 4.59797C3.00375 4.43335 3.39062 4.50408 3.71505 5.05752C4.04119 5.84264 4.49575 6.56799 5.06008 7.20384C5.82931 6.26407 6.37583 5.16235 6.65864 3.98129L1 3.96536V2.47759H4.56765V1.74065C4.56635 1.64386 4.58428 1.54778 4.62041 1.45798C4.65655 1.36818 4.71016 1.28645 4.77815 1.21754C4.84613 1.14863 4.92712 1.09392 5.01643 1.05658C5.10573 1.01923 5.20156 1 5.29836 1C5.39516 1 5.49099 1.01923 5.5803 1.05658C5.6696 1.09392 5.75059 1.14863 5.81858 1.21754C5.88656 1.28645 5.94017 1.36818 5.97631 1.45798C6.01244 1.54778 6.03038 1.64386 6.02907 1.74065V2.47759H9.86205V3.96536H8.31526C7.93518 5.49782 7.27117 6.94544 6.35763 8.23321C6.88848 8.69369 7.45949 9.10571 8.06383 9.46435L9.77574 5.26376C9.83793 5.09897 9.94913 4.95721 10.0944 4.85757C10.2396 4.75793 10.4119 4.7052 10.588 4.70648C10.7641 4.70777 10.9356 4.76301 11.0794 4.86476C11.2231 4.96651 11.3323 5.10988 11.392 5.27555L13.6238 10.7534L15 14.0042H13.166L12.3634 12.1217H8.77472L8.1164 14.0042H6.18942L6.40219 13.4914L7.39756 11.093ZM10.595 7.2624L9.35305 10.6386H11.837L10.595 7.2624Z" fill="#6e6e6e"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,4 +0,0 @@
|
||||
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.39756 11.093C6.553 10.58 5.09123 9.34115 5.06009 9.3678C4.28492 9.9837 3.46716 10.544 2.61295 11.0446C2.10273 11.3389 1.58328 11.4124 1.26322 10.9768C1.20602 10.8961 1.16568 10.8047 1.14462 10.7081C1.12357 10.6114 1.12222 10.5115 1.14067 10.4143C1.15912 10.3172 1.19699 10.2247 1.252 10.1425C1.30701 10.0603 1.37804 9.99003 1.46084 9.93591C1.46715 9.93301 3.27465 8.75421 3.87742 8.2332C3.17204 7.46663 2.61124 6.57872 2.22214 5.61239C2.14727 5.42519 2.14594 5.2166 2.21842 5.02847C2.2909 4.84033 2.43183 4.68655 2.61295 4.59797C3.00375 4.43335 3.39062 4.50408 3.71505 5.05752C4.04119 5.84264 4.49575 6.56799 5.06008 7.20384C5.82931 6.26407 6.37583 5.16235 6.65864 3.98129L1 3.96536V2.47759H4.56765V1.74065C4.56635 1.64386 4.58428 1.54778 4.62041 1.45798C4.65655 1.36818 4.71016 1.28645 4.77815 1.21754C4.84613 1.14863 4.92712 1.09392 5.01643 1.05658C5.10573 1.01923 5.20156 1 5.29836 1C5.39516 1 5.49099 1.01923 5.5803 1.05658C5.6696 1.09392 5.75059 1.14863 5.81858 1.21754C5.88656 1.28645 5.94017 1.36818 5.97631 1.45798C6.01244 1.54778 6.03038 1.64386 6.02907 1.74065V2.47759H9.86205V3.96536H8.31526C7.93518 5.49782 7.27117 6.94544 6.35763 8.23321C6.88848 8.69369 7.45949 9.10571 8.06383 9.46435L9.77574 5.26376C9.83793 5.09897 9.94913 4.95721 10.0944 4.85757C10.2396 4.75793 10.4119 4.7052 10.588 4.70648C10.7641 4.70777 10.9356 4.76301 11.0794 4.86476C11.2231 4.96651 11.3323 5.10988 11.392 5.27555L13.6238 10.7534L15 14.0042H13.166L12.3634 12.1217H8.77472L8.1164 14.0042H6.18942L6.40219 13.4914L7.39756 11.093ZM10.595 7.2624L9.35305 10.6386H11.837L10.595 7.2624Z" fill="#afb1b3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -11,8 +11,6 @@
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<fileIconProvider implementation="org.jetbrains.idea.devkit.i18n.DevKitPropertiesIconProvider"/>
|
||||
|
||||
<localInspection language="XML" applyToDialects="false"
|
||||
projectType="INTELLIJ_PLUGIN"
|
||||
groupBundle="messages.DevKitBundle" groupPathKey="inspections.group.path" groupKey="inspections.group.descriptor"
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.devkit.i18n
|
||||
|
||||
import com.intellij.ide.FileIconProvider
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.idea.devkit.DevKitIcons
|
||||
import javax.swing.Icon
|
||||
|
||||
internal class DevKitPropertiesIconProvider : FileIconProvider {
|
||||
private val pattern: Regex = Regex("(.*)Bundle(_.+)?\\.properties")
|
||||
|
||||
override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
|
||||
if (file.parent?.name == "messages"
|
||||
&& file.name.matches(pattern)) {
|
||||
return DevKitIcons.LocalizationFile
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,18 @@
|
||||
<id>com.intellij.java-i18n</id>
|
||||
<name>Java Internationalization</name>
|
||||
<category>Other Tools</category>
|
||||
<vendor>JetBrains</vendor>
|
||||
|
||||
<depends>com.intellij.properties</depends>
|
||||
<depends>com.intellij.modules.java</depends>
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
|
||||
<description>
|
||||
Provides code inspections and corresponding quick fixes for internationalization in Java source code.
|
||||
</description>
|
||||
<vendor>JetBrains</vendor>
|
||||
|
||||
<resource-bundle>messages.PropertiesBundle</resource-bundle>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint name="resourceBundleManager"
|
||||
interface="com.intellij.lang.properties.psi.ResourceBundleManager"
|
||||
@@ -75,6 +79,7 @@
|
||||
groupKey="group.names.internationalization.issues" groupBundle="messages.InspectionsBundle"
|
||||
enabledByDefault="true" level="INFORMATION"
|
||||
implementationClass="com.intellij.codeInspection.i18n.ConvertToBasicLatinInspection" />
|
||||
|
||||
<intentionAction>
|
||||
<language>JAVA</language>
|
||||
<className>com.intellij.codeInspection.capitalization.AnnotateCapitalizationIntention</className>
|
||||
@@ -90,7 +95,10 @@
|
||||
|
||||
<applicationService serviceImplementation="com.intellij.lang.properties.PropertiesFoldingSettings"/>
|
||||
<codeFoldingOptionsProvider instance="com.intellij.lang.properties.PropertiesFoldingOptionsProvider"/>
|
||||
|
||||
<fileIconProvider implementation="com.intellij.java.i18n.MessagesFileIconProvider"/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
<action id="I18nize" class="com.intellij.codeInspection.i18n.I18nizeAction">
|
||||
<add-to-group group-id="RefactoringMenu" anchor="last" />
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.java.i18n
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.ide.FileIconProvider
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import javax.swing.Icon
|
||||
|
||||
internal class MessagesFileIconProvider : FileIconProvider {
|
||||
private val messagesPattern: Regex = Regex("messages(_[a-z]+)?\\.properties")
|
||||
private val validationMessagesPattern: Regex = Regex("(.*)Messages(_[a-z]+)?\\.properties")
|
||||
private val bundlePattern: Regex = Regex("(.*)Bundle(_.+)?\\.properties")
|
||||
|
||||
override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
|
||||
if (file.name.matches(messagesPattern)
|
||||
|| validationMessagesPattern.matches(file.name)) {
|
||||
return AllIcons.FileTypes.I18n
|
||||
}
|
||||
if (file.parent?.name == "messages"
|
||||
&& file.name.matches(bundlePattern)) {
|
||||
return AllIcons.FileTypes.I18n
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||