cdox.util.conf
Class LanguageOption

java.lang.Object
  extended bycdox.util.conf.AbstractOption
      extended bycdox.util.conf.LanguageOption

public class LanguageOption
extends AbstractOption

This class represents a language option. An appropriate section in the XML file might look like this single line:

  <language package="cdox.CDox" key="language"/>

Version:
May 22nd 2002
Author:
Rutger Bezema, Andreas Schmitz

Field Summary
 
Fields inherited from class cdox.util.conf.AbstractOption
key, node, prefs
 
Constructor Summary
LanguageOption(org.w3c.dom.Node n, Localizer lang)
          Constructs one.
 
Method Summary
 boolean commitChanges()
          Causes the option to write its changes to its preferences node.
 javax.swing.JComponent getComponent()
          Returns a component which is used to alter this option.
 javax.swing.JLabel getText()
          Returns a JLabel which describes the option.
 void reset()
          Resets the values to the original ones, either from the preferences, or, if they don't exist, to the ones in the XML file.
 void setToDefault()
          This option type has no default value in the xml file, so it re-reads its value from the preferences (doing a simple reset()).
 
Methods inherited from class cdox.util.conf.AbstractOption
getTextByLanguage, setMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageOption

public LanguageOption(org.w3c.dom.Node n,
                      Localizer lang)
Constructs one.

Parameters:
n - the DOM node where this option is described.
lang - a localizer.
Method Detail

getText

public javax.swing.JLabel getText()
Description copied from class: AbstractOption
Returns a JLabel which describes the option. This method should be invoked only once.

Specified by:
getText in class AbstractOption
Returns:
a JLabel.

getComponent

public javax.swing.JComponent getComponent()
Description copied from class: AbstractOption
Returns a component which is used to alter this option. This method should be invoked only once.

Specified by:
getComponent in class AbstractOption
Returns:
a JComponent value.

commitChanges

public boolean commitChanges()
Description copied from class: AbstractOption
Causes the option to write its changes to its preferences node. The preferences' flush() method is NOT invoked by this method.

Specified by:
commitChanges in class AbstractOption
Returns:
true, if the application must be restarted in order to get the changes into effect.

setToDefault

public void setToDefault()
This option type has no default value in the xml file, so it re-reads its value from the preferences (doing a simple reset()). The default value of a language option is always English, if it does not exist in the preferences.

Specified by:
setToDefault in class AbstractOption
See Also:
AbstractOption.setToDefault(), reset()

reset

public void reset()
Description copied from class: AbstractOption
Resets the values to the original ones, either from the preferences, or, if they don't exist, to the ones in the XML file.

Specified by:
reset in class AbstractOption