status colors moved to SharedColors class
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 29 Mar 2013 14:40:53 +0000 (14:40 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 29 Mar 2013 14:40:53 +0000 (14:40 +0000)
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/resources/SharedColors.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/resources/StatusDisplayInfo.java

index 40f9666..a118853 100644 (file)
@@ -63,6 +63,15 @@ public class SharedColors
        public static final String RULE_EDITOR_ACTION_BORDER = "RuleEditor.Border.Action";
        public static final String RULE_EDITOR_TITLE_TEXT = "RuleEditor.Title.Text";
        public static final String SERVICE_AVAILABILITY_LEGEND = "ServiceAvailability.Legend"; 
+       public static final String STATUS_NORMAL = "Status.Normal"; 
+       public static final String STATUS_WARNING = "Status.Warning"; 
+       public static final String STATUS_MINOR = "Status.Minor"; 
+       public static final String STATUS_MAJOR = "Status.Major"; 
+       public static final String STATUS_CRITICAL = "Status.Critical"; 
+       public static final String STATUS_UNKNOWN = "Status.Unknown"; 
+       public static final String STATUS_UNMANAGED = "Status.Unmanaged"; 
+       public static final String STATUS_DISABLED = "Status.Disabled"; 
+       public static final String STATUS_TESTING = "Status.Testing"; 
        public static final String TEXT_ERROR = "Text.Error"; 
        public static final String TEXT_NORMAL = "Text.Normal"; 
        
@@ -105,6 +114,15 @@ public class SharedColors
                defaultColors.put(RULE_EDITOR_ACTION_BORDER, new RGB(186,176,201));
                defaultColors.put(RULE_EDITOR_TITLE_TEXT, new RGB(0, 0, 0));
                defaultColors.put(SERVICE_AVAILABILITY_LEGEND, new RGB(0, 0, 0));
+               defaultColors.put(STATUS_NORMAL, new RGB(0, 192, 0));
+               defaultColors.put(STATUS_WARNING, new RGB(0, 255, 255));
+               defaultColors.put(STATUS_MINOR, new RGB(231, 226, 0));
+               defaultColors.put(STATUS_MAJOR, new RGB(255, 128, 0));
+               defaultColors.put(STATUS_CRITICAL, new RGB(192, 0, 0));
+               defaultColors.put(STATUS_UNKNOWN, new RGB(0, 0, 128));
+               defaultColors.put(STATUS_UNMANAGED, new RGB(192, 192, 192));
+               defaultColors.put(STATUS_DISABLED, new RGB(128, 64, 0));
+               defaultColors.put(STATUS_TESTING, new RGB(255, 128, 255));              
                defaultColors.put(TEXT_ERROR, new RGB(255, 0, 0));
                defaultColors.put(TEXT_NORMAL, new RGB(0, 0, 0));
        }
index 79dc348..f5f2dac 100644 (file)
@@ -28,14 +28,13 @@ import org.netxms.ui.eclipse.console.Messages;
 \r
 /**\r
  * Status display information\r
- *\r
  */\r
 public final class StatusDisplayInfo\r
 {\r
        private static String[] statusText = new String[9];\r
        private static ImageDescriptor[] statusImageDesc = new ImageDescriptor[9];\r
        private static Image[] statusImage = new Image[9];\r
-       private static Color[] statusColor = new Color[9];\r
+       private static String[] statusColor = new String[9];\r
        \r
        /**\r
         * Initialize static members. Intended to be called once by library activator.\r
@@ -65,15 +64,15 @@ public final class StatusDisplayInfo
                for(int i = 0; i < statusImageDesc.length; i++)\r
                        statusImage[i] = statusImageDesc[i].createImage();\r
 \r
-               statusColor[Severity.NORMAL] = new Color(display, 0, 192, 0);\r
-               statusColor[Severity.WARNING] = new Color(display, 0, 255, 255);\r
-               statusColor[Severity.MINOR] = new Color(display, 231, 226, 0);\r
-               statusColor[Severity.MAJOR] = new Color(display, 255, 128, 0);\r
-               statusColor[Severity.CRITICAL] = new Color(display, 192, 0, 0);\r
-               statusColor[Severity.UNKNOWN] = new Color(display, 0, 0, 128);\r
-               statusColor[Severity.UNMANAGED] = new Color(display, 192, 192, 192);\r
-               statusColor[Severity.DISABLED] = new Color(display, 128, 64, 0);\r
-               statusColor[Severity.TESTING] = new Color(display, 255, 128, 255);\r
+               statusColor[Severity.NORMAL] = SharedColors.STATUS_NORMAL;\r
+               statusColor[Severity.WARNING] = SharedColors.STATUS_WARNING;\r
+               statusColor[Severity.MINOR] = SharedColors.STATUS_MINOR;\r
+               statusColor[Severity.MAJOR] = SharedColors.STATUS_MAJOR;\r
+               statusColor[Severity.CRITICAL] = SharedColors.STATUS_CRITICAL;\r
+               statusColor[Severity.UNKNOWN] = SharedColors.STATUS_UNKNOWN;\r
+               statusColor[Severity.UNMANAGED] = SharedColors.STATUS_UNMANAGED;\r
+               statusColor[Severity.DISABLED] = SharedColors.STATUS_DISABLED;\r
+               statusColor[Severity.TESTING] = SharedColors.STATUS_TESTING;\r
        }\r
        \r
        /**\r
@@ -141,7 +140,7 @@ public final class StatusDisplayInfo
        {\r
                try\r
                {\r
-                       return statusColor[severity];\r
+                       return SharedColors.getColor(statusColor[severity], Display.getCurrent());\r
                }\r
                catch(ArrayIndexOutOfBoundsException e)\r
                {\r