Class CompletionModeSetting

  extended by org.xnap.commons.settings.AbstractSetting<String>
      extended by org.xnap.commons.settings.StringSetting
          extended by org.xnap.commons.settings.CompletionModeSetting
All Implemented Interfaces:
CompletionModeListener, Setting<String>

public class CompletionModeSetting
extends StringSetting
implements CompletionModeListener

This class manages the serialization of the active completion mode for a Completion object. A CompletionModeSetting can be used as follows:

 JTextField jtf = new JTextField();
 Completion comp = new Completion(jtf);
 CompletionModeSetting cms = 
 new CompletionModeSetting("prefsKey", 
        ManualCompletionMode.class.getName(), comp);

Felix Berger

Field Summary
Fields inherited from class org.xnap.commons.settings.AbstractSetting
Constructor Summary
CompletionModeSetting(SettingResource backend, String key, Class defaultMode, Completion comp)
          Creates a CompletionModeSetting for a completion object.
Method Summary
 void modeChanged(Class oldMode, Class newMode)
          Invoked when a completion mode change took place.
 void revert()
          Reverts the completion mode setting to the default mode and sets it for the completion object.
Methods inherited from class org.xnap.commons.settings.StringSetting
fromString, toString
Methods inherited from class org.xnap.commons.settings.AbstractSetting
addPropertyChangeListener, areObjectsEqual, areObjectsEqual, getDefaultValue, getKey, getProperties, getValidator, getValue, removePropertyChangeListener, setDefaultValue, setProperties, setValidator, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CompletionModeSetting(SettingResource backend,
                             String key,
                             Class defaultMode,
                             Completion comp)
Creates a CompletionModeSetting for a completion object.

key - the settings key for the properties file
defaultMode - the mode which is initially set for the completion object
comp -
Method Detail


public void revert()
Reverts the completion mode setting to the default mode and sets it for the completion object.

Specified by:
revert in interface Setting<String>
revert in class AbstractSetting<String>


public void modeChanged(Class oldMode,
                        Class newMode)
Description copied from interface: CompletionModeListener
Invoked when a completion mode change took place.

Specified by:
modeChanged in interface CompletionModeListener
oldMode - the old completion mode
newMode - the new completion mode

Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.