edu.rice.cs.drjava.ui.config
Class ToolbarOptionComponent
java.lang.Object
|
+--edu.rice.cs.drjava.ui.config.OptionComponent
|
+--edu.rice.cs.drjava.ui.config.ToolbarOptionComponent
- public class ToolbarOptionComponent
- extends OptionComponent
The special option component for the toolbar text and toolbar icon options.
Not a true OptionComponent, in that it actually represents and governs the
configuration of two BooleanOptions (i.e. those corresponding to TOOLBAR_TEXT_ENABLED
and TOOLBAR_ICONS_ENABLED) bypassing the the normal graphical representation
with JRadioButtons, in order to comply with the special circumstances regarding
their setting.
- Version:
- $Id: ToolbarOptionComponent.java,v 1.5 2002/09/02 21:24:13 csreis Exp $
Constructor Summary |
ToolbarOptionComponent(String title,
Frame parent)
The constructor does not take an option since we have specific knowledge of the
two options we'll need for this component. |
Method Summary |
private void |
_setSelected(boolean textEnabled,
boolean iconsEnabled)
Selects the radio button corresponding to the specified configuration. |
JComponent |
getComponent()
Return's this OptionComponent's configurable component. |
void |
resetToCurrent()
Selects the radio button corresponding to the current config options. |
void |
resetToDefault()
Selects the radio button corresponding to the default values. |
void |
setValue(Boolean value)
Displays the given value. |
void |
setValue(Object x0)
Sets the value that is currently displayed by this component. |
boolean |
updateConfig()
Updates the config object with the new setting. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
_textButton
private JRadioButton _textButton
_iconsButton
private JRadioButton _iconsButton
_textAndIconsButton
private JRadioButton _textAndIconsButton
_group
private ButtonGroup _group
_buttonPanel
private JPanel _buttonPanel
TEXT_ONLY
public static final String TEXT_ONLY
ICONS_ONLY
public static final String ICONS_ONLY
TEXT_AND_ICONS
public static final String TEXT_AND_ICONS
ToolbarOptionComponent
public ToolbarOptionComponent(String title,
Frame parent)
- The constructor does not take an option since we have specific knowledge of the
two options we'll need for this component. We simpy access them as needed, and use
OptionComponent's degenerate constructor.
- Parameters:
title
- the title for this panelthe
- parent frame
resetToCurrent
public void resetToCurrent()
- Selects the radio button corresponding to the current config options.
- Overrides:
resetToCurrent
in class OptionComponent
resetToDefault
public void resetToDefault()
- Selects the radio button corresponding to the default values.
- Overrides:
resetToDefault
in class OptionComponent
_setSelected
private void _setSelected(boolean textEnabled,
boolean iconsEnabled)
- Selects the radio button corresponding to the specified configuration.
- Parameters:
textEnabled
- Whether toolbar text is enablediconsEnabled
- Whether toolbar icons are enabled
getComponent
public JComponent getComponent()
- Return's this OptionComponent's configurable component.
- Overrides:
getComponent
in class OptionComponent
updateConfig
public boolean updateConfig()
- Updates the config object with the new setting.
- Overrides:
updateConfig
in class OptionComponent
- Returns:
- true if the new value is set successfully
setValue
public void setValue(Boolean value)
- Displays the given value.
setValue
public void setValue(Object x0)
- Description copied from class:
OptionComponent
- Sets the value that is currently displayed by this component.
- Overrides:
setValue
in class OptionComponent