|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectpropertyManager.PropertyManager
public class PropertyManager
This class is designed to make integration with the property view easier. ReadableProperties are added to the property manager, which handles the interaction between the property view and the actual properties.
| Field Summary | |
|---|---|
private java.util.Hashtable |
knownDescriptors
Contains a list of property descriptors that have been previously created and can be reused. |
protected java.lang.Object |
owner
The object to which the properties belong. |
protected java.util.ArrayList |
properties
Contains the references to the properties that have been added to this |
private java.util.ArrayList |
propertyChangeListeners
A list of property change listeners |
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
PropertyManager(java.lang.Object owner)
Creates a new instance of the PropertyManager class. |
|
| Method Summary | |
|---|---|
void |
addProperty(ReadableProperty readableProperty)
Adds a ReadableProperty to the PropertyManager. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to be notified when any of the managed ReadableProperties are modifed. |
private ReadableProperty |
findProperty(java.lang.Object id)
|
EditableProperty |
getEditableProperty(java.lang.Object id)
|
java.lang.Object |
getEditableValue()
|
protected java.util.Hashtable |
getKnownDescriptors()
|
java.util.ArrayList |
getProperties()
|
ReadableProperty |
getProperty(java.lang.Object id)
|
protected java.util.ArrayList |
getPropertyChangeListeners()
|
org.eclipse.ui.views.properties.IPropertyDescriptor[] |
getPropertyDescriptors()
Creates an array of property descriptors which will be used by the properties view. |
double |
getPropertyDoubleValue(java.lang.Object id)
|
float |
getPropertyFloatValue(java.lang.Object id)
|
int |
getPropertyIntValue(java.lang.Object id)
|
long |
getPropertyLongValue(java.lang.Object id)
|
java.lang.Number |
getPropertyNumberValue(java.lang.Object id)
|
org.eclipse.ui.views.properties.IPropertySource |
getPropertySource(java.lang.Object object)
|
java.lang.Object |
getPropertyValue(java.lang.Object id)
|
ReadableProperty |
getReadableProperty(java.lang.Object id)
This method simply calls getProperty and is provided for consistency |
boolean |
hasProperty(java.lang.Object id)
|
boolean |
isPropertySet(java.lang.Object id)
|
private void |
linkPropertyOwner(java.lang.Object owner)
If the owner of this property is another property, link them together |
private void |
notifyPropertyChangeListeners(java.beans.PropertyChangeEvent event)
Notify listeners that a property has changed and pass the event |
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
void |
removeProperty(ReadableProperty readableProperty)
Removes an ReadableProperties from the PropertyManager |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the given property change listener. |
void |
resetPropertyValue(java.lang.Object id)
Resets the property value to the defaultValue. |
void |
setPropertyValue(java.lang.Object id,
java.lang.Object value)
Sets the value of the given property |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
protected java.util.ArrayList properties
private transient java.util.Hashtable knownDescriptors
ReadableProperty.hasDynamicPropertyDescriptor()private transient java.util.ArrayList propertyChangeListeners
protected java.lang.Object owner
notifyPropertyChangeListeners(PropertyChangeEvent)| Constructor Detail |
|---|
public PropertyManager(java.lang.Object owner)
owner - The object to which the properties belong.| Method Detail |
|---|
private void linkPropertyOwner(java.lang.Object owner)
owner - public void addProperty(ReadableProperty readableProperty)
editableProperty - An EditablePropertypublic void removeProperty(ReadableProperty readableProperty)
editableProperty - An EditablePropertypublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - A PropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - a property listenerpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerprivate void notifyPropertyChangeListeners(java.beans.PropertyChangeEvent event)
event - The event describing the property changepublic EditableProperty getEditableProperty(java.lang.Object id)
id -
public ReadableProperty getProperty(java.lang.Object id)
id - The ID of the property to be returned
java.lang.IllegalArgumentException - if a property with the given ID has not been added to the
PropertyManagerpublic boolean hasProperty(java.lang.Object id)
id - The ID of a property
public ReadableProperty getReadableProperty(java.lang.Object id)
id - The ID of a property
private ReadableProperty findProperty(java.lang.Object id)
public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors in interface org.eclipse.ui.views.properties.IPropertySourcepublic java.lang.Object getPropertyValue(java.lang.Object id)
getPropertyValue in interface org.eclipse.ui.views.properties.IPropertySourceid - The id of the EditableProperty
EditableComboProperty will
return an Integer which represents the index of the selected item
in the combo box. However, the correspoding value (which is
ultimately what is wanted by the class that is using the
EditableComboProperty) is returned by
getComboValue().public java.lang.Number getPropertyNumberValue(java.lang.Object id)
id - The id of the property
java.lang.IllegalArgumentException - if the property does not exist or does not implement
INumericProperty
public int getPropertyIntValue(java.lang.Object id)
throws java.lang.IllegalArgumentException
id - The id of the property
java.lang.IllegalArgumentException - if the property does not exist or does not implement
INumericProperty
public float getPropertyFloatValue(java.lang.Object id)
throws java.lang.IllegalArgumentException
id - The id of the property
java.lang.IllegalArgumentException - if the property does not exist or does not implement
INumericProperty
public double getPropertyDoubleValue(java.lang.Object id)
throws java.lang.IllegalArgumentException
id - The id of the property
java.lang.IllegalArgumentException - if the property does not exist or does not implement
INumericProperty
public long getPropertyLongValue(java.lang.Object id)
throws java.lang.IllegalArgumentException
id - The id of the property
java.lang.IllegalArgumentException - if the property does not exist or does not implement
INumericPropertypublic boolean isPropertySet(java.lang.Object id)
isPropertySet in interface org.eclipse.ui.views.properties.IPropertySourceid - The id of the EditableProperty
public void resetPropertyValue(java.lang.Object id)
resetPropertyValue in interface org.eclipse.ui.views.properties.IPropertySourceid - The id of the EditableProperty
public void setPropertyValue(java.lang.Object id,
java.lang.Object value)
setPropertyValue in interface org.eclipse.ui.views.properties.IPropertySourceid - The id of the ReadablePropertyvalue - The new valuepublic java.lang.Object getEditableValue()
getEditableValue in interface org.eclipse.ui.views.properties.IPropertySourcepublic org.eclipse.ui.views.properties.IPropertySource getPropertySource(java.lang.Object object)
getPropertySource in interface org.eclipse.ui.views.properties.IPropertySourceProviderpublic java.util.ArrayList getProperties()
protected java.util.ArrayList getPropertyChangeListeners()
protected java.util.Hashtable getKnownDescriptors()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||