edu.rice.cs.drjava.ui.config
Class ButtonComponent
java.lang.Object
edu.rice.cs.drjava.ui.config.OptionComponent<java.lang.Object,javax.swing.JButton>
edu.rice.cs.drjava.ui.config.ButtonComponent
- All Implemented Interfaces:
- java.io.Serializable
public class ButtonComponent
- extends OptionComponent<java.lang.Object,javax.swing.JButton>
Button component to perform some action. Nothing gets saved.
- See Also:
- Serialized Form
|
Field Summary |
protected javax.swing.JButton |
_jb
|
|
Constructor Summary |
ButtonComponent(java.awt.event.ActionListener l,
java.lang.String text,
SwingFrame parent)
Constructs a new ButtonComponent. |
ButtonComponent(java.awt.event.ActionListener l,
java.lang.String text,
SwingFrame parent,
java.lang.String description)
Constructs a new ButtonComponent with a tooltip description. |
|
Method Summary |
void |
setDescription(java.lang.String description)
Sets the tooltip description text for this option. |
void |
setValue(java.lang.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, getComponent, getEntireColumn, getLabel, getLabelText, getOption, notifyChangeListeners, removeChangeListener, resetToCurrent, resetToDefault, setComponent, setEntireColumn, showErrorMessage, showErrorMessage, useEntireColumn |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_jb
protected javax.swing.JButton _jb
ButtonComponent
public ButtonComponent(java.awt.event.ActionListener l,
java.lang.String text,
SwingFrame parent)
- Constructs a new ButtonComponent.
- Parameters:
l - the listener that gets executed when the button is pressedtext - the text to display with the optionparent - the parent frame
ButtonComponent
public ButtonComponent(java.awt.event.ActionListener l,
java.lang.String text,
SwingFrame parent,
java.lang.String description)
- Constructs a new ButtonComponent with a tooltip description.
- Parameters:
l - the listener that gets executed when the button is pressedtext - the text to display with the optionparent - the parent framedescription - text to show in a tooltip over
setDescription
public void setDescription(java.lang.String description)
- Sets the tooltip description text for this option.
- Specified by:
setDescription in class OptionComponent<java.lang.Object,javax.swing.JButton>
- Parameters:
description - the tooltip text
updateConfig
public boolean updateConfig()
- Updates the config object with the new setting.
- Specified by:
updateConfig in class OptionComponent<java.lang.Object,javax.swing.JButton>
- Returns:
- true if the new value is set successfully
setValue
public void setValue(java.lang.Object value)
- Displays the given value.
- Specified by:
setValue in class OptionComponent<java.lang.Object,javax.swing.JButton>