public class PropertySheetPage extends Page implements IPropertySheetPage, IAdaptable
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.
IPropertySource
Modifier and Type | Field and Description |
---|---|
static String |
HELP_CONTEXT_PROPERTY_SHEET_PAGE
Help context id
(value
"org.eclipse.ui.property_sheet_page_help_context" ). |
Constructor and Description |
---|
PropertySheetPage()
Creates a new property sheet page.
|
Modifier and Type | Method and Description |
---|---|
void |
createControl(Composite parent)
Creates the SWT control for this page under the given parent
control.
|
void |
dispose()
The
PropertySheetPage implementation of this IPage method
disposes of this page's entries. |
<T> T |
getAdapter(Class<T> adapter)
The
PropertySheetPage implementation of this IAdaptable method
handles the ISaveablePart adapter by delegating to the source part. |
Control |
getControl()
The
Page implementation of this IPage method returns
null . |
protected ISaveablePart |
getSaveablePart()
Returns an
ISaveablePart that delegates to the source part
for the current page if it implements ISaveablePart , or
null otherwise. |
void |
handleEntrySelection(ISelection selection)
Handles a selection change in the entry table.
|
protected void |
initDragAndDrop()
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)
The
PropertySheetPage implementation of this IPage method
calls makeContributions for backwards compatibility with
previous versions of IPage . |
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.
|
public static final String HELP_CONTEXT_PROPERTY_SHEET_PAGE
"org.eclipse.ui.property_sheet_page_help_context"
).public void createControl(Composite parent)
IPage
Clients should not call this method (the workbench calls this method when it needs to, which may be never).
createControl
in interface IPage
createControl
in class Page
parent
- the parent controlpublic void dispose()
PropertySheetPage
implementation of this IPage
method
disposes of this page's entries.public <T> T getAdapter(Class<T> adapter)
PropertySheetPage
implementation of this IAdaptable
method
handles the ISaveablePart
adapter by delegating to the source part.getAdapter
in interface IAdaptable
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classprotected ISaveablePart getSaveablePart()
ISaveablePart
that delegates to the source part
for the current page if it implements ISaveablePart
, or
null
otherwise.ISaveablePart
or null
public Control getControl()
Page
Page
implementation of this IPage
method returns
null
. Subclasses must reimplement.getControl
in interface IPage
getControl
in class Page
null
if this
page does not have a controlpublic void handleEntrySelection(ISelection selection)
selection
- the new selectionprotected void initDragAndDrop()
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)
Page
init
.makeContributions
in class Page
public void refresh()
Note that this means ensuring that the model reflects the state of the current viewer input.
public void selectionChanged(IWorkbenchPart part, ISelection selection)
ISelectionListener
This method is called when the selection changes from one to a
non-null
value, but not when the selection changes to
null
. If there is a requirement to be notified in the latter
scenario, implement INullSelectionListener
. The event will
be posted through this method.
selectionChanged
in interface ISelectionListener
part
- the workbench part containing the selectionselection
- the current selection. This may be null
if INullSelectionListener
is implemented.public void setActionBars(IActionBars actionBars)
PropertySheetPage
implementation of this IPage
method
calls makeContributions
for backwards compatibility with
previous versions of IPage
.
Subclasses may reimplement.
setActionBars
in interface IPage
setActionBars
in class Page
actionBars
- the action bars for this pagepublic void setFocus()
public void setPropertySourceProvider(IPropertySourceProvider newProvider)
Calling this method is only valid if you are using this page's default root entry.
newProvider
- the property source providerpublic void setRootEntry(IPropertySheetEntry entry)
entry
- the root entryprotected void setSorter(PropertySheetSorter sorter)
The default sorter sorts categories and entries alphabetically.
sorter
- the sorter to set (null
will reset to the
default sorter)
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.