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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given listener to this entry's collection of listeners.voidApply the current cell editor value.protected PropertySheetEntryFactory method to create a new childPropertySheetEntryinstance.voiddispose()Called when the entry is no longer neededprotected ColorReturns 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 IPropertyDescriptorReturns the descriptor for this entry.Returns the name used to display the property.Return theCellEditorused to edit the property.protected ObjectgetEditValue(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 FontgetFont()Returns the font for the entry.protected ColorReturns the foreground color for the entry.Returns the help context id for this entry, ornullif this entry has no help context id.getImage()Returns the image for the property value, if there is one.protected PropertySheetEntryReturns the parent of this entry.protected IPropertySourcegetPropertySource(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.booleanReturnstrueif the entry has children.protected voidRefresh the entry tree from the root down.voidRemoves the given listener from this entry's collection of listeners.voidResets the property value to its default value if it has been changed.voidSets a property source provider for this entry.voidThePropertySheetEntryimplmentation of this method declared onIPropertySheetEntrywill obtain an editable value for the given objects and update the child entries.protected voidvalueChanged(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:IPropertySheetEntryAdds the given listener to this entry's collection of listeners.- Specified by:
addPropertySheetEntryListenerin interfaceIPropertySheetEntry- Parameters:
listener- the listener to add
-
applyEditorValue
public void applyEditorValue()Description copied from interface:IPropertySheetEntryApply the current cell editor value.- Specified by:
applyEditorValuein interfaceIPropertySheetEntry
-
createChildEntry
Factory method to create a new childPropertySheetEntryinstance.Subclasses may overwrite to create new instances of their own class.
- Returns:
- a new
PropertySheetEntryinstance for the descriptor passed in - Since:
- 3.1
-
dispose
public void dispose()Description copied from interface:IPropertySheetEntryCalled when the entry is no longer needed- Specified by:
disposein interfaceIPropertySheetEntry
-
getCategory
Description copied from interface:IPropertySheetEntryReturns the entry's category.- Specified by:
getCategoryin interfaceIPropertySheetEntry- Returns:
- the entry's category
-
getChildEntries
Description copied from interface:IPropertySheetEntryReturns the child entries for this entry.- Specified by:
getChildEntriesin interfaceIPropertySheetEntry- Returns:
- the child entries for this entry
-
getDescription
Description copied from interface:IPropertySheetEntryReturn a short description of the property sheet entry. Typically this description is shown in a status line when the entry is selected.- Specified by:
getDescriptionin 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:IPropertySheetEntryReturns the name used to display the property.- Specified by:
getDisplayNamein interfaceIPropertySheetEntry- Returns:
- the name used to display the property
-
getEditor
Description copied from interface:IPropertySheetEntryReturn theCellEditorused to edit the property.- Specified by:
getEditorin interfaceIPropertySheetEntry- Parameters:
parent- the parent widget for the editor- Returns:
- the
CellEditorused 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:IPropertySheetEntryReturns the error text to display if the value is invalid.- Specified by:
getErrorTextin interfaceIPropertySheetEntry- Returns:
- the error text to display when the value is invalid or
null
-
getFilters
Description copied from interface:IPropertySheetEntryReturn the filter ids used to group entries into levels such as Expert. Valid values are defined as constants on this interface.- Specified by:
getFiltersin interfaceIPropertySheetEntry- Returns:
- the filter ids used to group entries into levels such as Expert.
-
getHelpContextIds
Description copied from interface:IPropertySheetEntryReturns the help context id for this entry, ornullif 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-
nullreturn type for this method is aStringrepresenting a context id. The previously valid return types are deprecated. The plural name for this method is unfortunate.- Specified by:
getHelpContextIdsin interfaceIPropertySheetEntry- Returns:
- the help context id for this entry
-
getImage
Description copied from interface:IPropertySheetEntryReturns 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:
getImagein interfaceIPropertySheetEntry- Returns:
- the image for this property value or
null
-
getParent
Returns the parent of this entry.- Returns:
- the parent entry, or
nullif 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 ornullif 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:IPropertySheetEntryReturns the value of the objects expressed as a String.- Specified by:
getValueAsStringin 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:IPropertySheetEntryReturnstrueif the entry has children.- Specified by:
hasChildEntriesin interfaceIPropertySheetEntry- Returns:
trueif 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:IPropertySheetEntryRemoves the given listener from this entry's collection of listeners.- Specified by:
removePropertySheetEntryListenerin interfaceIPropertySheetEntry- Parameters:
listener- the listener to remove
-
resetPropertyValue
public void resetPropertyValue()Description copied from interface:IPropertySheetEntryResets 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:
resetPropertyValuein interfaceIPropertySheetEntry
-
setPropertySourceProvider
Sets a property source provider for this entry. This provider is used to obtain anIPropertySourcefor each of this entries objects. If no provider is set then a default provider is used.- Parameters:
provider- IPropertySourceProvider
-
setValues
ThePropertySheetEntryimplmentation of this method declared onIPropertySheetEntrywill 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:
setValuesin 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
nullto use the default foreground color - Since:
- 3.7
-
getBackground
Returns the background color for the entry.- Returns:
- the background color for the entry, or
nullto use the default background color - Since:
- 3.7
-
getFont
Returns the font for the entry.- Returns:
- the font for the entry, or
nullto use the default font - Since:
- 3.7
-