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

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

public class FontOptionComponent
extends OptionComponent<Font>

The Graphical form of a FontOption.

Version:
$Id: FontOptionComponent.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
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _label, _labelText, _option, _parent
 
Constructor Summary
FontOptionComponent(FontOption opt, String text, SwingFrame parent)
           
FontOptionComponent(FontOption opt, String text, SwingFrame parent, String description)
          Constructor that allows for a tooltip description.
 
Method Summary
 void chooseFont()
          Shows a custom font chooser dialog to pick a new font.
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void setDescription(String description)
          Sets the tooltip description text for this option.
 void setValue(Font 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

FontOptionComponent

public FontOptionComponent(FontOption opt,
                           String text,
                           SwingFrame parent)

FontOptionComponent

public FontOptionComponent(FontOption opt,
                           String text,
                           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<Font>
Parameters:
description - the tooltip text

getComponent

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

Specified by:
getComponent in class OptionComponent<Font>

chooseFont

public void chooseFont()
Shows a custom font chooser dialog to pick a new font.


updateConfig

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

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

setValue

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

Specified by:
setValue in class OptionComponent<Font>