Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.preference
Class ColorSelector


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 
org.eclipse.jface.preference.ColorSelector

public class ColorSelector
extends EventManager

The ColorSelector is a wrapper for a button that displays a selected Color and allows the user to change the selection.


Field Summary
static  String PROP_COLORCHANGE
          Property name that signifies the selected color of this ColorSelector has changed.
 
Constructor Summary
ColorSelector ( Composite parent)
          Create a new instance of the reciever and the button that it wrappers in the supplied parent Composite.
 
Method Summary
 void addListener ( IPropertyChangeListener listener)
          Adds a property change listener to this ColorSelector.
  Button getButton ()
          Get the button control being wrappered by the selector.
  RGB getColorValue ()
          Return the currently displayed color.
 void open ()
          Activate the editor for this selector.
 void removeListener ( IPropertyChangeListener listener)
          Removes the given listener from this ColorSelector.
 void setColorValue ( RGB rgb)
          Set the current color value and update the control.
 void setEnabled (boolean state)
          Set whether or not the button is enabled.
protected  void updateColorImage ()
          Update the image being displayed on the button using the current color setting.
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_COLORCHANGE

public static final 
String PROP_COLORCHANGE
Property name that signifies the selected color of this ColorSelector has changed.

Since:
3.0
See Also:
Constant Field Values
Constructor Detail

ColorSelector

public ColorSelector(
Composite parent)
Create a new instance of the reciever and the button that it wrappers in the supplied parent Composite.

Parameters:
parent - The parent of the button.
Method Detail

addListener

public void addListener(
IPropertyChangeListener listener)
Adds a property change listener to this ColorSelector. Events are fired when the color in the control changes via the user clicking an selecting a new one in the color dialog. No event is fired in the case where setColorValue(RGB) is invoked.

Parameters:
listener - a property change listener
Since:
3.0

getButton

public 
Button getButton()
Get the button control being wrappered by the selector.

Returns:
Button

getColorValue

public 
RGB getColorValue()
Return the currently displayed color.

Returns:
RGB

removeListener

public void removeListener(
IPropertyChangeListener listener)
Removes the given listener from this ColorSelector. Has no affect if the listener is not registered.

Parameters:
listener - a property change listener
Since:
3.0

setColorValue

public void setColorValue(
RGB rgb)
Set the current color value and update the control.

Parameters:
rgb - The new color.

setEnabled

public void setEnabled(boolean state)
Set whether or not the button is enabled.

Parameters:
state - the enabled state.

updateColorImage

protected void updateColorImage()
Update the image being displayed on the button using the current color setting.


open

public void open()
Activate the editor for this selector. This causes the color selection dialog to appear and wait for user input.

Since:
3.2

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire