org.apache.pivot.wtk
Class ColorChooserButton

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Button
          extended by org.apache.pivot.wtk.ColorChooserButton
All Implemented Interfaces:
ConstrainedVisual, Visual

public class ColorChooserButton
extends Button

A component that allows a user to select a color. The color chooser is hidden until the user pushes the button.


Nested Class Summary
static interface ColorChooserButton.Skin
          ColorChooserButton skin interface.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Button
Button.ButtonDataBindMapping, Button.DataRenderer, Button.SelectedBindMapping, Button.State, Button.StateBindMapping
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Constructor Summary
ColorChooserButton()
           
ColorChooserButton(Object buttonData)
           
 
Method Summary
 void clear()
          If a bind key is set, clears the selected color.
 ListenerList<ColorChooserButtonBindingListener> getColorChooserButtonBindingListeners()
          Returns the color chooser button binding listener list.
 ListenerList<ColorChooserButtonSelectionListener> getColorChooserButtonSelectionListeners()
          Returns the color chooser button selection listener list.
 Window getListPopup()
           
 Color getSelectedColor()
          Returns the currently selected color.
 ColorChooser.SelectedColorBindMapping getSelectedColorBindMapping()
           
 BindType getSelectedColorBindType()
           
 String getSelectedColorKey()
          Gets the data binding key that is set on this color chooser button.
 void load(Object context)
          Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.
 void setSelectedColor(Color selectedColor)
          Sets the selected color.
 void setSelectedColor(String selectedColor)
          Sets the selected color.
 void setSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping bindMapping)
           
 void setSelectedColorBindType(BindType selectedColorBindType)
           
 void setSelectedColorKey(String selectedColorKey)
          Sets this color chooser button's data binding key.
protected  void setSkin(Skin skin)
          Sets the skin, replacing any previous skin.
 void setToggleButton(boolean toggleButton)
          Sets the button's toggle state.
 void store(Object context)
          Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.
 
Methods inherited from class org.apache.pivot.wtk.Button
getAction, getButtonBindingListeners, getButtonData, getButtonDataBindMapping, getButtonDataBindType, getButtonDataKey, getButtonGroup, getButtonListeners, getButtonPressListeners, getButtonStateListeners, getDataRenderer, getSelectedBindMapping, getSelectedBindType, getSelectedKey, getState, getStateBindMapping, getStateBindType, getStateKey, isSelected, isToggleButton, isTriState, press, setAction, setAction, setButtonData, setButtonDataBindMapping, setButtonDataBindType, setButtonDataKey, setButtonGroup, setDataRenderer, setEnabled, setSelected, setSelectedBindMapping, setSelectedBindType, setSelectedKey, setState, setStateBindMapping, setStateBindType, setStateKey, setTriState
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, contains, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, paint, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setDragSource, setDropTarget, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setParent, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setVisible, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorChooserButton

public ColorChooserButton()

ColorChooserButton

public ColorChooserButton(Object buttonData)
Method Detail

setSkin

protected void setSkin(Skin skin)
Description copied from class: Component
Sets the skin, replacing any previous skin.

Overrides:
setSkin in class Component
Parameters:
skin - The new skin.

getListPopup

public Window getListPopup()
Returns:
the popup window associated with this components skin

setToggleButton

public void setToggleButton(boolean toggleButton)
Description copied from class: Button
Sets the button's toggle state.

Overrides:
setToggleButton in class Button
Throws:
UnsupportedOperationException - This method is not supported by ColorChooserButton.

getSelectedColor

public Color getSelectedColor()
Returns the currently selected color.

Returns:
The currently selected color, or null if nothing is selected.

setSelectedColor

public void setSelectedColor(Color selectedColor)
Sets the selected color.

Parameters:
selectedColor - The color to select, or null to clear the selection.

setSelectedColor

public final void setSelectedColor(String selectedColor)
Sets the selected color.

Parameters:
selectedColor - A string representing a color.

getSelectedColorKey

public String getSelectedColorKey()
Gets the data binding key that is set on this color chooser button.


setSelectedColorKey

public void setSelectedColorKey(String selectedColorKey)
Sets this color chooser button's data binding key.


getSelectedColorBindType

public BindType getSelectedColorBindType()

setSelectedColorBindType

public void setSelectedColorBindType(BindType selectedColorBindType)

getSelectedColorBindMapping

public ColorChooser.SelectedColorBindMapping getSelectedColorBindMapping()

setSelectedColorBindMapping

public void setSelectedColorBindMapping(ColorChooser.SelectedColorBindMapping bindMapping)

load

public void load(Object context)
Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.

Overrides:
load in class Button

store

public void store(Object context)
Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.

Overrides:
store in class Button

clear

public void clear()
If a bind key is set, clears the selected color.

Overrides:
clear in class Button

getColorChooserButtonSelectionListeners

public ListenerList<ColorChooserButtonSelectionListener> getColorChooserButtonSelectionListeners()
Returns the color chooser button selection listener list.


getColorChooserButtonBindingListeners

public ListenerList<ColorChooserButtonBindingListener> getColorChooserButtonBindingListeners()
Returns the color chooser button binding listener list.