org.graffiti.plugin.view.interactive.slots
Class StringSlot

java.lang.Object
  extended by org.graffiti.plugin.view.interactive.Slot<String>
      extended by org.graffiti.plugin.view.interactive.slots.StringSlot

public class StringSlot
extends Slot<String>

Slot of type String, which can store its value in a preferences tree.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Field Summary
 
Fields inherited from class org.graffiti.plugin.view.interactive.Slot
type
 
Constructor Summary
StringSlot(String id, String name, String description, String defaultValue)
          Constructs a StringSlot.
 
Method Summary
 void createDefaultPreferences(Preferences preferences)
          Prepares the specified preferences tree to store the value assigned to this slot.
 String loadValue(Preferences preferences)
          Returns the value that is assigned to this slot according to the specified preferences tree.
 void saveValue(Preferences preferences, String value)
          Stores the specified value in the specified preferences tree by means of this slot.
 
Methods inherited from class org.graffiti.plugin.view.interactive.Slot
acceptsNull, acceptsValue, create, create, createListSlot, createMapSlot, createSetSlot, equals, getBuilder, getDefaultValue, getDescription, getId, getName, getType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringSlot

public StringSlot(String id,
                  String name,
                  String description,
                  String defaultValue)
Constructs a StringSlot.

Parameters:
id - the id of the slot.
name - the name of the slot as seen by the user when graphically editing the tools.
description - the description as seen by the user when graphically editing the tools.
defaultValue - the default value.
Method Detail

createDefaultPreferences

public void createDefaultPreferences(Preferences preferences)
Prepares the specified preferences tree to store the value assigned to this slot. The default implementation throws an UnsupportedOperationException. This implementation stores its default value in the preferences tree at the key "value".

Overrides:
createDefaultPreferences in class Slot<String>
Parameters:
preferences - the preferences tree where the value assigned to this slot will be stored.

loadValue

public String loadValue(Preferences preferences)
Returns the value that is assigned to this slot according to the specified preferences tree. The default implementation throws an UnsupportedOperationException. This implementation loads its value from the preferences tree at the key "value".

Overrides:
loadValue in class Slot<String>
Parameters:
preferences - the preferences tree from where the value is to be obtained.
Returns:
the value that is assigned to this slot according to the specified preferences tree.

saveValue

public void saveValue(Preferences preferences,
                      String value)
Description copied from class: Slot
Stores the specified value in the specified preferences tree by means of this slot. The default implementation throws an UnsupportedOperationException.

Overrides:
saveValue in class Slot<String>
Parameters:
preferences - the preferences tree where the value is to be stored.
value - the value that is to be stored.


Generated at 2012-05-30 11:00:36 PM CEST