From 5f24af50cf33b4cb5ccb75d0ac1f92ed8afdbdd3 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Tue, 4 Sep 2012 15:38:45 +0400 Subject: [PATCH] Inline some static fields referencing newly introduced generated *Icons classes --- python/helpers/icon-robots.txt | 1 + python/helpers/icons/PythonHelpersIcons.java | 18 ------------------ .../python/facet/PythonFacetType.java | 3 +-- .../facet/PythonFrameworkSupportProvider.java | 3 ++- python/src/com/jetbrains/python/PyIcons.java | 19 ------------------- .../python/buildout/BuildoutFacetType.java | 4 +--- .../buildout/config/BuildoutCfgFileType.java | 4 ++-- ...ecialMethodNamesCompletionContributor.java | 4 ++-- .../python/psi/impl/PyFunctionImpl.java | 9 +++------ .../python/run/PythonConfigurationType.java | 4 +--- .../structureView/PyStructureViewElement.java | 8 ++++---- .../testing/PythonTestConfigurationType.java | 4 +--- 12 files changed, 18 insertions(+), 63 deletions(-) create mode 100644 python/helpers/icon-robots.txt delete mode 100644 python/helpers/icons/PythonHelpersIcons.java delete mode 100644 python/src/com/jetbrains/python/PyIcons.java diff --git a/python/helpers/icon-robots.txt b/python/helpers/icon-robots.txt new file mode 100644 index 000000000000..1313ad9016c8 --- /dev/null +++ b/python/helpers/icon-robots.txt @@ -0,0 +1 @@ +skip: * diff --git a/python/helpers/icons/PythonHelpersIcons.java b/python/helpers/icons/PythonHelpersIcons.java deleted file mode 100644 index 63f1581154ff..000000000000 --- a/python/helpers/icons/PythonHelpersIcons.java +++ /dev/null @@ -1,18 +0,0 @@ -package icons; - -import com.intellij.openapi.util.IconLoader; - -import javax.swing.*; - -/** - * NOTE THIS FILE IS AUTO-GENERATED by the build/scripts/icons.gant - * Don't repeat mistakes of others ;-) - */ -public class PythonHelpersIcons { - private static Icon load(String path) { - return IconLoader.getIcon(path, PythonHelpersIcons.class); - } - - public static final Icon Keybd_closed = load("/coverage/htmlfiles/keybd_closed.png"); // 35x12 - public static final Icon Keybd_open = load("/coverage/htmlfiles/keybd_open.png"); // 35x12 -} diff --git a/python/pluginSrc/com/jetbrains/python/facet/PythonFacetType.java b/python/pluginSrc/com/jetbrains/python/facet/PythonFacetType.java index e71a767c58c8..b1f0f0f7e991 100644 --- a/python/pluginSrc/com/jetbrains/python/facet/PythonFacetType.java +++ b/python/pluginSrc/com/jetbrains/python/facet/PythonFacetType.java @@ -26,7 +26,6 @@ import java.util.List; * @author yole */ public class PythonFacetType extends FacetType { - public static final Icon ICON = PythonIcons.Python.Icons.Python; @NonNls private static final String ID = "Python"; @@ -58,7 +57,7 @@ public class PythonFacetType extends FacetType { diff --git a/python/pluginSrc/com/jetbrains/python/facet/PythonFrameworkSupportProvider.java b/python/pluginSrc/com/jetbrains/python/facet/PythonFrameworkSupportProvider.java index eb20f4f9a6ad..98586d34b5df 100644 --- a/python/pluginSrc/com/jetbrains/python/facet/PythonFrameworkSupportProvider.java +++ b/python/pluginSrc/com/jetbrains/python/facet/PythonFrameworkSupportProvider.java @@ -7,6 +7,7 @@ import com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleType; import com.jetbrains.python.module.PythonModuleType; +import icons.PythonIcons; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -21,7 +22,7 @@ public class PythonFrameworkSupportProvider extends FrameworkSupportProvider { @Override public Icon getIcon() { - return PythonFacetType.ICON; + return PythonIcons.Python.Icons.Python; } @NotNull diff --git a/python/src/com/jetbrains/python/PyIcons.java b/python/src/com/jetbrains/python/PyIcons.java deleted file mode 100644 index c4738e9e7228..000000000000 --- a/python/src/com/jetbrains/python/PyIcons.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.jetbrains.python; - -import icons.PythonIcons; -import org.jetbrains.annotations.NonNls; - -import javax.swing.*; - -/** - * Preloads python-specific icons. - * User: dcheryasov - * Date: Oct 29, 2008 - */ -public interface PyIcons { - @NonNls String DATA_ROOT = "icons/"; /*"/com/jetbrains/python/PyIcons";*/ - - Icon PRIVATE = PythonIcons.Python.Icons.Nodes.Lock; - Icon PREDEFINED = PythonIcons.Python.Icons.Nodes.Cyan_dot; - Icon INVISIBLE = PythonIcons.Python.Icons.Nodes.Red_inv_triangle; -} diff --git a/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java b/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java index b8a0e0a6e9af..8447c8956857 100644 --- a/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java +++ b/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java @@ -48,10 +48,8 @@ public class BuildoutFacetType extends FacetType implements PyFunction { - private static final Icon PROPERTY_GETTER = PythonIcons.Python.Icons.PropertyGetter; - private static final Icon PROPERTY_SETTER = PythonIcons.Python.Icons.PropertySetter; - private static final Icon PROPERTY_DELETER = PythonIcons.Python.Icons.PropertyDeleter; public PyFunctionImpl(ASTNode astNode) { super(astNode); @@ -92,13 +89,13 @@ public class PyFunctionImpl extends PyPresentableElementImpl imp final Property property = getProperty(); if (property != null) { if (property.getGetter().valueOrNull() == this) { - return PROPERTY_GETTER; + return PythonIcons.Python.Icons.PropertyGetter; } if (property.getSetter().valueOrNull() == this) { - return PROPERTY_SETTER; + return PythonIcons.Python.Icons.PropertySetter; } if (property.getDeleter().valueOrNull() == this) { - return PROPERTY_DELETER; + return PythonIcons.Python.Icons.PropertyDeleter; } return PlatformIcons.PROPERTY_ICON; } diff --git a/python/src/com/jetbrains/python/run/PythonConfigurationType.java b/python/src/com/jetbrains/python/run/PythonConfigurationType.java index 2abe39117d20..dd1501cf292d 100644 --- a/python/src/com/jetbrains/python/run/PythonConfigurationType.java +++ b/python/src/com/jetbrains/python/run/PythonConfigurationType.java @@ -29,8 +29,6 @@ public class PythonConfigurationType implements ConfigurationType { return null; } - private final Icon _icon = PythonIcons.Python.Icons.Python; - private static class PythonConfigurationFactory extends ConfigurationFactory { protected PythonConfigurationFactory(ConfigurationType configurationType) { super(configurationType); @@ -50,7 +48,7 @@ public class PythonConfigurationType implements ConfigurationType { } public Icon getIcon() { - return _icon; + return PythonIcons.Python.Icons.Python; } public ConfigurationFactory[] getConfigurationFactories() { diff --git a/python/src/com/jetbrains/python/structureView/PyStructureViewElement.java b/python/src/com/jetbrains/python/structureView/PyStructureViewElement.java index dd11e72038f0..66b4fab74450 100644 --- a/python/src/com/jetbrains/python/structureView/PyStructureViewElement.java +++ b/python/src/com/jetbrains/python/structureView/PyStructureViewElement.java @@ -9,9 +9,9 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.ui.LayeredIcon; import com.intellij.util.Function; -import com.jetbrains.python.PyIcons; import com.jetbrains.python.PyNames; import com.jetbrains.python.psi.*; +import icons.PythonIcons; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -275,13 +275,13 @@ public class PyStructureViewElement implements StructureViewTreeElement { icon.setIcon(normal_icon, 0); Icon overlay = null; if (myVisibility == Visibility.PRIVATE || myVisibility == Visibility.PROTECTED) { - overlay = PyIcons.PRIVATE; + overlay = PythonIcons.Python.Icons.Nodes.Lock; } else if (myVisibility == Visibility.PREDEFINED) { - overlay = PyIcons.PREDEFINED; + overlay = PythonIcons.Python.Icons.Nodes.Cyan_dot; } else if (myVisibility == Visibility.INVISIBLE) { - overlay = PyIcons.INVISIBLE; + overlay = PythonIcons.Python.Icons.Nodes.Red_inv_triangle; } if (overlay != null) { icon.setIcon(overlay, 1); diff --git a/python/src/com/jetbrains/python/testing/PythonTestConfigurationType.java b/python/src/com/jetbrains/python/testing/PythonTestConfigurationType.java index 28b069ae8fa4..3a4de2fbc86c 100644 --- a/python/src/com/jetbrains/python/testing/PythonTestConfigurationType.java +++ b/python/src/com/jetbrains/python/testing/PythonTestConfigurationType.java @@ -29,8 +29,6 @@ public class PythonTestConfigurationType implements ConfigurationType { return ConfigurationTypeUtil.findConfigurationType(PythonTestConfigurationType.class); } - private static final Icon ICON = PythonIcons.Python.Icons.PythonTests; - private static class PythonUnitTestConfigurationFactory extends ConfigurationFactory { protected PythonUnitTestConfigurationFactory(ConfigurationType configurationType) { super(configurationType); @@ -123,7 +121,7 @@ public class PythonTestConfigurationType implements ConfigurationType { @Override public Icon getIcon() { - return ICON; + return PythonIcons.Python.Icons.PythonTests; } @NotNull