Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 8975 Details for
Bug 53721
[Font/Colour] Still too many lines with uncoordinated colors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
SWT Color Viewer
SWTColors.java (text/plain), 3.00 KB, created by
Michael Van Meekeren
on 2004-03-29 10:38:32 EST
(
hide
)
Description:
SWT Color Viewer
Filename:
MIME Type:
Creator:
Michael Van Meekeren
Created:
2004-03-29 10:38:32 EST
Size:
3.00 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Shell; > >/* > * Created on Mar 29, 2004 > * > * To change the template for this generated file go to > * Window - Preferences - Java - Code Generation - Code and Comments > */ >/** > * @author MVM > * > * To change the template for this generated type comment go to > * Window - Preferences - Java - Code Generation - Code and Comments > */ >public class SWTColors { > > public static void main(String[] args) { > final Display display = new Display(); > Shell shell = new Shell(display); > > GridLayout gd = new GridLayout(2, false); > shell.setLayout(gd); > > String [] names = getColorNames(); > int [] colors = getColors(); > > for (int i=0;i<colors.length; i++) { > createColorViewer(i, shell, colors[i], names[i]); > } > > shell.pack(); > > shell.open(); > shell.redraw(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > /** > * @param i > * @param shell > */ > private static void createColorViewer(int i, Shell shell, int j, String string) { > Label color = new Label(shell, SWT.SHADOW_IN); > color.setBackground(shell.getDisplay().getSystemColor(j)); > color.setLayoutData(new GridData(50, 20)); > > Label name = new Label(shell, SWT.NONE); > name.setText(string); > > > } > > /** > * @return an array of SWT color values > */ > private static int[] getColors() { > return new int[] { > SWT.COLOR_WIDGET_DARK_SHADOW, > SWT.COLOR_WIDGET_NORMAL_SHADOW, > SWT.COLOR_WIDGET_LIGHT_SHADOW, > SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW, > SWT.COLOR_WIDGET_FOREGROUND, > SWT.COLOR_WIDGET_BACKGROUND, > SWT.COLOR_WIDGET_BORDER, > SWT.COLOR_LIST_FOREGROUND, > SWT.COLOR_LIST_BACKGROUND, > SWT.COLOR_LIST_SELECTION, > SWT.COLOR_LIST_SELECTION_TEXT, > SWT.COLOR_INFO_FOREGROUND, > SWT.COLOR_INFO_BACKGROUND, > SWT.COLOR_TITLE_FOREGROUND, > SWT.COLOR_TITLE_BACKGROUND, > SWT.COLOR_TITLE_BACKGROUND_GRADIENT, > SWT.COLOR_TITLE_INACTIVE_FOREGROUND, > SWT.COLOR_TITLE_INACTIVE_BACKGROUND, > SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT > }; > } > > /** > * @return an array of SWT color names > */ > private static String[] getColorNames() { > return new String[] { > "COLOR_WIDGET_DARK_SHADOW", > "COLOR_WIDGET_NORMAL_SHADOW", > "COLOR_WIDGET_LIGHT_SHADOW", > "COLOR_WIDGET_HIGHLIGHT_SHADOW", > "COLOR_WIDGET_FOREGROUND", > "COLOR_WIDGET_BACKGROUND", > "COLOR_WIDGET_BORDER", > "COLOR_LIST_FOREGROUND", > "COLOR_LIST_BACKGROUND", > "COLOR_LIST_SELECTION", > "COLOR_LIST_SELECTION_TEXT", > "COLOR_INFO_FOREGROUND", > "COLOR_INFO_BACKGROUND", > "COLOR_TITLE_FOREGROUND", > "COLOR_TITLE_BACKGROUND", > "COLOR_TITLE_BACKGROUND_GRADIENT", > "COLOR_TITLE_INACTIVE_FOREGROUND", > "COLOR_TITLE_INACTIVE_BACKGROUND", > "COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT" > }; > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 53721
:
8325
|
8717
|
8718
| 8975