diff --git a/src/main/java/com/intellij/plugins/haxe/HaxeComponentType.java b/src/main/java/com/intellij/plugins/haxe/HaxeComponentType.java index 2bae3d895..1407a86d6 100644 --- a/src/main/java/com/intellij/plugins/haxe/HaxeComponentType.java +++ b/src/main/java/com/intellij/plugins/haxe/HaxeComponentType.java @@ -71,7 +71,7 @@ public Icon getIcon() { }, VARIABLE(5) { @Override public Icon getIcon() { - return AllIcons.Nodes.Variable; + return HaxeIcons.Variable; } }, FIELD(6) { @Override @@ -81,7 +81,7 @@ public Icon getIcon() { }, PARAMETER(7) { @Override public Icon getIcon() { - return AllIcons.Nodes.Parameter; + return HaxeIcons.Parameter; } }, TYPEDEF(8) { @Override @@ -95,11 +95,11 @@ public Icon getIcon() { } }, TYPE_PARAMETER(10) { public Icon getIcon() { - return icons.HaxeIcons.Class; + return HaxeIcons.Class; } }, MODULE(11) { public Icon getIcon() { - return HaxeIcons.Class; // TODO icon for module + return HaxeIcons.MultiDefinition; } }; diff --git a/src/main/java/com/intellij/plugins/haxe/ide/HaxeIconProvider.java b/src/main/java/com/intellij/plugins/haxe/ide/HaxeIconProvider.java index 43882a8da..be9380e88 100644 --- a/src/main/java/com/intellij/plugins/haxe/ide/HaxeIconProvider.java +++ b/src/main/java/com/intellij/plugins/haxe/ide/HaxeIconProvider.java @@ -20,14 +20,17 @@ import com.intellij.ide.IconProvider; import com.intellij.openapi.util.Iconable; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.plugins.haxe.lang.psi.HaxeClass; import com.intellij.plugins.haxe.lang.psi.HaxeComponent; import com.intellij.plugins.haxe.lang.psi.HaxeFile; import com.intellij.plugins.haxe.util.HaxeResolveUtil; import com.intellij.psi.PsiElement; +import icons.HaxeIcons; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; +import java.util.List; /** * @author: Fedor.Korotkov @@ -44,11 +47,15 @@ public Icon getIcon(@NotNull PsiElement element, @Iconable.IconFlags int flags) @Nullable private static Icon getHaxeFileIcon(HaxeFile file, @Iconable.IconFlags int flags) { final String fileName = FileUtil.getNameWithoutExtension(file.getName()); - for (HaxeComponent component : HaxeResolveUtil.findComponentDeclarations(file)) { + List declarations = HaxeResolveUtil.findComponentDeclarations(file); + for (HaxeComponent component : declarations) { if (fileName.equals(component.getName())) { return component.getIcon(flags); } } + if (!declarations.isEmpty()) { + return HaxeIcons.MultiDefinition; + } return null; } } diff --git a/src/main/java/icons/HaxeIcons.java b/src/main/java/icons/HaxeIcons.java index 8c3517e2b..9571bf634 100644 --- a/src/main/java/icons/HaxeIcons.java +++ b/src/main/java/icons/HaxeIcons.java @@ -27,15 +27,19 @@ private static Icon load(String path) { return IconLoader.getIcon(path, HaxeIcons.class); } - public static final Icon Class = load("/icons/class.svg"); - public static final Icon Enum = load("/icons/enum.svg"); - public static final Icon Typedef = load("/icons/typedef.svg"); - public static final Icon Interface = load("/icons/interface.svg"); - public static final Icon Method = load("/icons/method.svg"); - public static final Icon Field = load("/icons/field.svg"); + public static final Icon Class = load("/icons/nodes/class.svg"); + public static final Icon Enum = load("/icons/nodes/enum.svg"); + public static final Icon Typedef = load("/icons/nodes/typedef.svg"); + public static final Icon Interface = load("/icons/nodes/interface.svg"); + public static final Icon Method = load("/icons/nodes/method.svg"); + public static final Icon Field = load("/icons/nodes/field.svg"); + public static final Icon Parameter = load("/icons/nodes/parameter.svg"); + public static final Icon Variable = load("/icons/nodes/variable.svg"); + public static final Icon MultiDefinition = load("/icons/nodes/module.svg"); + public static final Icon TYPEDEF_GUTTER = load("/icons/nodes/typedefGutter.svg"); - public static final Icon HAXELIB_JSON = load("/icons/file.svg"); + public static final Icon HAXELIB_JSON = load("/icons/nodes/file.svg"); public static final Icon HAXE_LOGO = load("/icons/Haxe_logo.svg"); public static final Icon NMML_LOGO = load("/icons/buildsystem/nme.svg"); @@ -45,7 +49,7 @@ private static Icon load(String path) { public static final Icon HAXE_RELOAD = load("/icons/Haxe_reload.svg"); - public static final Icon TYPEDEF_GUTTER = load("/icons/typedef_gutter.svg"); + } diff --git a/src/main/resources/HaxeIconMappings.json b/src/main/resources/HaxeIconMappings.json new file mode 100644 index 000000000..e371d0ef3 --- /dev/null +++ b/src/main/resources/HaxeIconMappings.json @@ -0,0 +1,18 @@ +{ + "icons": { + "expui": { + "nodes": { + "class.svg": "icons/nodes/class.svg", + "enum.svg": "icons/nodes/enum.svg", + "field.svg": "icons/nodes/field.svg", + "parameter.svg": "icons/nodes/parameter.svg", + "file.svg": "icons/nodes/file.svg", + "interface.svg": "icons/nodes/interface.svg", + "method.svg": "icons/nodes/method.svg", + "typedef.svg": "icons/nodes/typedef.svg", + "typedefGutter.svg": "icons/nodes/typedefGutter.svg", + "module.svg": "icons/nodes/module.svg" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index ba94fd0e0..e1004fec1 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -44,6 +44,7 @@ > + diff --git a/src/main/resources/icons/expui/nodes/class.svg b/src/main/resources/icons/expui/nodes/class.svg new file mode 100644 index 000000000..b5c54836b --- /dev/null +++ b/src/main/resources/icons/expui/nodes/class.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/class_dark.svg b/src/main/resources/icons/expui/nodes/class_dark.svg new file mode 100644 index 000000000..42854769e --- /dev/null +++ b/src/main/resources/icons/expui/nodes/class_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/enum.svg b/src/main/resources/icons/expui/nodes/enum.svg new file mode 100644 index 000000000..5fddcd7bc --- /dev/null +++ b/src/main/resources/icons/expui/nodes/enum.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/enum_dark.svg b/src/main/resources/icons/expui/nodes/enum_dark.svg new file mode 100644 index 000000000..820ab4db9 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/enum_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/field.svg b/src/main/resources/icons/expui/nodes/field.svg new file mode 100644 index 000000000..2cc928b46 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/field.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/field_dark.svg b/src/main/resources/icons/expui/nodes/field_dark.svg new file mode 100644 index 000000000..dce460bb6 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/field_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/function.svg b/src/main/resources/icons/expui/nodes/function.svg new file mode 100644 index 000000000..7a14d9e3f --- /dev/null +++ b/src/main/resources/icons/expui/nodes/function.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/function_dark.svg b/src/main/resources/icons/expui/nodes/function_dark.svg new file mode 100644 index 000000000..41448b63e --- /dev/null +++ b/src/main/resources/icons/expui/nodes/function_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/interface.svg b/src/main/resources/icons/expui/nodes/interface.svg new file mode 100644 index 000000000..02bfcbb16 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/interface.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/interface_dark.svg b/src/main/resources/icons/expui/nodes/interface_dark.svg new file mode 100644 index 000000000..a68e8aef3 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/interface_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/method.svg b/src/main/resources/icons/expui/nodes/method.svg new file mode 100644 index 000000000..9ce6c22c7 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/method.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/method_dark.svg b/src/main/resources/icons/expui/nodes/method_dark.svg new file mode 100644 index 000000000..cdc89679c --- /dev/null +++ b/src/main/resources/icons/expui/nodes/method_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/module.svg b/src/main/resources/icons/expui/nodes/module.svg new file mode 100644 index 000000000..faa5a166a --- /dev/null +++ b/src/main/resources/icons/expui/nodes/module.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/module_dark.svg b/src/main/resources/icons/expui/nodes/module_dark.svg new file mode 100644 index 000000000..402f4a585 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/module_dark.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/parameter.svg b/src/main/resources/icons/expui/nodes/parameter.svg new file mode 100644 index 000000000..c0c635852 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/parameter.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/parameter_dark.svg b/src/main/resources/icons/expui/nodes/parameter_dark.svg new file mode 100644 index 000000000..1279168f9 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/parameter_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/typedef.svg b/src/main/resources/icons/expui/nodes/typedef.svg new file mode 100644 index 000000000..c77e1bdb4 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/typedef.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/typedefGutter.svg b/src/main/resources/icons/expui/nodes/typedefGutter.svg new file mode 100644 index 000000000..0470ba2eb --- /dev/null +++ b/src/main/resources/icons/expui/nodes/typedefGutter.svg @@ -0,0 +1,57 @@ + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/typedefGutter_dark.svg b/src/main/resources/icons/expui/nodes/typedefGutter_dark.svg new file mode 100644 index 000000000..ed331c7f1 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/typedefGutter_dark.svg @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/typedef_dark.svg b/src/main/resources/icons/expui/nodes/typedef_dark.svg new file mode 100644 index 000000000..ae06e8b44 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/typedef_dark.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/variable.svg b/src/main/resources/icons/expui/nodes/variable.svg new file mode 100644 index 000000000..84dd22741 --- /dev/null +++ b/src/main/resources/icons/expui/nodes/variable.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/expui/nodes/variable_dark.svg b/src/main/resources/icons/expui/nodes/variable_dark.svg new file mode 100644 index 000000000..bcfd00f6a --- /dev/null +++ b/src/main/resources/icons/expui/nodes/variable_dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/icons/legacy/C_Logo.png b/src/main/resources/icons/legacy/C_Logo.png deleted file mode 100644 index 591a8447f..000000000 Binary files a/src/main/resources/icons/legacy/C_Logo.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/C_haXe.png b/src/main/resources/icons/legacy/C_haXe.png deleted file mode 100644 index f838b1371..000000000 Binary files a/src/main/resources/icons/legacy/C_haXe.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/E_Logo.png b/src/main/resources/icons/legacy/E_Logo.png deleted file mode 100644 index 516316f37..000000000 Binary files a/src/main/resources/icons/legacy/E_Logo.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/E_haXe.png b/src/main/resources/icons/legacy/E_haXe.png deleted file mode 100644 index cdbc765bc..000000000 Binary files a/src/main/resources/icons/legacy/E_haXe.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/HaxeLogo.svg b/src/main/resources/icons/legacy/HaxeLogo.svg deleted file mode 100644 index 53c9f0c57..000000000 --- a/src/main/resources/icons/legacy/HaxeLogo.svg +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/icons/legacy/HaxeLogo_15.png b/src/main/resources/icons/legacy/HaxeLogo_15.png deleted file mode 100644 index b0b55ff57..000000000 Binary files a/src/main/resources/icons/legacy/HaxeLogo_15.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/HaxeLogo_16.png b/src/main/resources/icons/legacy/HaxeLogo_16.png deleted file mode 100644 index c0e2937b0..000000000 Binary files a/src/main/resources/icons/legacy/HaxeLogo_16.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/HaxeLogo_24.png b/src/main/resources/icons/legacy/HaxeLogo_24.png deleted file mode 100644 index fbd091f9b..000000000 Binary files a/src/main/resources/icons/legacy/HaxeLogo_24.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/HaxeLogo_8.png b/src/main/resources/icons/legacy/HaxeLogo_8.png deleted file mode 100644 index faecc61f6..000000000 Binary files a/src/main/resources/icons/legacy/HaxeLogo_8.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/I_Logo.png b/src/main/resources/icons/legacy/I_Logo.png deleted file mode 100644 index 0aa904d41..000000000 Binary files a/src/main/resources/icons/legacy/I_Logo.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/I_haXe.png b/src/main/resources/icons/legacy/I_haXe.png deleted file mode 100644 index 8ec408364..000000000 Binary files a/src/main/resources/icons/legacy/I_haXe.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/field-logo.png b/src/main/resources/icons/legacy/field-logo.png deleted file mode 100644 index 5ae44bb44..000000000 Binary files a/src/main/resources/icons/legacy/field-logo.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/field-logo.svg b/src/main/resources/icons/legacy/field-logo.svg deleted file mode 100644 index ab7a5fae2..000000000 --- a/src/main/resources/icons/legacy/field-logo.svg +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - image/svg+xml - - field - - - - - - field - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/icons/legacy/haXe_16.png b/src/main/resources/icons/legacy/haXe_16.png deleted file mode 100644 index 78c35aab5..000000000 Binary files a/src/main/resources/icons/legacy/haXe_16.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/haXe_24.png b/src/main/resources/icons/legacy/haXe_24.png deleted file mode 100644 index fa2ffdc37..000000000 Binary files a/src/main/resources/icons/legacy/haXe_24.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/method-logo.png b/src/main/resources/icons/legacy/method-logo.png deleted file mode 100644 index 2688bcc3b..000000000 Binary files a/src/main/resources/icons/legacy/method-logo.png and /dev/null differ diff --git a/src/main/resources/icons/legacy/method-logo.svg b/src/main/resources/icons/legacy/method-logo.svg deleted file mode 100644 index 129f96da4..000000000 --- a/src/main/resources/icons/legacy/method-logo.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - image/svg+xml - - method - - - - - - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/icons/legacy/nmml_16.png b/src/main/resources/icons/legacy/nmml_16.png deleted file mode 100644 index b03e61243..000000000 Binary files a/src/main/resources/icons/legacy/nmml_16.png and /dev/null differ diff --git a/src/main/resources/icons/class.svg b/src/main/resources/icons/nodes/class.svg similarity index 88% rename from src/main/resources/icons/class.svg rename to src/main/resources/icons/nodes/class.svg index 69d8293e8..ceee55f2a 100644 --- a/src/main/resources/icons/class.svg +++ b/src/main/resources/icons/nodes/class.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/enum.svg b/src/main/resources/icons/nodes/enum.svg similarity index 83% rename from src/main/resources/icons/enum.svg rename to src/main/resources/icons/nodes/enum.svg index b34e0958f..0b0df276c 100644 --- a/src/main/resources/icons/enum.svg +++ b/src/main/resources/icons/nodes/enum.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/field.svg b/src/main/resources/icons/nodes/field.svg similarity index 89% rename from src/main/resources/icons/field.svg rename to src/main/resources/icons/nodes/field.svg index 296aa461f..d37d8136a 100644 --- a/src/main/resources/icons/field.svg +++ b/src/main/resources/icons/nodes/field.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/file.svg b/src/main/resources/icons/nodes/file.svg similarity index 80% rename from src/main/resources/icons/file.svg rename to src/main/resources/icons/nodes/file.svg index 5d0b45f2c..a84a0e86c 100644 --- a/src/main/resources/icons/file.svg +++ b/src/main/resources/icons/nodes/file.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/interface.svg b/src/main/resources/icons/nodes/interface.svg similarity index 83% rename from src/main/resources/icons/interface.svg rename to src/main/resources/icons/nodes/interface.svg index d2bbb294c..a1d2aba45 100644 --- a/src/main/resources/icons/interface.svg +++ b/src/main/resources/icons/nodes/interface.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/method.svg b/src/main/resources/icons/nodes/method.svg similarity index 89% rename from src/main/resources/icons/method.svg rename to src/main/resources/icons/nodes/method.svg index bc8743963..a0962177b 100644 --- a/src/main/resources/icons/method.svg +++ b/src/main/resources/icons/nodes/method.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/nodes/module.svg b/src/main/resources/icons/nodes/module.svg new file mode 100644 index 000000000..faa5a166a --- /dev/null +++ b/src/main/resources/icons/nodes/module.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/icons/nodes/parameter.svg b/src/main/resources/icons/nodes/parameter.svg new file mode 100644 index 000000000..4ce0c054e --- /dev/null +++ b/src/main/resources/icons/nodes/parameter.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/icons/typedef.svg b/src/main/resources/icons/nodes/typedef.svg similarity index 83% rename from src/main/resources/icons/typedef.svg rename to src/main/resources/icons/nodes/typedef.svg index 7e9e621f8..e492f637b 100644 --- a/src/main/resources/icons/typedef.svg +++ b/src/main/resources/icons/nodes/typedef.svg @@ -1,8 +1,4 @@ - - - - diff --git a/src/main/resources/icons/typedef_gutter.svg b/src/main/resources/icons/nodes/typedefGutter.svg similarity index 100% rename from src/main/resources/icons/typedef_gutter.svg rename to src/main/resources/icons/nodes/typedefGutter.svg diff --git a/src/main/resources/icons/nodes/variable.svg b/src/main/resources/icons/nodes/variable.svg new file mode 100644 index 000000000..00bb8d0c1 --- /dev/null +++ b/src/main/resources/icons/nodes/variable.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + +