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

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

public class BooleanOptionComponent
extends OptionComponent<Boolean>

Graphical form of a BooleanOption.

Version:
$Id: BooleanOptionComponent.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
protected  JCheckBox _jcb
           
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
BooleanOptionComponent(BooleanOption opt, String text, SwingFrame parent)
          Constructs a new BooleanOptionComponent.
BooleanOptionComponent(BooleanOption opt, String text, SwingFrame parent, boolean left)
          Constructs a new BooleanOptionComponent.
BooleanOptionComponent(BooleanOption opt, String text, SwingFrame parent, String description)
          Constructs a new BooleanOptionComponent with a tooltip description.
BooleanOptionComponent(BooleanOption opt, String text, SwingFrame parent, String description, boolean left)
          Constructs a new BooleanOptionComponent with a tooltip description.
 
Method Summary
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void setDescription(String description)
          Sets the tooltip description text for this option.
 BooleanOptionComponent setEntireColumn(boolean entireColumn)
          Whether the component should occupy the entire column.
 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, resetToCurrent, resetToDefault, showErrorMessage, showErrorMessage, useEntireColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_jcb

protected JCheckBox _jcb
Constructor Detail

BooleanOptionComponent

public BooleanOptionComponent(BooleanOption opt,
                              String text,
                              SwingFrame parent,
                              boolean left)
Constructs a new BooleanOptionComponent.

Parameters:
opt - the BooleanOption this component represents
text - the text to display with the option
parent - the parent frame
left - whether the descriptive text should be on the left

BooleanOptionComponent

public BooleanOptionComponent(BooleanOption opt,
                              String text,
                              SwingFrame parent,
                              String description,
                              boolean left)
Constructs a new BooleanOptionComponent with a tooltip description.

Parameters:
opt - the BooleanOption this component represents
text - the text to display with the option
parent - the parent frame
description - text to show in a tooltip over
left - whether the descriptive text should be on the left

BooleanOptionComponent

public BooleanOptionComponent(BooleanOption opt,
                              String text,
                              SwingFrame parent)
Constructs a new BooleanOptionComponent.

Parameters:
opt - the BooleanOption this component represents
text - the text to display with the option
parent - the parent frame

BooleanOptionComponent

public BooleanOptionComponent(BooleanOption opt,
                              String text,
                              SwingFrame parent,
                              String description)
Constructs a new BooleanOptionComponent with a tooltip description.

Parameters:
opt - the BooleanOption this component represents
text - the text to display with the option
parent - the parent frame
description - text to show in a tooltip over
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

updateConfig

public boolean updateConfig()
Updates the config object with the new setting.

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>

getComponent

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

Specified by:
getComponent in class OptionComponent<Boolean>

setEntireColumn

public BooleanOptionComponent setEntireColumn(boolean entireColumn)
Whether the component should occupy the entire column.

Overrides:
setEntireColumn in class OptionComponent<Boolean>