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

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

public class ButtonComponent
extends OptionComponent<Object>

Button component to perform some action. Nothing gets saved.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
OptionComponent.ChangeListener
 
Field Summary
protected  JButton _jb
           
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
ButtonComponent(ActionListener l, String text, SwingFrame parent)
          Constructs a new ButtonComponent.
ButtonComponent(ActionListener l, String text, SwingFrame parent, String description)
          Constructs a new ButtonComponent with a tooltip description.
 
Method Summary
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void setDescription(String description)
          Sets the tooltip description text for this option.
 void setValue(Object 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
 

Field Detail

_jb

protected JButton _jb
Constructor Detail

ButtonComponent

public ButtonComponent(ActionListener l,
                       String text,
                       SwingFrame parent)
Constructs a new ButtonComponent.

Parameters:
l - the listener that gets executed when the button is pressed
text - the text to display with the option
parent - the parent frame

ButtonComponent

public ButtonComponent(ActionListener l,
                       String text,
                       SwingFrame parent,
                       String description)
Constructs a new ButtonComponent with a tooltip description.

Parameters:
l - the listener that gets executed when the button is pressed
text - the text to display with the option
parent - the parent frame
description - text to show in a tooltip over
Method Detail

setDescription

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

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

updateConfig

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

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

setValue

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

Specified by:
setValue in class OptionComponent<Object>

getComponent

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

Specified by:
getComponent in class OptionComponent<Object>