From 06e0dff563eece6cf38350998836272e80bc7333 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Mon, 28 Jun 2010 19:43:10 +0400 Subject: [PATCH] completion and annotator for MXML color attribute values --- .../xml/util/ColorSampleLookupValue.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java b/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java index 74ebdc86f5fd..5f93da6db7ef 100644 --- a/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java +++ b/xml/impl/src/com/intellij/xml/util/ColorSampleLookupValue.java @@ -35,7 +35,7 @@ import java.util.List; * @author maxim */ public class ColorSampleLookupValue implements LookupValueWithUIHint, DeferredUserLookupValue, Iconable, LookupValueWithPriority { - private static Object[] ourColors; + private static ColorSampleLookupValue[] ourColors; private static Map ourColorNameToHexCodeMap; private static Map ourHexCodeToColorNameMap; @@ -278,6 +278,14 @@ public class ColorSampleLookupValue implements LookupValueWithUIHint, DeferredUs return myName; } + public String getValue() { + return myValue; + } + + public boolean isIsStandard() { + return myIsStandard; + } + public Icon getIcon(int flags) { if (myColor == null) { if (myValue.startsWith("#")) { @@ -307,11 +315,11 @@ public class ColorSampleLookupValue implements LookupValueWithUIHint, DeferredUs return ourStandardColors.contains(s); } - public static Object[] getColors() { + public static ColorSampleLookupValue[] getColors() { if (ourColors == null) { ourColorNameToHexCodeMap = new HashMap(25); ourHexCodeToColorNameMap = new HashMap(25); - List colorsList = new LinkedList(); + List colorsList = new LinkedList(); StringTokenizer tokenizer = new StringTokenizer(systemColorsString, "\n"); while (tokenizer.hasMoreTokens()) { @@ -348,7 +356,7 @@ public class ColorSampleLookupValue implements LookupValueWithUIHint, DeferredUs } } - colorsList.toArray(ourColors = new Object[colorsList.size()]); + colorsList.toArray(ourColors = new ColorSampleLookupValue[colorsList.size()]); } return ourColors;