Class PropertySheetPage
- All Implemented Interfaces:
EventListener
,IAdaptable
,ISelectionListener
,IPage
,IPageBookViewPage
,IPropertySheetPage
This page obtains the information about what properties to display from the current selection (which it tracks).
The model for this page is a hierarchy of IPropertySheetEntry
.
The page may be configured with a custom model by setting the root entry.
If no root entry is set then a default model is created which uses the
IPropertySource
interface to obtain the properties of
the current selection. This requires that the selected objects provide an
IPropertySource
adapter (or implement
IPropertySource
directly). This restiction can be overcome
by providing this page with an IPropertySourceProvider
. If
supplied, this provider will be used by the default model to obtain a
property source for the current selection
This class may be instantiated; it is not intended to be subclassed.
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Help context id (value"org.eclipse.ui.property_sheet_page_help_context"
). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createControl
(Composite parent) Creates the SWT control for this page under the given parent control.void
dispose()
ThePropertySheetPage
implementation of thisIPage
method disposes of this page's entries.<T> T
getAdapter
(Class<T> adapter) ThePropertySheetPage
implementation of thisIAdaptable
method handles theISaveablePart
adapter by delegating to the source part.ThePage
implementation of thisIPage
method returnsnull
.protected ISaveablePart
Returns anISaveablePart
that delegates to the source part for the current page if it implementsISaveablePart
, ornull
otherwise.void
handleEntrySelection
(ISelection selection) Handles a selection change in the entry table.protected void
Adds drag and drop support.void
makeContributions
(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) This method exists for backward compatibility.void
refresh()
Updates the model for the viewer.void
selectionChanged
(IWorkbenchPart part, ISelection selection) Notifies this listener that the selection has changed.void
setActionBars
(IActionBars actionBars) ThePropertySheetPage
implementation of thisIPage
method callsmakeContributions
for backwards compatibility with previous versions ofIPage
.void
setFocus()
Sets focus to a part in the page.void
setPropertySourceProvider
(IPropertySourceProvider newProvider) Sets the given property source provider as the property source provider.void
setRootEntry
(IPropertySheetEntry entry) Sets the given entry as the model for the page.protected void
setSorter
(PropertySheetSorter sorter) Sets the sorter used for sorting categories and entries in the viewer of this page.
-
Field Details
-
HELP_CONTEXT_PROPERTY_SHEET_PAGE
Help context id (value"org.eclipse.ui.property_sheet_page_help_context"
).- See Also:
-
-
Constructor Details
-
PropertySheetPage
public PropertySheetPage()Creates a new property sheet page.
-
-
Method Details
-
createControl
Description copied from interface:IPage
Creates the SWT control for this page under the given parent control.Clients should not call this method (the workbench calls this method when it needs to, which may be never).
- Specified by:
createControl
in interfaceIPage
- Specified by:
createControl
in classPage
- Parameters:
parent
- the parent control
-
dispose
public void dispose()ThePropertySheetPage
implementation of thisIPage
method disposes of this page's entries. -
getAdapter
ThePropertySheetPage
implementation of thisIAdaptable
method handles theISaveablePart
adapter by delegating to the source part.- Specified by:
getAdapter
in interfaceIAdaptable
- Type Parameters:
T
- the class type- Parameters:
adapter
- the adapter class to look up- Returns:
- a object of the given class, or
null
if this object does not have an adapter for the given class - Since:
- 3.2
-
getSaveablePart
Returns anISaveablePart
that delegates to the source part for the current page if it implementsISaveablePart
, ornull
otherwise.- Returns:
- an
ISaveablePart
ornull
- Since:
- 3.2
-
getControl
Description copied from class:Page
ThePage
implementation of thisIPage
method returnsnull
. Subclasses must reimplement.- Specified by:
getControl
in interfaceIPage
- Specified by:
getControl
in classPage
- Returns:
- the SWT control for this page, or
null
if this page does not have a control
-
handleEntrySelection
Handles a selection change in the entry table.- Parameters:
selection
- the new selection
-
initDragAndDrop
protected void initDragAndDrop()Adds drag and drop support. -
makeContributions
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) Description copied from class:Page
This method exists for backward compatibility. Subclasses should reimplementinit
.- Overrides:
makeContributions
in classPage
-
refresh
public void refresh()Updates the model for the viewer.Note that this means ensuring that the model reflects the state of the current viewer input.
-
selectionChanged
Description copied from interface:ISelectionListener
Notifies this listener that the selection has changed.Note: it is important that this method returns as quickly as possible to avoid UI freezes. For example, do not update the UI if the UI is not visible. See the
SelectionListenerFactory
for listeners that are build for this purpose.This method is called when the selection changes to a
non-null
value, but not when the selection changes tonull
. If there is a requirement to be notified in the latter scenario, implementINullSelectionListener
. The event will be posted through this method.- Specified by:
selectionChanged
in interfaceISelectionListener
- Parameters:
part
- the workbench part containing the selectionselection
- the current selection. This may benull
ifINullSelectionListener
is implemented.- See Also:
-
setActionBars
ThePropertySheetPage
implementation of thisIPage
method callsmakeContributions
for backwards compatibility with previous versions ofIPage
.Subclasses may reimplement.
- Specified by:
setActionBars
in interfaceIPage
- Overrides:
setActionBars
in classPage
- Parameters:
actionBars
- the action bars for this page
-
setFocus
public void setFocus()Sets focus to a part in the page. -
setPropertySourceProvider
Sets the given property source provider as the property source provider.Calling this method is only valid if you are using this page's default root entry.
- Parameters:
newProvider
- the property source provider
-
setRootEntry
Sets the given entry as the model for the page.- Parameters:
entry
- the root entry
-
setSorter
Sets the sorter used for sorting categories and entries in the viewer of this page.The default sorter sorts categories and entries alphabetically.
- Parameters:
sorter
- the sorter to set (null
will reset to the default sorter)- Since:
- 3.1
-