fr.esrf.tangoatk.core
Class Property

java.lang.Object
  extended by fr.esrf.tangoatk.core.Property
Direct Known Subclasses:
DisplayLevelProperty, FormatProperty, NumberProperty, StringProperty, TypeProperty, WritableProperty

public class Property
extends java.lang.Object

Property is a class which responsible for holding information about a given Property of a given IEntity. Properties have the following, uh, properties

Each time a property is stored, a presentation propertychange event is fired, so that the listeners of this property can update its values.


Field Summary
protected  boolean editable
           
protected  java.lang.String name
           
protected  java.lang.Object oldValue
           
protected  IEntity parent
           
protected  java.beans.PropertyChangeSupport propChanges
           
protected  boolean specified
           
protected  java.lang.Object value
           
 
Constructor Summary
Property()
           
Property(IEntity parent, java.lang.String name, java.lang.Object value, boolean editable)
          Creates a new Property instance.
 
Method Summary
 void addPresentationListener(java.beans.PropertyChangeListener l)
          addPresentationListener add a presentation-listener for this property
 int getIntValue()
          getIntValue returns the value of the property as an int.
 java.lang.String getName()
          getName returns the name of the property
 java.lang.String getPresentation()
          getPresentation returns a nicely formated String representation of this property.
 java.lang.String getStringValue()
          getStringValue returns the value of the property as a string.
 java.lang.Object getValue()
          getValue return the value of the property
 java.lang.String getVersion()
           
 boolean isEditable()
          isEditable true if this property is editable, else false
 boolean isSpecified()
          isSpecified returns true if this property's value is specified, false if not.
 void refresh()
           
 void removePresentationListener(java.beans.PropertyChangeListener l)
          removePresentationListener remove a presentation-listener for this property
 void setName(java.lang.String s)
          setName sets the name of the property
 void setSpecified(boolean b)
          setSpecified lets you set the specified property of this property.
 void setValue(java.lang.Object o)
          setValue sets the value of the property
 void setValueFromString(java.lang.String stringValue)
          Transforms a String into the right corresponding Object to set the value of the Property
 void store()
          store asks the IEntity of this property to store its properies.
 java.lang.String toString()
          toString does exactly what you'd think it does.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

value

protected java.lang.Object value

oldValue

protected java.lang.Object oldValue

editable

protected boolean editable

parent

protected IEntity parent

specified

protected boolean specified

propChanges

protected java.beans.PropertyChangeSupport propChanges
Constructor Detail

Property

public Property()

Property

public Property(IEntity parent,
                java.lang.String name,
                java.lang.Object value,
                boolean editable)
Creates a new Property instance.

Parameters:
parent - the IEntity this property belongs to
name - the name of this property
value - the value of this property, specified a an object
editable - true if this property is editable
Method Detail

addPresentationListener

public void addPresentationListener(java.beans.PropertyChangeListener l)
addPresentationListener add a presentation-listener for this property

Parameters:
l - a PropertyChangeListener value

removePresentationListener

public void removePresentationListener(java.beans.PropertyChangeListener l)
removePresentationListener remove a presentation-listener for this property

Parameters:
l - a PropertyChangeListener value

refresh

public void refresh()

isEditable

public boolean isEditable()
isEditable true if this property is editable, else false


setSpecified

public void setSpecified(boolean b)
setSpecified lets you set the specified property of this property. Setting it to true means that the value of this property is meaningfull, false mean it's garbage

Parameters:
b - a boolean value

isSpecified

public boolean isSpecified()
isSpecified returns true if this property's value is specified, false if not.

Returns:
a boolean value

setName

public void setName(java.lang.String s)
setName sets the name of the property

Parameters:
s - a String value

setValue

public void setValue(java.lang.Object o)
setValue sets the value of the property

Parameters:
o - an Object containing the value

setValueFromString

public void setValueFromString(java.lang.String stringValue)
Transforms a String into the right corresponding Object to set the value of the Property

Parameters:
stringValue - The String to transform. This String should look like what getPresentation() can return
See Also:
setValue(Object), getPresentation()

getName

public java.lang.String getName()
getName returns the name of the property

Returns:
a String value

getValue

public java.lang.Object getValue()
getValue return the value of the property

Returns:
an Object value

getStringValue

public java.lang.String getStringValue()
getStringValue returns the value of the property as a string.

Returns:
a String value

getIntValue

public int getIntValue()
getIntValue returns the value of the property as an int.

Returns:
an int value
Throws:
java.lang.NumberFormatException - if the value of the property is not an int.

getPresentation

public java.lang.String getPresentation()
getPresentation returns a nicely formated String representation of this property. To be used by the widgets that show the value of this property.

Returns:
a String value

toString

public java.lang.String toString()
toString does exactly what you'd think it does.

Overrides:
toString in class java.lang.Object
Returns:
a String value

store

public void store()
store asks the IEntity of this property to store its properies. This method also results in a propertyChange event for the presentation property.


getVersion

public java.lang.String getVersion()