Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 307569

Summary: ColorSelector should show some color preview
Product: [RT] RAP Reporter: Austin Riddle <austin.riddle>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Austin Riddle CLA 2010-03-30 14:21:57 EDT
Since it is not possible at the moment to have the color previewed via normal means, I just thought I would share this patch, which uses text to show the currently selected color:



### Eclipse Workspace Patch 1.0
#P org.eclipse.rap.jface
Index: src/org/eclipse/jface/preference/ColorSelector.java
===================================================================
RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.jface/src/org/eclipse/jface/preference/ColorSelector.java,v
retrieving revision 1.4
diff -u -r1.4 ColorSelector.java
--- src/org/eclipse/jface/preference/ColorSelector.java	11 Sep 2009 09:31:31 -0000	1.4
+++ src/org/eclipse/jface/preference/ColorSelector.java	30 Mar 2010 18:18:59 -0000
@@ -74,6 +74,7 @@
 //        gc.fillRectangle(0, 0, fExtent.x, fExtent.y);
 //        gc.dispose();
 //        fButton.setImage(fImage);
+        fButton.setText("#####"); //$NON-NLS-1$
         fButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent event) {
                 open();
@@ -208,6 +209,7 @@
 //        gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
 //        gc.dispose();
 //        fButton.setImage(fImage);
+      fButton.setForeground( fColor );
       fButton.setBackground( fColor );
     }
Comment 1 Ivan Furnadjiev CLA 2010-04-12 08:28:20 EDT
Fixed in a similar way in ColorSelector.Three unicode characters \u2588 ( full block ) are used in the text instead of '#'.