Class PropertySheetPage
- java.lang.Object
-
- org.eclipse.ui.part.Page
-
- org.eclipse.ui.views.properties.PropertySheetPage
-
- All Implemented Interfaces:
EventListener,IAdaptable,ISelectionListener,IPage,IPageBookViewPage,IPropertySheetPage
public class PropertySheetPage extends Page implements IPropertySheetPage, IAdaptable
The standard implementation of property sheet page which presents a table of property names and values obtained from the current selection in the active workbench part.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
IPropertySourceinterface to obtain the properties of the current selection. This requires that the selected objects provide anIPropertySourceadapter (or implementIPropertySourcedirectly). This restiction can be overcome by providing this page with anIPropertySourceProvider. If supplied, this provider will be used by the default model to obtain a property source for the current selectionThis class may be instantiated; it is not intended to be subclassed.
- See Also:
IPropertySource- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static StringHELP_CONTEXT_PROPERTY_SHEET_PAGEHelp context id (value"org.eclipse.ui.property_sheet_page_help_context").
-
Constructor Summary
Constructors Constructor Description PropertySheetPage()Creates a new property sheet page.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateControl(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.ControlgetControl()ThePageimplementation of thisIPagemethod returnsnull.protected ISaveablePartgetSaveablePart()Returns 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 voidinitDragAndDrop()Adds 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 Detail
-
HELP_CONTEXT_PROPERTY_SHEET_PAGE
public static final String HELP_CONTEXT_PROPERTY_SHEET_PAGE
Help context id (value"org.eclipse.ui.property_sheet_page_help_context").- See Also:
- Constant Field Values
-
-
Method Detail
-
createControl
public void createControl(Composite parent)
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
public <T> T getAdapter(Class<T> adapter)
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
protected ISaveablePart getSaveablePart()
Returns anISaveablePartthat delegates to the source part for the current page if it implementsISaveablePart, ornullotherwise.- Returns:
- an
ISaveablePartornull - Since:
- 3.2
-
getControl
public Control 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
public void handleEntrySelection(ISelection selection)
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
public void selectionChanged(IWorkbenchPart part, ISelection selection)
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:
SelectionListenerFactory.createVisibleListener(IWorkbenchPart, ISelectionListener),SelectionListenerFactory.createVisibleSelfMutedListener(IWorkbenchPart, ISelectionListener)
-
setActionBars
public void setActionBars(IActionBars actionBars)
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
public void setPropertySourceProvider(IPropertySourceProvider newProvider)
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
public void setRootEntry(IPropertySheetEntry entry)
Sets the given entry as the model for the page.- Parameters:
entry- the root entry
-
setSorter
protected void setSorter(PropertySheetSorter sorter)
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
-
-