latest changes from RCP console (unchecked)
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 12 Mar 2013 22:55:15 +0000 (22:55 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 12 Mar 2013 22:55:15 +0000 (22:55 +0000)
webui/webapp/Core/src/org/netxms/ui/eclipse/console/resources/SharedColors.java
webui/webapp/Core/src/org/netxms/ui/eclipse/widgets/CommandBox.java
webui/webapp/EPP/src/org/netxms/ui/eclipse/epp/widgets/RuleEditor.java
webui/webapp/LogViewer/src/org/netxms/ui/eclipse/logviewer/widgets/ColumnFilterEditor.java
webui/webapp/ObjectView/src/org/netxms/ui/eclipse/objectview/views/TabbedObjectView.java

index 17ae86e..f4949d9 100644 (file)
@@ -37,6 +37,8 @@ public class SharedColors
        public static final String BORDER = "Border"; 
        public static final String CGROUP_BORDER = "CGroup.Border"; 
        public static final String CGROUP_TITLE = "CGroup.Title"; 
+       public static final String COMMAND_BOX_TEXT = "CommandBox.Text"; 
+       public static final String COMMAND_BOX_BACKGROUND = "CommandBox.Background"; 
        public static final String DASHBOARD_BACKGROUND = "Dashboard.Background"; 
        public static final String DIAL_CHART_LEGEND = "DialChart.Legend"; 
        public static final String DIAL_CHART_NEEDLE = "DialChart.Needle";
@@ -50,6 +52,16 @@ public class SharedColors
        public static final String MIB_EXPLORER_HEADER_BACKGROUND = "MibExplorer.Header.Background"; 
        public static final String MIB_EXPLORER_HEADER_TEXT = "MibExplorer.Header.Text"; 
        public static final String OBJECT_TAB_BACKGROUND = "ObjectTab.Background"; 
+       public static final String OBJECT_TAB_HEADER = "ObjectTab.Header"; 
+       public static final String OBJECT_TAB_HEADER_BACKGROUND = "ObjectTab.Header.Background";
+       public static final String RULE_EDITOR_BACKGROUND = "RuleEditor.Background";
+       public static final String RULE_EDITOR_NORMAL_TITLE_BACKGROUND = "RuleEditor.Title.Normal.Background";
+       public static final String RULE_EDITOR_DISABLED_TITLE_BACKGROUND = "RuleEditor.Title.Disabled.Background";
+       public static final String RULE_EDITOR_SELECTED_TITLE_BACKGROUND = "RuleEditor.Title.Selected.Background";
+       public static final String RULE_EDITOR_RULE_BORDER = "RuleEditor.Border.Rule";
+       public static final String RULE_EDITOR_CONDITION_BORDER = "RuleEditor.Border.Condition";
+       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 TEXT_ERROR = "Text.Error"; 
        public static final String TEXT_NORMAL = "Text.Normal"; 
@@ -67,6 +79,8 @@ public class SharedColors
                defaultColors.put(BORDER, new RGB(153, 180, 209));
                defaultColors.put(CGROUP_BORDER, new RGB(153, 180, 209));
                defaultColors.put(CGROUP_TITLE, new RGB(0, 0, 0));
+               defaultColors.put(COMMAND_BOX_TEXT, new RGB(0, 0, 96));
+               defaultColors.put(COMMAND_BOX_BACKGROUND, new RGB(255, 255, 255));
                defaultColors.put(DASHBOARD_BACKGROUND, new RGB(255, 255, 255));
                defaultColors.put(DIAL_CHART_LEGEND, new RGB(0, 0, 0));
                defaultColors.put(DIAL_CHART_NEEDLE, new RGB(51, 78, 113));
@@ -80,6 +94,16 @@ public class SharedColors
                defaultColors.put(MIB_EXPLORER_HEADER_BACKGROUND, new RGB(153, 180, 209));
                defaultColors.put(MIB_EXPLORER_HEADER_TEXT, new RGB(255, 255, 255));
                defaultColors.put(OBJECT_TAB_BACKGROUND, new RGB(255, 255, 255));
+               defaultColors.put(OBJECT_TAB_HEADER, new RGB(255, 255, 255));
+               defaultColors.put(OBJECT_TAB_HEADER_BACKGROUND, new RGB(153, 180, 209));
+               defaultColors.put(RULE_EDITOR_BACKGROUND, new RGB(255, 255, 255));
+               defaultColors.put(RULE_EDITOR_NORMAL_TITLE_BACKGROUND, new RGB(225, 233, 241));
+               defaultColors.put(RULE_EDITOR_DISABLED_TITLE_BACKGROUND, new RGB(202, 227, 206));
+               defaultColors.put(RULE_EDITOR_SELECTED_TITLE_BACKGROUND, new RGB(245, 249, 104));
+               defaultColors.put(RULE_EDITOR_RULE_BORDER, new RGB(153, 180, 209));
+               defaultColors.put(RULE_EDITOR_CONDITION_BORDER, new RGB(198,214,172));
+               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(TEXT_ERROR, new RGB(255, 0, 0));
                defaultColors.put(TEXT_NORMAL, new RGB(0, 0, 0));
index 74341b5..3b877f3 100644 (file)
-/**\r
- * NetXMS - open source network management system\r
- * Copyright (C) 2003-2011 Victor Kirhenshtein\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
- */\r
-package org.netxms.ui.eclipse.widgets;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.eclipse.jface.action.Action;\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.custom.CLabel;\r
-import org.eclipse.swt.events.DisposeEvent;\r
-import org.eclipse.swt.events.DisposeListener;\r
-import org.eclipse.swt.events.MouseEvent;\r
-import org.eclipse.swt.events.MouseListener;\r
-import org.eclipse.swt.graphics.Color;\r
-import org.eclipse.swt.graphics.Cursor;\r
-import org.eclipse.swt.graphics.Font;\r
-import org.eclipse.swt.graphics.Image;\r
-import org.eclipse.swt.layout.RowLayout;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Display;\r
-\r
-/**\r
- * Implements command box - vertical list of hyperlinks to given actions\r
- *\r
- */\r
-public class CommandBox extends Composite implements DisposeListener\r
-{\r
-       private static final long serialVersionUID = 1L;\r
-\r
-       private static final Color FOREGROUND_COLOR = new Color(Display.getDefault(), 0, 0, 96);\r
-       private static final Color BACKGROUND_COLOR = new Color(Display.getDefault(), 255, 255, 255);\r
-       \r
-       private List<Action> actions = new ArrayList<Action>();\r
-       private Map<ImageDescriptor, Image> imageCache = new HashMap<ImageDescriptor, Image>();\r
-       private Cursor cursor;\r
-       private Font font;\r
-       \r
-       /**\r
-        * @param parent\r
-        * @param style\r
-        */\r
-       public CommandBox(Composite parent, int style)\r
-       {\r
-               super(parent, style);\r
-               \r
-               setBackground(BACKGROUND_COLOR);\r
-               \r
-               cursor = new Cursor(getDisplay(), SWT.CURSOR_HAND);\r
-               font = new Font(getDisplay(), "Verdana", 9, SWT.NORMAL); //$NON-NLS-1$\r
-               \r
-               RowLayout layout = new RowLayout();\r
-               layout.type = SWT.VERTICAL;\r
-               setLayout(layout);\r
-               \r
-               addDisposeListener(this);\r
-       }\r
-\r
-       /**\r
-        * Rebuild command box\r
-        */\r
-       public void rebuild()\r
-       {\r
-               for(final Action a : actions)\r
-               {\r
-                       CLabel label = new CLabel(this, SWT.LEFT);\r
-                       label.setText(a.getText());\r
-                       label.setImage(getImage(a));\r
-                       label.setCursor(cursor);\r
-                       label.setForeground(FOREGROUND_COLOR);\r
-                       label.setBackground(BACKGROUND_COLOR);\r
-                       //label.setFont(font);\r
-                       label.addMouseListener(new MouseListener() {\r
-                               private static final long serialVersionUID = 1L;\r
-\r
-                               @Override\r
-                               public void mouseDoubleClick(MouseEvent e)\r
-                               {\r
-                               }\r
-\r
-                               @Override\r
-                               public void mouseDown(MouseEvent e)\r
-                               {\r
-                               }\r
-\r
-                               @Override\r
-                               public void mouseUp(MouseEvent e)\r
-                               {\r
-                                       if (e.button == 1)\r
-                                               a.run();\r
-                               }\r
-                       });\r
-               }\r
-               layout();\r
-       }\r
-       \r
-       /**\r
-        * Get (possibly cached) image for given action\r
-        * \r
-        * @param action action\r
-        * @return image for given action\r
-        */\r
-       private Image getImage(Action action)\r
-       {\r
-               ImageDescriptor d = action.getImageDescriptor();\r
-               Image img = null;\r
-               if (d != null)\r
-               {\r
-                       img = imageCache.get(d);\r
-                       if (img == null)\r
-                       {\r
-                               img = d.createImage();\r
-                               imageCache.put(d, img);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-               }\r
-               return img;\r
-       }\r
-       \r
-       /**\r
-        * Add new action\r
-        * \r
-        * @param action action\r
-        * @param doRebuild if set to true, rebuild() will be called\r
-        */\r
-       public void add(Action action, boolean doRebuild)\r
-       {\r
-               actions.add(action);\r
-               if (doRebuild)\r
-                       rebuild();\r
-       }\r
-       \r
-       /**\r
-        * Delete all actions\r
-        * \r
-        * @param doRebuild if set to true, rebuild() will be called\r
-        */\r
-       public void deleteAll(boolean doRebuild)\r
-       {\r
-               actions.clear();\r
-               for(Control c : getChildren())\r
-                       c.dispose();\r
-               if (doRebuild)\r
-                       rebuild();\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)\r
-        */\r
-       @Override\r
-       public void widgetDisposed(DisposeEvent e)\r
-       {\r
-               for(Image i : imageCache.values())\r
-                       i.dispose();\r
-               cursor.dispose();\r
-               font.dispose();\r
-       }\r
-}\r
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2011 Victor Kirhenshtein
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.widgets;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.netxms.ui.eclipse.console.resources.SharedColors;
+
+/**
+ * Implements command box - vertical list of hyperlinks to given actions
+ *
+ */
+public class CommandBox extends Composite implements DisposeListener
+{
+       private List<Action> actions = new ArrayList<Action>();
+       private Map<ImageDescriptor, Image> imageCache = new HashMap<ImageDescriptor, Image>();
+       private Cursor cursor;
+       private Font font;
+       
+       /**
+        * @param parent
+        * @param style
+        */
+       public CommandBox(Composite parent, int style)
+       {
+               super(parent, style);
+               
+               setBackground(SharedColors.getColor(SharedColors.COMMAND_BOX_BACKGROUND, getDisplay()));
+               
+               cursor = new Cursor(getDisplay(), SWT.CURSOR_HAND);
+               font = new Font(getDisplay(), "Verdana", 9, SWT.NORMAL); //$NON-NLS-1$
+               
+               RowLayout layout = new RowLayout();
+               layout.type = SWT.VERTICAL;
+               setLayout(layout);
+               
+               addDisposeListener(this);
+       }
+
+       /**
+        * Rebuild command box
+        */
+       public void rebuild()
+       {
+               for(final Action a : actions)
+               {
+                       CLabel label = new CLabel(this, SWT.LEFT);
+                       label.setText(a.getText());
+                       label.setImage(getImage(a));
+                       label.setCursor(cursor);
+                       label.setForeground(SharedColors.getColor(SharedColors.COMMAND_BOX_TEXT, getDisplay()));
+                       label.setBackground(SharedColors.getColor(SharedColors.COMMAND_BOX_BACKGROUND, getDisplay()));
+                       //label.setFont(font);
+                       label.addMouseListener(new MouseListener() {
+                               @Override
+                               public void mouseDoubleClick(MouseEvent e)
+                               {
+                               }
+
+                               @Override
+                               public void mouseDown(MouseEvent e)
+                               {
+                               }
+
+                               @Override
+                               public void mouseUp(MouseEvent e)
+                               {
+                                       if (e.button == 1)
+                                               a.run();
+                               }
+                       });
+               }
+               layout();
+       }
+       
+       /**
+        * Get (possibly cached) image for given action
+        * 
+        * @param action action
+        * @return image for given action
+        */
+       private Image getImage(Action action)
+       {
+               ImageDescriptor d = action.getImageDescriptor();
+               Image img = null;
+               if (d != null)
+               {
+                       img = imageCache.get(d);
+                       if (img == null)
+                       {
+                               img = d.createImage();
+                               imageCache.put(d, img);
+                       }
+               }
+               else
+               {
+               }
+               return img;
+       }
+       
+       /**
+        * Add new action
+        * 
+        * @param action action
+        * @param doRebuild if set to true, rebuild() will be called
+        */
+       public void add(Action action, boolean doRebuild)
+       {
+               actions.add(action);
+               if (doRebuild)
+                       rebuild();
+       }
+       
+       /**
+        * Delete all actions
+        * 
+        * @param doRebuild if set to true, rebuild() will be called
+        */
+       public void deleteAll(boolean doRebuild)
+       {
+               actions.clear();
+               for(Control c : getChildren())
+                       c.dispose();
+               if (doRebuild)
+                       rebuild();
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
+        */
+       @Override
+       public void widgetDisposed(DisposeEvent e)
+       {
+               for(Image i : imageCache.values())
+                       i.dispose();
+               cursor.dispose();
+               font.dispose();
+       }
+}
index 6e6403c..6ff2265 100644 (file)
@@ -38,7 +38,6 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Shell;
@@ -56,6 +55,7 @@ import org.netxms.client.events.EventProcessingPolicyRule;
 import org.netxms.client.events.EventTemplate;
 import org.netxms.client.objects.GenericObject;
 import org.netxms.client.situations.Situation;
+import org.netxms.ui.eclipse.console.resources.SharedColors;
 import org.netxms.ui.eclipse.console.resources.StatusDisplayInfo;
 import org.netxms.ui.eclipse.epp.Messages;
 import org.netxms.ui.eclipse.epp.SituationCache;
@@ -73,16 +73,6 @@ import org.netxms.ui.eclipse.widgets.helpers.DashboardElementButton;
 @SuppressWarnings("restriction")
 public class RuleEditor extends Composite
 {
-       private static final long serialVersionUID = 1L;
-
-       private static final Color BACKGROUND_COLOR = new Color(Display.getCurrent(), 255, 255, 255);
-       private static final Color NORMAL_TITLE_BACKGROUND_COLOR = new Color(Display.getCurrent(), 225, 233, 241);
-       private static final Color DISABLED_TITLE_BACKGROUND_COLOR = new Color(Display.getCurrent(), 202, 227, 206);
-       private static final Color SELECTED_TITLE_BACKGROUND_COLOR = new Color(Display.getCurrent(), 245, 249, 104);
-       private static final Color RULE_BORDER_COLOR = new Color(Display.getCurrent(), 153, 180, 209);
-       private static final Color CONDITION_BORDER_COLOR = new Color(Display.getCurrent(), 198,214,172);
-       private static final Color ACTION_BORDER_COLOR = new Color(Display.getCurrent(), 186,176,201);
-       private static final Color TITLE_COLOR = new Color(Display.getCurrent(), 0, 0, 0);
        private static final int INDENT = 20;
        
        private EventProcessingPolicyRule rule;
@@ -119,7 +109,7 @@ public class RuleEditor extends Composite
                session = (NXCSession)ConsoleSharedData.getSession();
                labelProvider = new WorkbenchLabelProvider();
                
-               setBackground(RULE_BORDER_COLOR);
+               setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_RULE_BORDER, getDisplay()));
 
                GridLayout layout = new GridLayout();
                layout.numColumns = 2;
@@ -130,8 +120,6 @@ public class RuleEditor extends Composite
                setLayout(layout);
                
                ruleMouseListener = new MouseListener() {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        public void mouseDoubleClick(MouseEvent e)
                        {
@@ -165,20 +153,16 @@ public class RuleEditor extends Composite
                createPopupMenu(new Control[] { leftPanel, ruleNumberLabel, header, headerLabel });
                
                condition = new CGroup(mainArea, Messages.RuleEditor_Filter) {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        protected Control createClientArea(Composite parent)
                        {
-                               setBorderColor(CONDITION_BORDER_COLOR);
-                               setTitleColor(TITLE_COLOR);
+                               setBorderColor(SharedColors.getColor(SharedColors.RULE_EDITOR_CONDITION_BORDER, getDisplay()));
+                               setTitleColor(SharedColors.getColor(SharedColors.RULE_EDITOR_TITLE_TEXT, getDisplay()));
                                return createConditionControl(parent, RuleEditor.this.rule);
                        }
                };
                configureLayout(condition);
                final Action editRuleCondition = new Action() {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        public void run()
                        {
@@ -189,20 +173,16 @@ public class RuleEditor extends Composite
                condition.setDoubleClickAction(editRuleCondition);
 
                action = new CGroup(mainArea, Messages.RuleEditor_Action) {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        protected Control createClientArea(Composite parent)
                        {
-                               setBorderColor(ACTION_BORDER_COLOR);
-                               setTitleColor(TITLE_COLOR);
+                               setBorderColor(SharedColors.getColor(SharedColors.RULE_EDITOR_ACTION_BORDER, getDisplay()));
+                               setTitleColor(SharedColors.getColor(SharedColors.RULE_EDITOR_TITLE_TEXT, getDisplay()));
                                return createActionControl(parent, RuleEditor.this.rule);
                        }
                };
                configureLayout(action);
                final Action editRuleAction = new Action() {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        public void run()
                        {
@@ -219,7 +199,7 @@ public class RuleEditor extends Composite
        private void createMainArea()
        {
                mainArea = new Composite(this, SWT.NONE);
-               mainArea.setBackground(BACKGROUND_COLOR);
+               mainArea.setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_BACKGROUND, getDisplay()));
                
                GridLayout layout = new GridLayout();
                layout.numColumns = verticalLayout ? 1 : 2;
@@ -241,7 +221,7 @@ public class RuleEditor extends Composite
        private void createLeftPanel()
        {
                leftPanel = new Composite(this, SWT.NONE);
-               leftPanel.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
+               leftPanel.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
                leftPanel.addMouseListener(ruleMouseListener);
                
                GridLayout layout = new GridLayout();
@@ -259,8 +239,8 @@ public class RuleEditor extends Composite
                ruleNumberLabel = new Label(leftPanel, SWT.NONE);
                ruleNumberLabel.setText(Integer.toString(ruleNumber));
                ruleNumberLabel.setFont(editor.getBoldFont());
-               ruleNumberLabel.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
-               ruleNumberLabel.setForeground(TITLE_COLOR);
+               ruleNumberLabel.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
+               ruleNumberLabel.setForeground(SharedColors.getColor(SharedColors.RULE_EDITOR_TITLE_TEXT, getDisplay()));
                ruleNumberLabel.setAlignment(SWT.CENTER);
                ruleNumberLabel.addMouseListener(ruleMouseListener);
                
@@ -282,8 +262,6 @@ public class RuleEditor extends Composite
                MenuManager menuMgr = new MenuManager();
                menuMgr.setRemoveAllWhenShown(true);
                menuMgr.addMenuListener(new IMenuListener() {
-                       private static final long serialVersionUID = 1L;
-
                        public void menuAboutToShow(IMenuManager mgr)
                        {
                                editor.fillRuleContextMenu(mgr);
@@ -303,7 +281,7 @@ public class RuleEditor extends Composite
        private void createHeader()
        {
                header = new Composite(this, SWT.NONE);
-               header.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
+               header.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
                header.addMouseListener(ruleMouseListener);
                
                GridLayout layout = new GridLayout();
@@ -320,16 +298,14 @@ public class RuleEditor extends Composite
                        headerLabel.setText(rule.getComments() + Messages.RuleEditor_DisabledSuffix);
                else
                        headerLabel.setText(rule.getComments());
-               headerLabel.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
-               headerLabel.setForeground(TITLE_COLOR);
+               headerLabel.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
+               headerLabel.setForeground(SharedColors.getColor(SharedColors.RULE_EDITOR_TITLE_TEXT, getDisplay()));
                headerLabel.setFont(editor.getNormalFont());
                gd = new GridData();
                gd.horizontalAlignment = SWT.FILL;
                gd.grabExcessHorizontalSpace = true;
                headerLabel.setLayoutData(gd);
                headerLabel.addMouseListener(new MouseListener() {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        public void mouseDoubleClick(MouseEvent e)
                        {
@@ -351,13 +327,11 @@ public class RuleEditor extends Composite
                });
                
                editButton = new Label(header, SWT.NONE);
-               editButton.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
+               editButton.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
                editButton.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_HAND));
                editButton.setImage(editor.getImageEdit());
                editButton.setToolTipText(Messages.RuleEditor_Tooltip_EditRule);
                editButton.addMouseListener(new MouseListener() {
-                       private static final long serialVersionUID = 1L;
-
                        private boolean doAction = false;
                        
                        @Override
@@ -383,13 +357,11 @@ public class RuleEditor extends Composite
                });
                
                expandButton = new Label(header, SWT.NONE);
-               expandButton.setBackground(rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR);
+               expandButton.setBackground(SharedColors.getColor(rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND, getDisplay()));
                expandButton.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_HAND));
                expandButton.setImage(collapsed ? editor.getImageExpand() : editor.getImageCollapse());
                expandButton.setToolTipText(collapsed ? Messages.RuleEditor_Tooltip_ExpandRule : Messages.RuleEditor_Tooltip_CollapseRule);
                expandButton.addMouseListener(new MouseListener() {
-                       private static final long serialVersionUID = 1L;
-
                        private boolean doAction = false;
                        
                        @Override
@@ -438,8 +410,6 @@ public class RuleEditor extends Composite
        private MouseListener createMouseListener(final String pageId)
        {
                return new MouseListener() {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        public void mouseUp(MouseEvent e)
                        {
@@ -469,7 +439,7 @@ public class RuleEditor extends Composite
        {
                Composite clientArea = new Composite(parent, SWT.NONE);
                
-               clientArea.setBackground(BACKGROUND_COLOR);
+               clientArea.setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_BACKGROUND, getDisplay()));
                GridLayout layout = new GridLayout();
                layout.verticalSpacing = 0;
                clientArea.setLayout(layout);
@@ -589,7 +559,7 @@ public class RuleEditor extends Composite
        private Label createLabel(Composite parent, int indent, boolean bold, String text, MouseListener mouseListener)
        {
                Label label = new Label(parent, SWT.NONE);
-               label.setBackground(BACKGROUND_COLOR);
+               label.setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_BACKGROUND, getDisplay()));
                label.setFont(bold ? editor.getBoldFont() : editor.getNormalFont());
                label.setText(text);
 
@@ -614,7 +584,7 @@ public class RuleEditor extends Composite
        private CLabel createCLabel(Composite parent, int indent, boolean bold)
        {
                CLabel label = new CLabel(parent, SWT.NONE);
-               label.setBackground(BACKGROUND_COLOR);
+               label.setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_BACKGROUND, getDisplay()));
                label.setFont(bold ? editor.getBoldFont() : editor.getNormalFont());
 
                GridData gd = new GridData();
@@ -663,7 +633,7 @@ public class RuleEditor extends Composite
        {
                Composite clientArea = new Composite(parent, SWT.NONE);
                
-               clientArea.setBackground(BACKGROUND_COLOR);
+               clientArea.setBackground(SharedColors.getColor(SharedColors.RULE_EDITOR_BACKGROUND, getDisplay()));
                GridLayout layout = new GridLayout();
                layout.verticalSpacing = 0;
                clientArea.setLayout(layout);
@@ -860,14 +830,12 @@ public class RuleEditor extends Composite
                Iterator pages = pageManager.getElements(PreferenceManager.PRE_ORDER).iterator();
                if (!pages.hasNext())
                {
-                       MessageDialogHelper.openInformation(shell, WorkbenchMessages.get().PropertyDialog_messageTitle,
-                                       NLS.bind(WorkbenchMessages.get().PropertyDialog_noPropertyMessage, name));
+                       MessageDialogHelper.openInformation(shell, WorkbenchMessages.PropertyDialog_messageTitle,
+                                       NLS.bind(WorkbenchMessages.PropertyDialog_noPropertyMessage, name));
                        return null;
                }
-               title = NLS.bind(WorkbenchMessages.get().PropertyDialog_propertyMessage, name);
+               title = NLS.bind(WorkbenchMessages.PropertyDialog_propertyMessage, name);
                PropertyDialog propertyDialog = new PropertyDialog(shell, pageManager, new StructuredSelection(element)) {
-                       private static final long serialVersionUID = 1L;
-
                        @Override
                        protected TreeViewer createTreeViewer(Composite parent)
                        {
@@ -989,7 +957,7 @@ public class RuleEditor extends Composite
        public void setSelected(boolean selected)
        {
                this.selected = selected;
-               final Color color = selected ? SELECTED_TITLE_BACKGROUND_COLOR : (rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR); 
+               final Color color = SharedColors.getColor(selected ? SharedColors.RULE_EDITOR_SELECTED_TITLE_BACKGROUND : (rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND), getDisplay());
                
                leftPanel.setBackground(color);
                for(Control c : leftPanel.getChildren())
@@ -1034,7 +1002,7 @@ public class RuleEditor extends Composite
         */
        private void updateBackground()
        {
-               final Color color = selected ? SELECTED_TITLE_BACKGROUND_COLOR : (rule.isDisabled() ? DISABLED_TITLE_BACKGROUND_COLOR : NORMAL_TITLE_BACKGROUND_COLOR); 
+               final Color color = SharedColors.getColor(selected ? SharedColors.RULE_EDITOR_SELECTED_TITLE_BACKGROUND : (rule.isDisabled() ? SharedColors.RULE_EDITOR_DISABLED_TITLE_BACKGROUND : SharedColors.RULE_EDITOR_NORMAL_TITLE_BACKGROUND), getDisplay());
                leftPanel.setBackground(color);
                for(Control c : leftPanel.getChildren())
                        c.setBackground(color);
index 09b2596..638f1c2 100644 (file)
@@ -63,10 +63,12 @@ public class ColumnFilterEditor extends DashboardComposite
                this.toolkit = toolkit;\r
                this.column = column;\r
                \r
+               toolkit.adapt(this);\r
+               \r
                GridLayout layout = new GridLayout();\r
                setLayout(layout);\r
                \r
-               final Composite header = new Composite(this, SWT.NONE);\r
+               final Composite header = toolkit.createComposite(this);\r
                layout = new GridLayout();\r
                layout.marginWidth = 0;\r
                layout.marginHeight = 0;\r
@@ -77,14 +79,13 @@ public class ColumnFilterEditor extends DashboardComposite
                gd.grabExcessHorizontalSpace = true;\r
                header.setLayoutData(gd);\r
                \r
-               final Label title = new Label(header, SWT.NONE);\r
-               title.setText(column.getDescription());\r
+               final Label title = toolkit.createLabel(header, column.getDescription());\r
                gd = new GridData();\r
                gd.horizontalAlignment = SWT.FILL;\r
                gd.grabExcessHorizontalSpace = false;\r
                title.setLayoutData(gd);\r
                \r
-               final Composite buttons = new Composite(header, SWT.NONE); \r
+               final Composite buttons = toolkit.createComposite(header); \r
                layout = new GridLayout();\r
                layout.marginWidth = 0;\r
                layout.marginHeight = 0;\r
@@ -131,7 +132,7 @@ public class ColumnFilterEditor extends DashboardComposite
                        }\r
                });\r
                \r
-               ImageHyperlink link = new ImageHyperlink(header, SWT.NONE);\r
+               ImageHyperlink link = toolkit.createImageHyperlink(header, SWT.NONE);\r
                link.setImage(SharedIcons.IMG_ADD_OBJECT);\r
                link.addHyperlinkListener(new HyperlinkAdapter() {\r
                        @Override\r
@@ -141,7 +142,7 @@ public class ColumnFilterEditor extends DashboardComposite
                        }\r
                });\r
 \r
-               link = new ImageHyperlink(header, SWT.NONE);\r
+               link = toolkit.createImageHyperlink(header, SWT.NONE);\r
                link.setImage(SharedIcons.IMG_DELETE_OBJECT);\r
                link.addHyperlinkListener(new HyperlinkAdapter() {\r
                        @Override\r
index fdba63a..89f18eb 100644 (file)
@@ -39,7 +39,6 @@ import org.eclipse.swt.custom.CTabFolder;
 import org.eclipse.swt.custom.CTabItem;\r
 import org.eclipse.swt.events.SelectionEvent;\r
 import org.eclipse.swt.events.SelectionListener;\r
-import org.eclipse.swt.graphics.Color;\r
 import org.eclipse.swt.graphics.Font;\r
 import org.eclipse.swt.layout.GridData;\r
 import org.eclipse.swt.layout.GridLayout;\r
@@ -76,7 +75,6 @@ public class TabbedObjectView extends ViewPart
        private CLabel header;\r
        private CTabFolder tabFolder;\r
        private Font headerFont;\r
-       private Color headerColor;\r
        private List<ObjectTab> tabs;\r
        private ISelectionService selectionService = null;\r
        private ISelectionListener selectionListener = null;\r
@@ -135,13 +133,12 @@ public class TabbedObjectView extends ViewPart
                parent.setLayout(layout);\r
                \r
                headerFont = new Font(parent.getDisplay(), "Verdana", 11, SWT.BOLD);\r
-               headerColor = new Color(parent.getDisplay(), 153, 180, 209);\r
                \r
                header = new CLabel(parent, SWT.BORDER);\r
                header.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));\r
                header.setFont(headerFont);\r
-               header.setBackground(headerColor);\r
-               header.setForeground(SharedColors.getColor(SharedColors.OBJECT_TAB_BACKGROUND, parent.getDisplay()));\r
+               header.setBackground(SharedColors.getColor(SharedColors.OBJECT_TAB_HEADER_BACKGROUND, parent.getDisplay()));\r
+               header.setForeground(SharedColors.getColor(SharedColors.OBJECT_TAB_HEADER, parent.getDisplay()));\r
                \r
                tabFolder = new CTabFolder(parent, SWT.TOP | SWT.FLAT | SWT.MULTI);\r
                tabFolder.setUnselectedImageVisible(true);\r
@@ -398,7 +395,6 @@ public class TabbedObjectView extends ViewPart
                        tab.dispose();\r
                }\r
                headerFont.dispose();\r
-               headerColor.dispose();\r
                super.dispose();\r
        }\r
 }\r