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

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

public class ForcedChoiceOptionComponent
extends OptionComponent<String>

This component displays all legal choices for a ForcedChoiceOption as a list of radio buttons. The radio buttons are placed within a framed panel titled with the OptionComponent's label.

Version:
$Id: ForcedChoiceOptionComponent.java 4691 2008-12-02 23:33:27Z dlsmith $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
OptionComponent.ChangeListener
 
Field Summary
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
ForcedChoiceOptionComponent(ForcedChoiceOption option, String labelText, SwingFrame parent)
          Main constructor builds a panel containing a set of radio buttons for the legal values of the ForcedChoiceOption.
ForcedChoiceOptionComponent(ForcedChoiceOption option, String labelText, SwingFrame parent, String description)
          Constructor that allows for a tooltip description.
 
Method Summary
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void resetToCurrent(String current)
          Selects the radio button corresponding to the current config options.
 void setDescription(String description)
          Sets the tooltip description text for this option.
 void setValue(String 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
 

Constructor Detail

ForcedChoiceOptionComponent

public ForcedChoiceOptionComponent(ForcedChoiceOption option,
                                   String labelText,
                                   SwingFrame parent)
Main constructor builds a panel containing a set of radio buttons for the legal values of the ForcedChoiceOption.


ForcedChoiceOptionComponent

public ForcedChoiceOptionComponent(ForcedChoiceOption option,
                                   String labelText,
                                   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<String>
Parameters:
description - the tooltip text

resetToCurrent

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


getComponent

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

Specified by:
getComponent in class OptionComponent<String>

updateConfig

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

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

setValue

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

Specified by:
setValue in class OptionComponent<String>