Class PropertySheetEntry
- All Implemented Interfaces:
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.
- Since:
- 3.0 (was previously internal)
-
Field Summary
Fields inherited from interface org.eclipse.ui.views.properties.IPropertySheetEntry
FILTER_ID_EXPERT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given listener to this entry's collection of listeners.void
Apply the current cell editor value.protected PropertySheetEntry
Factory method to create a new childPropertySheetEntry
instance.void
dispose()
Called when the entry is no longer neededprotected Color
Returns the background color for the entry.Returns the entry's category.Returns the child entries for this entry.Return a short description of the property sheet entry.protected IPropertyDescriptor
Returns the descriptor for this entry.Returns the name used to display the property.Return theCellEditor
used to edit the property.protected Object
getEditValue
(int index) Returns the edit value for the object at the given index.Returns the error text to display if the value is invalid.String[]
Return the filter ids used to group entries into levels such as Expert.protected Font
getFont()
Returns the font for the entry.protected Color
Returns the foreground color for the entry.Returns the help context id for this entry, ornull
if this entry has no help context id.getImage()
Returns the image for the property value, if there is one.protected PropertySheetEntry
Returns the parent of this entry.protected IPropertySource
getPropertySource
(Object object) Returns an property source for the given object.Returns the value of the objects expressed as a String.Object[]
Returns the value objects of this entry.boolean
Returnstrue
if the entry has children.protected void
Refresh the entry tree from the root down.void
Removes the given listener from this entry's collection of listeners.void
Resets the property value to its default value if it has been changed.void
Sets a property source provider for this entry.void
ThePropertySheetEntry
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.Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
PropertySheetEntry
public PropertySheetEntry()
-
-
Method Details
-
addPropertySheetEntryListener
Description copied from interface:IPropertySheetEntry
Adds the given listener to this entry's collection of listeners.- Specified by:
addPropertySheetEntryListener
in interfaceIPropertySheetEntry
- Parameters:
listener
- the listener to add
-
applyEditorValue
public void applyEditorValue()Description copied from interface:IPropertySheetEntry
Apply the current cell editor value.- Specified by:
applyEditorValue
in interfaceIPropertySheetEntry
-
createChildEntry
Factory method to create a new childPropertySheetEntry
instance.Subclasses may overwrite to create new instances of their own class.
- Returns:
- a new
PropertySheetEntry
instance for the descriptor passed in - Since:
- 3.1
-
dispose
public void dispose()Description copied from interface:IPropertySheetEntry
Called when the entry is no longer needed- Specified by:
dispose
in interfaceIPropertySheetEntry
-
getCategory
Description copied from interface:IPropertySheetEntry
Returns the entry's category.- Specified by:
getCategory
in interfaceIPropertySheetEntry
- Returns:
- the entry's category
-
getChildEntries
Description copied from interface:IPropertySheetEntry
Returns the child entries for this entry.- Specified by:
getChildEntries
in interfaceIPropertySheetEntry
- Returns:
- the child entries for this entry
-
getDescription
Description copied from interface:IPropertySheetEntry
Return a short description of the property sheet entry. Typically this description is shown in a status line when the entry is selected.- Specified by:
getDescription
in interfaceIPropertySheetEntry
- Returns:
- the entry's description
-
getDescriptor
Returns the descriptor for this entry.- Returns:
- the descriptor for this entry
- Since:
- 3.1 (was previously private)
-
getDisplayName
Description copied from interface:IPropertySheetEntry
Returns the name used to display the property.- Specified by:
getDisplayName
in interfaceIPropertySheetEntry
- Returns:
- the name used to display the property
-
getEditor
Description copied from interface:IPropertySheetEntry
Return theCellEditor
used to edit the property.- Specified by:
getEditor
in interfaceIPropertySheetEntry
- Parameters:
parent
- the parent widget for the editor- Returns:
- the
CellEditor
used to edit the property
-
getEditValue
Returns the edit value for the object at the given index.- Parameters:
index
- the value object index- Returns:
- the edit value for the object at the given index
-
getErrorText
Description copied from interface:IPropertySheetEntry
Returns the error text to display if the value is invalid.- Specified by:
getErrorText
in interfaceIPropertySheetEntry
- Returns:
- the error text to display when the value is invalid or
null
-
getFilters
Description copied from interface:IPropertySheetEntry
Return the filter ids used to group entries into levels such as Expert. Valid values are defined as constants on this interface.- Specified by:
getFilters
in interfaceIPropertySheetEntry
- Returns:
- the filter ids used to group entries into levels such as Expert.
-
getHelpContextIds
Description copied from interface:IPropertySheetEntry
Returns the help context id for this entry, ornull
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 aString
representing a context id. The previously valid return types are deprecated. The plural name for this method is unfortunate.- Specified by:
getHelpContextIds
in interfaceIPropertySheetEntry
- Returns:
- the help context id for this entry
-
getImage
Description copied from interface:IPropertySheetEntry
Returns the image for the property value, if there is one. This image is managed by the entry it came from. Callers of this method must never dispose the returned image.- Specified by:
getImage
in interfaceIPropertySheetEntry
- Returns:
- the image for this property value or
null
-
getParent
Returns the parent of this entry.- Returns:
- the parent entry, or
null
if it has no parent - Since:
- 3.1
-
getPropertySource
Returns an property source for the given object.- Parameters:
object
- an object for which to obtain a property source ornull
if a property source is not available- Returns:
- an property source for the given object
- Since:
- 3.1 (was previously private)
-
getValueAsString
Description copied from interface:IPropertySheetEntry
Returns the value of the objects expressed as a String.- Specified by:
getValueAsString
in interfaceIPropertySheetEntry
- Returns:
- the value of the objects expressed as a String
-
getValues
Returns the value objects of this entry.- Returns:
- the value objects of this entry
- Since:
- 3.1 (was previously private)
-
hasChildEntries
public boolean hasChildEntries()Description copied from interface:IPropertySheetEntry
Returnstrue
if the entry has children.- Specified by:
hasChildEntries
in interfaceIPropertySheetEntry
- Returns:
true
if the entry has children
-
refreshFromRoot
protected void refreshFromRoot()Refresh the entry tree from the root down.- Since:
- 3.1 (was previously private)
-
removePropertySheetEntryListener
Description copied from interface:IPropertySheetEntry
Removes the given listener from this entry's collection of listeners.- Specified by:
removePropertySheetEntryListener
in interfaceIPropertySheetEntry
- Parameters:
listener
- the listener to remove
-
resetPropertyValue
public void resetPropertyValue()Description copied from interface:IPropertySheetEntry
Resets the property value to its default value if it has been changed.Does nothing if the notion of a default value is not meaningful for the property.
- Specified by:
resetPropertyValue
in interfaceIPropertySheetEntry
-
setPropertySourceProvider
Sets a property source provider for this entry. This provider is used to obtain anIPropertySource
for each of this entries objects. If no provider is set then a default provider is used.- Parameters:
provider
- IPropertySourceProvider
-
setValues
ThePropertySheetEntry
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
- Specified by:
setValues
in interfaceIPropertySheetEntry
- Parameters:
objects
- the new values for this entry
-
valueChanged
The value of the given child entry has changed. Therefore we must set this change into our value objects.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.
- Parameters:
child
- the child entry that changed its value
-
getForeground
Returns the foreground color for the entry.- Returns:
- the foreground color for the entry, or
null
to use the default foreground color - Since:
- 3.7
-
getBackground
Returns the background color for the entry.- Returns:
- the background color for the entry, or
null
to use the default background color - Since:
- 3.7
-
getFont
Returns the font for the entry.- Returns:
- the font for the entry, or
null
to use the default font - Since:
- 3.7
-