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
FieldsModifier and TypeFieldDescriptionstatic final StringHelp context id (value"org.eclipse.ui.property_sheet_page_help_context"). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(Composite parent) Creates the SWT control for this page under the given parent control.voiddispose()ThePropertySheetPageimplementation of thisIPagemethod disposes of this page's entries.<T> TgetAdapter(Class<T> adapter) ThePropertySheetPageimplementation of thisIAdaptablemethod handles theISaveablePartadapter by delegating to the source part.ThePageimplementation of thisIPagemethod returnsnull.protected ISaveablePartReturns anISaveablePartthat delegates to the source part for the current page if it implementsISaveablePart, ornullotherwise.voidhandleEntrySelection(ISelection selection) Handles a selection change in the entry table.protected voidAdds drag and drop support.voidmakeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) This method exists for backward compatibility.voidrefresh()Updates the model for the viewer.voidselectionChanged(IWorkbenchPart part, ISelection selection) Notifies this listener that the selection has changed.voidsetActionBars(IActionBars actionBars) ThePropertySheetPageimplementation of thisIPagemethod callsmakeContributionsfor backwards compatibility with previous versions ofIPage.voidsetFocus()Sets focus to a part in the page.voidsetPropertySourceProvider(IPropertySourceProvider newProvider) Sets the given property source provider as the property source provider.voidsetRootEntry(IPropertySheetEntry entry) Sets the given entry as the model for the page.protected voidsetSorter(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:IPageCreates 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:
createControlin interfaceIPage- Specified by:
createControlin classPage- Parameters:
parent- the parent control
-
dispose
public void dispose()ThePropertySheetPageimplementation of thisIPagemethod disposes of this page's entries. -
getAdapter
ThePropertySheetPageimplementation of thisIAdaptablemethod handles theISaveablePartadapter by delegating to the source part.- Specified by:
getAdapterin interfaceIAdaptable- Type Parameters:
T- the class type- Parameters:
adapter- the adapter class to look up- Returns:
- a object of the given class, or
nullif this object does not have an adapter for the given class - Since:
- 3.2
-
getSaveablePart
Returns anISaveablePartthat delegates to the source part for the current page if it implementsISaveablePart, ornullotherwise.- Returns:
- an
ISaveablePartornull - Since:
- 3.2
-
getControl
Description copied from class:PageThePageimplementation of thisIPagemethod returnsnull. Subclasses must reimplement.- Specified by:
getControlin interfaceIPage- Specified by:
getControlin classPage- Returns:
- the SWT control for this page, or
nullif 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:PageThis method exists for backward compatibility. Subclasses should reimplementinit.- Overrides:
makeContributionsin 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:ISelectionListenerNotifies 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
SelectionListenerFactoryfor listeners that are build for this purpose.This method is called when the selection changes to a
non-nullvalue, 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:
selectionChangedin interfaceISelectionListener- Parameters:
part- the workbench part containing the selectionselection- the current selection. This may benullifINullSelectionListeneris implemented.- See Also:
-
setActionBars
ThePropertySheetPageimplementation of thisIPagemethod callsmakeContributionsfor backwards compatibility with previous versions ofIPage.Subclasses may reimplement.
- Specified by:
setActionBarsin interfaceIPage- Overrides:
setActionBarsin 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 (nullwill reset to the default sorter)- Since:
- 3.1
-