[Title] Advanced Declaration View: font color bugs.
authorSujin Kim <sujin921.kim@samsung.com>
Wed, 17 Apr 2013 18:16:16 +0000 (03:16 +0900)
committerhyukmin kwon <hyukmin0530.kwon@samsung.com>
Wed, 17 Apr 2013 18:16:16 +0000 (03:16 +0900)
[Desc.] 1. Changed foreground font color from SWT.COLOR_INFO_FOREGROUND
to colorkey(0,0,0). The former color has White on Linux.
2. Rearranged preference page for configuring theme. Created a "Tizen
Advanced Declaration View" category and separated with "JavaScript"
category.
[Issue]

Change-Id: I8a32ae88a38587545ff042957220c8052c2f3310

org.tizen.web.advanceddeclarationview/plugin.xml
org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/GUIBuilderDeclarationPage.java
org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/JSDeclarationPage.java

index 1f532f9..4f78650 100644 (file)
             id="org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView">
       </view>
    </extension>
-     
+   
+   <extension
+        point="org.eclipse.ui.themes">
+      <themeElementCategory
+       id="org.tizen.adv.settingCategory"
+       label="Tizen Advanced Declaration View">
+      </themeElementCategory>
+   </extension>
+
+   <extension
+        point="org.eclipse.ui.themes">
+      <colorDefinition
+            label="Declaration view foreground"
+            categoryId="org.tizen.adv.settingCategory"
+            value="0,0,0"
+            id="org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.foregroundColor">
+         <description>
+            The color used as foreground for the Advanced Declaration view.
+         </description>
+      </colorDefinition>
+   </extension>
+
    <extension
         point="org.eclipse.ui.themes">
       <colorDefinition
             label="Declaration view background"
-            categoryId="org.eclipse.wst.jsdt.ui.presentation"
+            categoryId="org.tizen.adv.settingCategory"
             value="242,254,255"
             id="org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.backgroundColor">
          <description>
-            The color used as background for the JavaScript Declaration view.
+            The color used as background for the Advanced Declaration view.
          </description>
       </colorDefinition>
    </extension>
index 0e8348d..4c231f4 100644 (file)
@@ -507,11 +507,19 @@ IMenuListener, IPropertyChangeListener {
                        return;
                }
 
-               setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
-               
                ColorRegistry registry= JFaceResources.getColorRegistry();
                registry.addListener(this);
-               
+
+               RGB foregroundRGB = registry.getRGB(getForegroundColorKey());
+               Color fgColor;
+               if (foregroundRGB == null) {
+                       fgColor = display.getSystemColor(SWT.COLOR_BLACK);
+               } else {
+                       fgColor = new Color(display, foregroundRGB);
+               }               
+               setForeground(fgColor);
+
+
                fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey());
                Color bgColor;
                if (fBackgroundColorRGB == null) {
@@ -556,6 +564,17 @@ IMenuListener, IPropertyChangeListener {
        protected String getBackgroundColorKey() {
                return "org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.backgroundColor";               //$NON-NLS-1$
        }
+       
+       /**
+        * The preference key for the foreground color.
+        * 
+        * @return the foreground color key
+        * 
+        */
+       protected String getForegroundColorKey() {
+               return "org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.foregroundColor";               //$NON-NLS-1$
+       }
+
                
        /*
         * @see IWorkbenchPart#dispose()
@@ -879,7 +898,7 @@ IMenuListener, IPropertyChangeListener {
 
        @Override
        public void propertyChange(PropertyChangeEvent event) {
-               if (getBackgroundColorKey().equals(event.getProperty())) {
+               if (getBackgroundColorKey().equals(event.getProperty()) || getForegroundColorKey().equals(event.getProperty())) {
                        inititalizeColors();
                }
        }
index 091aef9..571077a 100644 (file)
@@ -564,10 +564,17 @@ public class JSDeclarationPage extends DeclarationPage implements ISelectionList
                        return;
                }
 
-               setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
-               
                ColorRegistry registry= JFaceResources.getColorRegistry();
                registry.addListener(this);
+
+               RGB foregroundRGB = registry.getRGB(getForegroundColorKey());
+               Color fgColor;
+               if (foregroundRGB == null) {
+                       fgColor = display.getSystemColor(SWT.COLOR_BLACK);
+               } else {
+                       fgColor = new Color(display, foregroundRGB);
+               }               
+               setForeground(fgColor);
                
                fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey());
                Color bgColor;
@@ -692,6 +699,16 @@ public class JSDeclarationPage extends DeclarationPage implements ISelectionList
                return "org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.backgroundColor";               //$NON-NLS-1$
        }
        
+       /**
+        * The preference key for the foreground color.
+        * 
+        * @return the foreground color key
+        * 
+        */
+       protected String getForegroundColorKey() {
+               return "org.tizen.web.advanceddeclarationview.ui.AdvancedDeclarationView.foregroundColor";               //$NON-NLS-1$
+       }
+       
        
        /**
         * Tries to get a JavaScript element out of the given element.
@@ -1095,7 +1112,7 @@ public class JSDeclarationPage extends DeclarationPage implements ISelectionList
 
        @Override
        public void propertyChange(PropertyChangeEvent event) {
-               if (getBackgroundColorKey().equals(event.getProperty())) {
+               if (getBackgroundColorKey().equals(event.getProperty()) || getForegroundColorKey().equals(event.getProperty())) {
                        inititalizeColors();
                }
        }