Search this API

y.option
Class StringBasedOptionItem

java.lang.Object
  extended by y.option.OptionItem
      extended by y.option.ObjectOptionItem
          extended by y.option.StringBasedOptionItem
All Implemented Interfaces:
AttributeOwner, BackupValueOwner, PropertyChangeReporter, VetoableChangeReporter
Direct Known Subclasses:
CommentOptionItem, FileOptionItem, PasswordOptionItem, StringOptionItem

public class StringBasedOptionItem
extends ObjectOptionItem

Base class for option items that store String values.

 

Field Summary
static java.lang.String ATTRIBUTE_CONVERTER
          Attribute key used to store a ObjectStringConverter to be used by editors.
static java.lang.String PROPERTY_CONVERTER
          Name of property converter.
 
Fields inherited from class y.option.OptionItem
ATTRIBUTE_CONTEXT, ATTRIBUTE_GROUPS, ATTRIBUTE_LONG_DESCRIPTION, COLOR_UNDEFINED, name, PROPERTY_CLASS_TYPE, PROPERTY_ENABLED, PROPERTY_TIP_TEXT, PROPERTY_VALUE, PROPERTY_VALUE_UNDEFINED, UNDEFINED
 
Constructor Summary
StringBasedOptionItem(java.lang.String name, java.lang.Object value)
          Creates a new instance of StringBasedOptionItem.
 
Method Summary
 ObjectStringConverter getConverter()
          Returns the converter used by this item.
 java.lang.String getStringValue()
          Returns the stringified value of this option item if the classType property is set, it uses the y.util.ObjectStringConversion class to perform its task, otherwise it will return null.
 java.lang.String getType()
          Returns "String".
 void setConverter(ObjectStringConverter converter)
          Specifies the converter used by this item.
 void setStringValue(java.lang.String value)
          Sets the stringified value of this option item if the classType property is set, it uses the y.util.ObjectStringConversion class to perform its task, otherwise it will return null.
 void setValue(java.lang.Object value)
          Sets the value of this item.
 
Methods inherited from class y.option.ObjectOptionItem
getBackupValue, getValue, resetValue
 
Methods inherited from class y.option.OptionItem
addEditor, addEditorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, adoptEditorValue, checkEditorValue, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getAttribute, getClassType, getEditor, getEditor, getEditors, getName, getTipText, isEnabled, isValueUndefined, publishEnabled, publishValue, publishValueUndefined, removeAttribute, removeEditor, removeEditorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setAttribute, setClassType, setEnabled, setTipText, setValueUndefined, wantsVisibleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CONVERTER

public static final java.lang.String PROPERTY_CONVERTER
Name of property converter.

See Also:
Constant Field Values

ATTRIBUTE_CONVERTER

public static final java.lang.String ATTRIBUTE_CONVERTER
Attribute key used to store a ObjectStringConverter to be used by editors.

See Also:
Constant Field Values
Constructor Detail

StringBasedOptionItem

public StringBasedOptionItem(java.lang.String name,
                             java.lang.Object value)
Creates a new instance of StringBasedOptionItem.

Parameters:
name - the name of the item
value - the initial and backup value of the value
Method Detail

getType

public java.lang.String getType()
Returns "String".

Overrides:
getType in class ObjectOptionItem

setValue

public void setValue(java.lang.Object value)
Description copied from class: ObjectOptionItem
Sets the value of this item.

Overrides:
setValue in class ObjectOptionItem
See Also:
OptionItem.publishValue(Object)

getStringValue

public java.lang.String getStringValue()
Description copied from class: OptionItem
Returns the stringified value of this option item if the classType property is set, it uses the y.util.ObjectStringConversion class to perform its task, otherwise it will return null.

Overrides:
getStringValue in class OptionItem

setStringValue

public void setStringValue(java.lang.String value)
Description copied from class: OptionItem
Sets the stringified value of this option item if the classType property is set, it uses the y.util.ObjectStringConversion class to perform its task, otherwise it will return null.

Overrides:
setStringValue in class OptionItem

getConverter

public ObjectStringConverter getConverter()
Returns the converter used by this item.

Returns:
the converter used by this item

setConverter

public void setConverter(ObjectStringConverter converter)
Specifies the converter used by this item. The converter is used to get a String representation of non-String values specified as item value for this item.

Parameters:
converter - the ObjectStringConverter used by this item

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.