net.ctdp.rfdynhud.properties
Class StringProperty

java.lang.Object
  extended by net.ctdp.rfdynhud.properties.Property
      extended by net.ctdp.rfdynhud.properties.StringProperty
Direct Known Subclasses:
ImageProperty

public class StringProperty
extends Property

The StringProperty serves for customizing a simple String value.

Author:
Marvin Froehlich (CTDP)

Constructor Summary
  StringProperty(java.lang.String name, java.lang.String defaultValue)
           
  StringProperty(java.lang.String name, java.lang.String defaultValue, boolean readonly)
           
  StringProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue)
           
  StringProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue, boolean readonly)
           
protected StringProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue, boolean forceTrimOnSet, boolean readonly, PropertyEditorType propEdType)
           
 
Method Summary
 java.lang.String getDefaultValue()
          Gets the default (initial) value fo this property.
 java.lang.String getStringValue()
          Gets the property's current value.
 java.lang.String getValue()
          Gets the current value fo this property.
 void loadValue(PropertyLoader loader, java.lang.String value)
          Loads the value from the configuration file.
protected  void onKeeperSet()
          
protected  void onValueChanged(java.lang.String oldValue, java.lang.String newValue)
          Invoked when the property's value has changed.
 boolean setStringValue(java.lang.String value)
          Sets the property's new value.
protected  boolean setStringValue(java.lang.String value, boolean firstTime)
          Sets the property's new value.
 void setValue(java.lang.Object value)
          Sets the new value for this property.
 
Methods inherited from class net.ctdp.rfdynhud.properties.Property
getButtonText, getButtonTooltip, getDocumentationSource, getEditorType, getKeeper, getName, getNameForDisplay, getValueForConfigurationFile, hasDefaultValue, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringProperty

protected StringProperty(java.lang.String name,
                         java.lang.String nameForDisplay,
                         java.lang.String defaultValue,
                         boolean forceTrimOnSet,
                         boolean readonly,
                         PropertyEditorType propEdType)
Parameters:
name - the technical name used internally. See Property.getName().
nameForDisplay - the name displayed in the editor. See Property.getNameForDisplay(). If null is passed, the value of the name parameter is used.
defaultValue - the default value
forceTrimOnSet - trim value when set
readonly - read only property?
propEdType - property editor type

StringProperty

public StringProperty(java.lang.String name,
                      java.lang.String nameForDisplay,
                      java.lang.String defaultValue,
                      boolean readonly)
Parameters:
name - the technical name used internally. See Property.getName().
nameForDisplay - the name displayed in the editor. See Property.getNameForDisplay(). If null is passed, the value of the name parameter is used.
defaultValue - the default value
readonly - read only property?

StringProperty

public StringProperty(java.lang.String name,
                      java.lang.String nameForDisplay,
                      java.lang.String defaultValue)
Parameters:
name - the technical name used internally. See Property.getName().
nameForDisplay - the name displayed in the editor. See Property.getNameForDisplay(). If null is passed, the value of the name parameter is used.
defaultValue - the default value

StringProperty

public StringProperty(java.lang.String name,
                      java.lang.String defaultValue,
                      boolean readonly)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
defaultValue - the default value
readonly - read only property?

StringProperty

public StringProperty(java.lang.String name,
                      java.lang.String defaultValue)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
defaultValue - the default value
Method Detail

getDefaultValue

public java.lang.String getDefaultValue()
Gets the default (initial) value fo this property.

Specified by:
getDefaultValue in class Property
Returns:
the default value fo this property.

onKeeperSet

protected void onKeeperSet()

Overrides:
onKeeperSet in class Property

onValueChanged

protected void onValueChanged(java.lang.String oldValue,
                              java.lang.String newValue)
Invoked when the property's value has changed.

Parameters:
oldValue - the old value
newValue - the new value

setStringValue

protected final boolean setStringValue(java.lang.String value,
                                       boolean firstTime)
Sets the property's new value.

Parameters:
value - the new value
firstTime -
Returns:
changed?

setStringValue

public final boolean setStringValue(java.lang.String value)
Sets the property's new value.

Parameters:
value - the new value
Returns:
changed?

getStringValue

public final java.lang.String getStringValue()
Gets the property's current value.

Returns:
the property's current value.

setValue

public void setValue(java.lang.Object value)
Sets the new value for this property.

Specified by:
setValue in class Property
Parameters:
value - the new value

getValue

public java.lang.String getValue()
Gets the current value fo this property.

Specified by:
getValue in class Property
Returns:
the current value fo this property.

loadValue

public void loadValue(PropertyLoader loader,
                      java.lang.String value)
Loads the value from the configuration file.

Specified by:
loadValue in class Property
Parameters:
loader - the loader
value - the value to load