com.togethersoft.openapi.ide.inspector
Class IdeInspectorProperty

java.lang.Object
  |
  +--java.beans.FeatureDescriptor
        |
        +--com.togethersoft.openapi.ide.inspector.IdeInspectorProperty
Direct Known Subclasses:
IdeMultipleInspectorProperty, SimpleStringProperty, PropertyMapInspectorProperty, ReadOnlyProperty, RwiInspectorProperty

public abstract class IdeInspectorProperty
extends FeatureDescriptor

Class IdeInspectorProperty represents a property inside an inspector component.

Author:
TogetherSoft
Since: Together 3.1
See Also: IdeInspectorComponent

Inner Class Summary
 public static classIdeInspectorProperty.Options
          This interface contains some constants used as keys of the property
configuration options.

Field Summary
 final static StringMULTI_VALUE_TAG
           
 private PropertyEditormyEditor
           
 private ClassmyEditorClass
           
 private PropertyChangeSupportmyPropertyChangeSupport
           
 private HashtablemyServices
           
 private ClassmyValueType
           
 final static StringPROP_VALUE
           
 final static ObjectUNDEFINED_VALUE
           

Constructor Summary
IdeInspectorProperty(Class valueType)
          Constructs a property with the specified type and without editor class.
IdeInspectorProperty(Class valueType, Class editorClass)
          Constructs a property with specified type and editor class.

Method Summary
 voidaddPropertyChangeListener(PropertyChangeListener listener)
          Adds specified listener for the PropertyChange event.
 abstract booleancanSetValue(Object value)
          Checks for the possibily to set specified value for this property.
 protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)
          Initiates the event of updating the specified property with the new value passed as a parameter.
 StringgetModelPropertyName()
          This method returns name of the underlying model property (if any)
accessed via this inspector property.
 PropertyEditorgetPropertyEditor()
          Returns the editor for this property if it's specified through
setPropertyEditor, otherwise returns null.
 ObjectgetService(Class clazz)
          Returns an Object that provides service for this proprety.
 abstract ObjectgetValue()
          Returns the value of this property.
 ClassgetValueType()
          Returns Type of value of this property.
 abstract booleanisReadable()
          Checks if it is possible to read the value of this property.
 abstract booleanisWritable()
          Checks if it is possible to write the value for this property.
 voidremovePropertyChangeListener(PropertyChangeListener listener)
          Removes specified listener for PropertyChange event.
 voidsetPropertyEditor(PropertyEditor editor)
          Sets specified editor for this property.
 voidsetService(Class clazz, Object service)
          Adds new service for this proprety.
 abstract voidsetValue(Object value)
          Sets value for this property.
 voidupdate()
          Updates this inspector property.

Methods inherited from class java.beans.FeatureDescriptor
getName, setName, getDisplayName, setDisplayName, isExpert, setExpert, isHidden, setHidden, isPreferred, setPreferred, getShortDescription, setShortDescription, setValue, getValue, attributeNames

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize

Field Detail

MULTI_VALUE_TAG

public final static String MULTI_VALUE_TAG

myEditor

private PropertyEditor myEditor

myEditorClass

private Class myEditorClass

myPropertyChangeSupport

private PropertyChangeSupport myPropertyChangeSupport

myServices

private Hashtable myServices

myValueType

private Class myValueType

PROP_VALUE

public final static String PROP_VALUE

UNDEFINED_VALUE

public final static Object UNDEFINED_VALUE
Constructor Detail

IdeInspectorProperty

public IdeInspectorProperty(Class valueType)
Constructs a property with the specified type and without editor class.
Parameters:
valueType Class that defines the property type

IdeInspectorProperty

public IdeInspectorProperty(Class valueType, Class editorClass)
Constructs a property with specified type and editor class.
Parameters:
valueType Class that defines the property type
editorClass Class which will be used to edit this property
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds specified listener for the PropertyChange event.
Parameters:
listener PropertyChangeListener to be added

canSetValue

public abstract boolean canSetValue(Object value)
Checks for the possibily to set specified value for this property.
Parameters:
value Object Value to be checked
Returns: true if this value is OK, false otherwise

firePropertyChange

protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
Initiates the event of updating the specified property with the new value passed as a parameter.
Parameters:
propertyNameString name of the property to be changed
oldValue Object value to be changed
newValue Object new value of this property

getModelPropertyName

public String getModelPropertyName()
This method returns name of the underlying model property (if any)
accessed via this inspector property. It differs from
getName() which returns name of this inspector
property and getDisplayName() which returns label for
visual represenation of this inspector property. As soon as
IdeInspectorProperty class have no particular underlying
model, this method returns null and should be overwritten
in derived classes
Returns: null
Since:
Together 5.0

getPropertyEditor

public PropertyEditor getPropertyEditor()
Returns the editor for this property if it's specified through
setPropertyEditor, otherwise returns null.
If the editor class is specified by the #IdeInspectorProperty(Class, Class) then returns
this editor, otherwise looks for the editor of this property type in PropertyEditorManager.

getService

public Object getService(Class clazz)
Returns an Object that provides service for this proprety.
In the HashTable of services the key for the service object is the class of this object.
Parameters:
clazz Class that provides the service
Returns: Object instance of this class

getValue

public abstract Object getValue()
Returns the value of this property.
Returns: Value as an Object.

getValueType

public Class getValueType()
Returns Type of value of this property.
Returns: Class that defines the type of this value

isReadable

public abstract boolean isReadable()
Checks if it is possible to read the value of this property.
Returns: true if it is possible, false otherwise.

isWritable

public abstract boolean isWritable()
Checks if it is possible to write the value for this property.
Returns: true if it is possible, false otherwise.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes specified listener for PropertyChange event.
Parameters:
listener PropertyChangeListener to be removed

setPropertyEditor

public void setPropertyEditor(PropertyEditor editor)
Sets specified editor for this property.
Parameters:
editor PropertyEditor new editor for this property.

setService

public void setService(Class clazz, Object service)
Adds new service for this proprety.
Parameters:
clazz Class that provides the service
service Object instance of this class

setValue

public abstract void setValue(Object value)
Sets value for this property.
Parameters:
value Object new value of the property

update

public void update()
Updates this inspector property.

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.Object

to Class java.lang.Class

to Class java.lang.Class

to Class java.beans.PropertyEditor

to Class java.beans.PropertyChangeSupport

to Class java.util.Hashtable