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

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

public class ToolbarOptionComponent
extends OptionComponent<Boolean>

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 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
static String ICONS_ONLY
           
static String NONE
           
static String TEXT_AND_ICONS
           
static String TEXT_ONLY
           
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
ToolbarOptionComponent(String title, SwingFrame parent)
          The constructor does not take an option since we have specific knowledge of the two options we'll need for this component.
ToolbarOptionComponent(String title, SwingFrame parent, String description)
          Constructor that allows for a tooltip description.
 
Method Summary
 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 setDescription(String description)
          Sets the tooltip description text for this option.
 void setValue(Boolean 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, setEntireColumn, showErrorMessage, showErrorMessage, useEntireColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final String NONE
See Also:
Constant Field Values

TEXT_ONLY

public static final String TEXT_ONLY
See Also:
Constant Field Values

ICONS_ONLY

public static final String ICONS_ONLY
See Also:
Constant Field Values

TEXT_AND_ICONS

public static final String TEXT_AND_ICONS
See Also:
Constant Field Values
Constructor Detail

ToolbarOptionComponent

public ToolbarOptionComponent(String title,
                              SwingFrame 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 panel
parent - the parent frame

ToolbarOptionComponent

public ToolbarOptionComponent(String title,
                              SwingFrame parent,
                              String description)
Constructor that allows for a tooltip description.

Method Detail

setDescription

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

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

resetToCurrent

public void resetToCurrent()
Selects the radio button corresponding to the current config options.

Overrides:
resetToCurrent in class OptionComponent<Boolean>

resetToDefault

public void resetToDefault()
Selects the radio button corresponding to the default values.

Overrides:
resetToDefault in class OptionComponent<Boolean>

getComponent

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

Specified by:
getComponent in class OptionComponent<Boolean>

updateConfig

public boolean updateConfig()
Updates the config object with the new setting. Should run in event thread.

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

setValue

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

Specified by:
setValue in class OptionComponent<Boolean>