|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.commons.swt.controls.ColorButton
public class ColorButton
An instance of ICustomControl that creates a button that when pressed pops up the color picker dialog. When the color picked via the dialog changes the color of the button will also change, and clients who are registered listeners of this control will be notified that a color update has occured.
Constructor Summary | |
---|---|
ColorButton(org.eclipse.swt.widgets.Composite parent,
java.lang.String id)
Constructs a new instance of the class given the parent Composite, and id which can be used to later identify this control. |
Method Summary | |
---|---|
void |
addListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Adds a listener to the control. |
void |
dispose()
|
org.eclipse.swt.widgets.Button |
getButton()
Returns the button that is used to launch the Color Picker dialog. |
org.eclipse.swt.graphics.RGB |
getColorValue()
Return the current color value (could be null). |
java.lang.String |
getId()
Returns a string identifier associated with the current widget/control |
void |
removeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Removes a listener from the control. |
void |
setColorValue(org.eclipse.swt.graphics.RGB rgbVal)
Sets the initial color of the control. |
void |
setId(java.lang.String id)
Sets a string identifier on the current widget/control. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorButton(org.eclipse.swt.widgets.Composite parent, java.lang.String id)
parent
- a Composite control which will be the parent of the new instance (CANNOT be null).id
- the programmatic ID of the control once constructed.Method Detail |
---|
public void dispose()
public java.lang.String getId()
ICustomControl
getId
in interface ICustomControl
public void setId(java.lang.String id)
ICustomControl
setId
in interface ICustomControl
public void addListener(org.eclipse.jface.util.IPropertyChangeListener listener)
if("Color".equals(event.getProperty()){
//DO SOMETHING BASED ON THE NEW COLOR
}
listener
- org.eclipse.jface.util.IPropertyChangeListenerpublic void removeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
listener
- org.eclipse.jface.util.IPropertyChangeListenerpublic org.eclipse.swt.widgets.Button getButton()
public org.eclipse.swt.graphics.RGB getColorValue()
public void setColorValue(org.eclipse.swt.graphics.RGB rgbVal)
rgbVal
- org.eclipse.swt.graphics.RGB
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |