edu.rice.cs.drjava.ui.config
Class ColorOptionComponent

java.lang.Object
  extended by edu.rice.cs.drjava.ui.config.OptionComponent<Color>
      extended by edu.rice.cs.drjava.ui.config.ColorOptionComponent
All Implemented Interfaces:
Serializable

public class ColorOptionComponent
extends OptionComponent<Color>

Graphical form of a ColorOption.

Version:
$Id: ColorOptionComponent.java 4548 2008-07-09 14:08:44Z rcartwright $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
OptionComponent.ChangeListener
 
Field Summary
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent)
          Main constructor for ColorOptionComponent.
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent, boolean isBackgroundColor)
          An alternate constructor, allowing the caller to specify whether this color is a background color.
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent, boolean isBackgroundColor, boolean isBoldText)
           
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent, String description)
          Constructor that allows for a tooltip description.
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent, String description, boolean isBackgroundColor)
          Constructor that allows for a tooltip description as well as whether or not this is a background color.
ColorOptionComponent(ColorOption opt, String text, SwingFrame parent, String description, boolean isBackgroundColor, boolean isBoldText)
          Constructor that allows for a tooltip description as well as whether or not this is a background color.
 
Method Summary
 void chooseColor()
          Shows a color chooser dialog for picking a new color.
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void setDescription(String description)
          Sets the tooltip description text for this option.
 void setValue(Color value)
          Displays the given value.
 boolean updateConfig()
          Updates the config object with the new setting.
 
Methods inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
addChangeListener, getEntireColumn, getLabel, getLabelText, getOption, notifyChangeListeners, removeChangeListener, resetToCurrent, resetToDefault, setEntireColumn, showErrorMessage, showErrorMessage, useEntireColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent)
Main constructor for ColorOptionComponent.

Parameters:
opt - The ColorOption to display
text - The text to display in the label of the component
parent - The Frame displaying this component

ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent,
                            boolean isBackgroundColor)
An alternate constructor, allowing the caller to specify whether this color is a background color. If so, the button will display the color as its background.


ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent,
                            boolean isBackgroundColor,
                            boolean isBoldText)

ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent,
                            String description)
Constructor that allows for a tooltip description.


ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent,
                            String description,
                            boolean isBackgroundColor)
Constructor that allows for a tooltip description as well as whether or not this is a background color.


ColorOptionComponent

public ColorOptionComponent(ColorOption opt,
                            String text,
                            SwingFrame parent,
                            String description,
                            boolean isBackgroundColor,
                            boolean isBoldText)
Constructor that allows for a tooltip description as well as whether or not this is a background color.

Method Detail

setDescription

public void setDescription(String description)
Sets the tooltip description text for this option.

Specified by:
setDescription in class OptionComponent<Color>
Parameters:
description - the tooltip text

updateConfig

public boolean updateConfig()
Updates the config object with the new setting.

Specified by:
updateConfig in class OptionComponent<Color>
Returns:
true if the new value is set successfully

setValue

public void setValue(Color value)
Displays the given value.

Specified by:
setValue in class OptionComponent<Color>

getComponent

public JComponent getComponent()
Return's this OptionComponent's configurable component.

Specified by:
getComponent in class OptionComponent<Color>

chooseColor

public void chooseColor()
Shows a color chooser dialog for picking a new color.