public class PropertySheetEntry extends EventManager implements IPropertySheetEntry
PropertySheetEntry is an implementation of
IPropertySheetEntry which uses IPropertySource
and IPropertyDescriptor to interact with domain model objects.
Every property sheet entry has a single descriptor (except the root entry which has none). This descriptor determines what property of its objects it will display/edit.
Entries do not listen for changes in their objects. Since there is no restriction on properties being independent, a change in one property may affect other properties. The value of a parent's property may also change. As a result we are forced to refresh the entire entry tree when a property changes value.
FILTER_ID_EXPERT| Constructor and Description |
|---|
PropertySheetEntry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertySheetEntryListener(IPropertySheetEntryListener listener)
Adds the given listener to this entry's collection of listeners.
|
void |
applyEditorValue()
Apply the current cell editor value.
|
protected PropertySheetEntry |
createChildEntry()
Factory method to create a new child
PropertySheetEntry
instance. |
void |
dispose()
Called when the entry is no longer needed
|
String |
getCategory()
Returns the entry's category.
|
IPropertySheetEntry[] |
getChildEntries()
Returns the child entries for this entry.
|
String |
getDescription()
Return a short description of the property sheet entry.
|
protected IPropertyDescriptor |
getDescriptor()
Returns the descriptor for this entry.
|
String |
getDisplayName()
Returns the name used to display the property.
|
CellEditor |
getEditor(Composite parent)
Return the
CellEditor used to edit the property. |
protected Object |
getEditValue(int index)
Returns the edit value for the object at the given index.
|
String |
getErrorText()
Returns the error text to display if the value is invalid.
|
String[] |
getFilters()
Return the filter ids used to group entries into levels such as Expert.
|
Object |
getHelpContextIds()
Returns the help context id for this entry, or
null if
this entry has no help context id. |
Image |
getImage()
Returns the image for the property value, if there is one.
|
protected PropertySheetEntry |
getParent()
Returns the parent of this entry.
|
protected IPropertySource |
getPropertySource(Object object)
Returns an property source for the given object.
|
String |
getValueAsString()
Returns the value of the objects expressed as a String.
|
Object[] |
getValues()
Returns the value objects of this entry.
|
boolean |
hasChildEntries()
Returns
true if the entry has children. |
protected void |
refreshFromRoot()
Refresh the entry tree from the root down.
|
void |
removePropertySheetEntryListener(IPropertySheetEntryListener listener)
Removes the given listener from this entry's collection of listeners.
|
void |
resetPropertyValue()
Resets the property value to its default value if it has been changed.
|
void |
setPropertySourceProvider(IPropertySourceProvider provider)
Sets a property source provider for this entry.
|
void |
setValues(Object[] objects)
The
PropertySheetEntry implmentation of this method
declared onIPropertySheetEntry will obtain an editable
value for the given objects and update the child entries. |
protected void |
valueChanged(PropertySheetEntry child)
The value of the given child entry has changed.
|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectpublic void addPropertySheetEntryListener(IPropertySheetEntryListener listener)
IPropertySheetEntryaddPropertySheetEntryListener in interface IPropertySheetEntrylistener - the listener to addpublic void applyEditorValue()
IPropertySheetEntryapplyEditorValue in interface IPropertySheetEntryprotected PropertySheetEntry createChildEntry()
PropertySheetEntry
instance.
Subclasses may overwrite to create new instances of their own class.
PropertySheetEntry instance for the
descriptor passed inpublic void dispose()
IPropertySheetEntrydispose in interface IPropertySheetEntrypublic String getCategory()
IPropertySheetEntrygetCategory in interface IPropertySheetEntrypublic IPropertySheetEntry[] getChildEntries()
IPropertySheetEntrygetChildEntries in interface IPropertySheetEntrypublic String getDescription()
IPropertySheetEntrygetDescription in interface IPropertySheetEntryprotected IPropertyDescriptor getDescriptor()
public String getDisplayName()
IPropertySheetEntrygetDisplayName in interface IPropertySheetEntrypublic CellEditor getEditor(Composite parent)
IPropertySheetEntryCellEditor used to edit the property.getEditor in interface IPropertySheetEntryparent - the parent widget for the editorCellEditor used to edit the propertyprotected Object getEditValue(int index)
index - the value object indexpublic String getErrorText()
IPropertySheetEntrygetErrorText in interface IPropertySheetEntrynullpublic String[] getFilters()
IPropertySheetEntrygetFilters in interface IPropertySheetEntrypublic Object getHelpContextIds()
IPropertySheetEntrynull if
this entry has no help context id.
NOTE: Help support system API's changed since 2.0 and arrays of contexts are no longer supported.
Thus the only valid non- null return type for this method
is a String representing a context id. The previously
valid return types are deprecated. The plural name for this method is
unfortunate.
getHelpContextIds in interface IPropertySheetEntrypublic Image getImage()
IPropertySheetEntrygetImage in interface IPropertySheetEntrynullprotected PropertySheetEntry getParent()
null if it has no parentprotected IPropertySource getPropertySource(Object object)
object - an object for which to obtain a property source or
null if a property source is not availablepublic String getValueAsString()
IPropertySheetEntrygetValueAsString in interface IPropertySheetEntrypublic Object[] getValues()
public boolean hasChildEntries()
IPropertySheetEntrytrue if the entry has children.hasChildEntries in interface IPropertySheetEntrytrue if the entry has childrenprotected void refreshFromRoot()
public void removePropertySheetEntryListener(IPropertySheetEntryListener listener)
IPropertySheetEntryremovePropertySheetEntryListener in interface IPropertySheetEntrylistener - the listener to removepublic void resetPropertyValue()
IPropertySheetEntryDoes nothing if the notion of a default value is not meaningful for the property.
resetPropertyValue in interface IPropertySheetEntrypublic void setPropertySourceProvider(IPropertySourceProvider provider)
IPropertySource for each of this entries
objects. If no provider is set then a default provider is used.provider - IPropertySourceProviderpublic void setValues(Object[] objects)
PropertySheetEntry implmentation of this method
declared onIPropertySheetEntry will obtain an editable
value for the given objects and update the child entries.
Updating the child entries will typically call this method on the child entries and thus the entire entry tree is updated
setValues in interface IPropertySheetEntryobjects - the new values for this entryprotected void valueChanged(PropertySheetEntry child)
We must inform our parent so that it can update its value objects
Subclasses may override to set the property value in some custom way.
child - the child entry that changed its valueGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.