|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.ui.config.OptionComponent<T>
public abstract class OptionComponent<T>
The graphical form of an Option. Provides a way to see the values of Option while running DrJava and perform live updating of Options.
Nested Class Summary | |
---|---|
static interface |
OptionComponent.ChangeListener
Interface for change listener. |
Field Summary | |
---|---|
protected boolean |
_entireColumn
|
protected JLabel |
_label
|
protected String |
_labelText
|
protected Option<T> |
_option
|
protected SwingFrame |
_parent
|
Constructor Summary | |
---|---|
OptionComponent(Option<T> option,
String labelText,
SwingFrame parent)
|
|
OptionComponent(String labelText,
SwingFrame parent)
Special constructor for degenerate option components does not take an option. |
Method Summary | |
---|---|
void |
addChangeListener(OptionComponent.ChangeListener listener)
Adds a change listener to this component. |
abstract JComponent |
getComponent()
Returns the JComponent to display for this OptionComponent. |
boolean |
getEntireColumn()
Whether the component should occupy the entire column. |
JLabel |
getLabel()
|
String |
getLabelText()
|
Option<T> |
getOption()
|
protected void |
notifyChangeListeners()
Notify all change listeners of a change. |
void |
removeChangeListener(OptionComponent.ChangeListener listener)
Removes a change listener to this component. |
void |
resetToCurrent()
Resets the entry field to reflect the actual stored value for the option. |
void |
resetToDefault()
Resets the actual value of the component to the original default. |
abstract void |
setDescription(String description)
Sets the detailed description text for all components in this OptionComponent. |
OptionComponent<T> |
setEntireColumn(boolean entireColumn)
Whether the component should occupy the entire column. |
abstract void |
setValue(T value)
Sets the value that is currently displayed by this component. |
void |
showErrorMessage(String title,
OptionParseException e)
|
void |
showErrorMessage(String title,
String value,
String message)
|
abstract boolean |
updateConfig()
Updates the appropriate configuration option with the new value if different from the old one and legal. |
boolean |
useEntireColumn()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Option<T> _option
protected final JLabel _label
protected final SwingFrame _parent
protected volatile boolean _entireColumn
protected volatile String _labelText
Constructor Detail |
---|
public OptionComponent(Option<T> option, String labelText, SwingFrame parent)
public OptionComponent(String labelText, SwingFrame parent)
labelText
- Text for descriptive label of this option.parent
- The parent frame.Method Detail |
---|
public Option<T> getOption()
public String getLabelText()
public JLabel getLabel()
public boolean useEntireColumn()
public abstract JComponent getComponent()
public abstract void setDescription(String description)
description
- the description of the componentpublic OptionComponent<T> setEntireColumn(boolean entireColumn)
public boolean getEntireColumn()
public abstract boolean updateConfig()
public void resetToCurrent()
public void resetToDefault()
public abstract void setValue(T value)
public void showErrorMessage(String title, OptionParseException e)
public void showErrorMessage(String title, String value, String message)
public void addChangeListener(OptionComponent.ChangeListener listener)
listener
- listener to addpublic void removeChangeListener(OptionComponent.ChangeListener listener)
listener
- listener to removeprotected void notifyChangeListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |