Class PropertySheet
- All Implemented Interfaces:
EventListener,IAdaptable,IExecutableExtension,IRegistryEventListener,IPartListener,IPersistable,ISecondarySaveableSource,ISelectionListener,IViewPart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,IShowInSource,IShowInTarget,IWorkbenchPartOrientation
This standard view has id "org.eclipse.ui.views.PropertySheet".
Note that property sheets and property sheet pages are not the same
thing as property dialogs and their property pages (the property pages
extension point is for contributing property pages to property dialogs).
Within the property sheet view, all pages are
IPropertySheetPages.
Property sheet pages are discovered by the property sheet view automatically
when a part is first activated. The property sheet view asks the active part
for its property sheet page; this is done by invoking
getAdapter(IPropertySheetPage.class) on the part. If the part
returns a page, the property sheet view then creates the controls for that
property sheet page (using createControl), and adds the page to
the property sheet view. Whenever this part becomes active, its corresponding
property sheet page is shown in the property sheet view (which may or may not
be visible at the time). A part's property sheet page is discarded when the
part closes. The property sheet view has a default page (an instance of
PropertySheetPage) which services all parts without a property
sheet page of their own.
The workbench will automatically instantiate this class when a Property Sheet view is needed for a workbench window. This class is not intended to be instantiated or subclassed by clients.
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.ui.part.PageBookView
PageBookView.PageRec, PageBookView.SelectionProvider -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNo longer used but preserved to avoid api changeFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadded(IExtension[] extensions) Notifies this listener that extensions were added to the registry.voidadded(IExtensionPoint[] extensionPoints) Notifies this listener that extension points were added to the registry.protected IPagecreateDefaultPage(PageBook book) Creates and returns the default page for this view.voidcreatePartControl(Composite parent) ThePropertySheetimplementation of thisIWorkbenchPartmethod creates aPageBookcontrol with its default page showing.protected IPageCreates and returns a default properties page for this view.voiddispose()ThePageBookViewimplementation of thisIWorkbenchPartmethod cleans up all the pages.protected PageBookView.PageRecdoCreatePage(IWorkbenchPart part) Creates a new page in the pagebook for a particular part.protected voiddoDestroyPage(IWorkbenchPart part, PageBookView.PageRec rec) Destroys a page in the pagebook for a particular part.protected IWorkbenchPartReturns the active, important workbench part for this view.protected ISaveablePartReturns anISaveablePartthat delegates to the source part for the current page if it implementsISaveablePart, ornullotherwise.Returns the context to show, ornullif there is currently no valid context to show.protected <T> TgetViewAdapter(Class<T> key) ThePropertySheetimplementation of thisPageBookViewmethod handles theISaveablePartadapter case by callinggetSaveablePart().voidInitializes this view with the given view site.booleanDefines the dirty state indication behavior of thePropertySheetinstance for the current tracked part if it is aISaveablePartinstance or provides an adapter toISaveablePart.protected booleanisImportant(IWorkbenchPart part) Returns whether the given part should be added to this view.booleanisPinned()voidpartActivated(IWorkbenchPart part) ThePropertySheetimplementation of thisIPartListenermethod first sees if the active part is anIContributedContentsViewadapter and if so, asks it for its contributing part.voidpartClosed(IWorkbenchPart part) ThePageBookViewimplementation of thisIPartListenermethod deal with the closing of the active part.protected voidpartHidden(IWorkbenchPart part) Make sure that the part is not considered if it is hidden.protected voidpartVisible(IWorkbenchPart part) Make sure that the part is not considered if it is hidden.voidremoved(IExtension[] extensions) Notifies this listener that extensions were removed from the registry.voidremoved(IExtensionPoint[] extensionPoints) Notifies this listener that extension points were removed from the registry.voidSaves the object state within a memento.voidselectionChanged(IWorkbenchPart part, ISelection sel) Notifies this listener that the selection has changed.voidsetPinned(boolean pinned) booleanshow(ShowInContext aContext) Shows the given context in this target.Methods inherited from class org.eclipse.ui.part.PageBookView
doesPageExist, getAdapter, getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, initPage, partBroughtToTop, partDeactivated, partOpened, setFocus, showPageRecMethods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Field Details
-
HELP_CONTEXT_PROPERTY_SHEET_VIEW
No longer used but preserved to avoid api change- See Also:
-
-
Constructor Details
-
PropertySheet
public PropertySheet()Creates a property sheet view.
-
-
Method Details
-
createDefaultPage
Description copied from class:PageBookViewCreates and returns the default page for this view.Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage) before calling createControl on the page.- Specified by:
createDefaultPagein classPageBookView- Parameters:
book- the pagebook control- Returns:
- the default page
-
createPartControl
ThePropertySheetimplementation of thisIWorkbenchPartmethod creates aPageBookcontrol with its default page showing.- Specified by:
createPartControlin interfaceIWorkbenchPart- Overrides:
createPartControlin classPageBookView- Parameters:
parent- the parent control
-
dispose
public void dispose()Description copied from class:PageBookViewThePageBookViewimplementation of thisIWorkbenchPartmethod cleans up all the pages. Subclasses may extend.- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classPageBookView
-
doCreatePage
Description copied from class:PageBookViewCreates a new page in the pagebook for a particular part. This page will be made visible whenever the part is active, and will be destroyed with a call todoDestroyPage.Subclasses must implement this method.
Subclasses must call initPage with the new page (if it is an
IPageBookViewPage) before calling createControl on the page.- Specified by:
doCreatePagein classPageBookView- Parameters:
part- the input part- Returns:
- the record describing a new page for this view
- See Also:
-
createPropertySheetPage
Creates and returns a default properties page for this view. This page is used when a part does not provide a IPropertySheetPage- Parameters:
book- the pagebook control- Returns:
- A default properties page
- Since:
- 3.10
-
doDestroyPage
Description copied from class:PageBookViewDestroys a page in the pagebook for a particular part. This page was returned as a result fromdoCreatePage.Subclasses must implement this method.
- Specified by:
doDestroyPagein classPageBookView- Parameters:
part- the input partrec- a page record for the part- See Also:
-
getBootstrapPart
Description copied from class:PageBookViewReturns the active, important workbench part for this view.When the page book view is created it has no idea which part within the workbook should be used to generate the first page. Therefore, it delegates the choice to subclasses of
PageBookView.Implementors of this method should return an active, important part in the workbench or
nullif none found.Subclasses must implement this method.
- Specified by:
getBootstrapPartin classPageBookView- Returns:
- the active important part, or
nullif none
-
init
Description copied from interface:IViewPartInitializes this view with the given view site.This method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's lifecycle. Clients must not call this method.
- Specified by:
initin interfaceIViewPart- Overrides:
initin classPageBookView- Parameters:
site- the view site- Throws:
PartInitException- may be thrown from overrides
-
saveState
Description copied from interface:IViewPartSaves the object state within a memento. -
isImportant
Description copied from class:PageBookViewReturns whether the given part should be added to this view.Subclasses must implement this method.
- Specified by:
isImportantin classPageBookView- Parameters:
part- the input part- Returns:
trueif the part is relevant, andfalseotherwise
-
partClosed
Description copied from class:PageBookViewThePageBookViewimplementation of thisIPartListenermethod deal with the closing of the active part. Subclasses may extend.- Specified by:
partClosedin interfaceIPartListener- Overrides:
partClosedin classPageBookView- Parameters:
part- the part that was closed- See Also:
-
partVisible
Description copied from class:PageBookViewMake sure that the part is not considered if it is hidden.- Overrides:
partVisiblein classPageBookView- Parameters:
part- the part which got visible
-
partHidden
Description copied from class:PageBookViewMake sure that the part is not considered if it is hidden.- Overrides:
partHiddenin classPageBookView- Parameters:
part- the part which got hidden
-
partActivated
ThePropertySheetimplementation of thisIPartListenermethod first sees if the active part is anIContributedContentsViewadapter and if so, asks it for its contributing part.- Specified by:
partActivatedin interfaceIPartListener- Overrides:
partActivatedin classPageBookView- Parameters:
part- the part that was activated- See Also:
-
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 selectionsel- the current selection. This may benullifINullSelectionListeneris implemented.- See Also:
-
isDirtyStateSupported
public boolean isDirtyStateSupported()Defines the dirty state indication behavior of thePropertySheetinstance for the current tracked part if it is aISaveablePartinstance or provides an adapter toISaveablePart.Default return value is
false- the Properties view will not show the '*' sign if the tracked part is dirty.This behavior can be changed by either contributing custom
IPropertySheetPageto the tracked part, or providingISecondarySaveableSourceadapter by the tracked part or by contributingISecondarySaveableSourceadapter to thePropertySheetclass.Strategy for the search is going from the smallest scope to the global scope, searching for the first
ISecondarySaveableSourceadapter.The current page is asked for the
ISecondarySaveableSourceadapter first, if the adapter is not defined, the current tracked part is asked for it, and finally the platform adapter manager is consulted. The first adapter found in the steps above defines the return value of this method.If the contributed page wants change the behavior The page must implement
IAdaptableand return adapter toISecondarySaveableSource.- Specified by:
isDirtyStateSupportedin interfaceISecondarySaveableSource- Returns:
- returns
falseif the dirty state indication behavior is not desired. - Since:
- 3.9
-
getViewAdapter
ThePropertySheetimplementation of thisPageBookViewmethod handles theISaveablePartadapter case by callinggetSaveablePart().- Overrides:
getViewAdapterin classPageBookView- Parameters:
key- the adapter class to look up- Returns:
- a object castable to 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
-
isPinned
public boolean isPinned()- Returns:
- whether this property sheet is currently pinned
- Since:
- 3.4
-
getShowInContext
Description copied from interface:IShowInSourceReturns the context to show, ornullif there is currently no valid context to show.- Specified by:
getShowInContextin interfaceIShowInSource- Returns:
- the context to show, or
null
-
show
Description copied from interface:IShowInTargetShows the given context in this target. The target should check the context's selection for elements to show. If there are no relevant elements in the selection, then it should check the context's input.- Specified by:
showin interfaceIShowInTarget- Parameters:
aContext- the context to show- Returns:
trueif the context could be shown,falseotherwise
-
setPinned
public void setPinned(boolean pinned) - Parameters:
pinned- Whether this sheet should be pinned- Since:
- 3.4
-
added
Description copied from interface:IRegistryEventListenerNotifies this listener that extensions were added to the registry.The extensions supplied as the argument are valid only for the duration of the invocation of this method.
- Specified by:
addedin interfaceIRegistryEventListener- Parameters:
extensions- extensions added to the registry
-
added
Description copied from interface:IRegistryEventListenerNotifies this listener that extension points were added to the registry.The extension points supplied as the argument are valid only for the duration of the invocation of this method.
- Specified by:
addedin interfaceIRegistryEventListener- Parameters:
extensionPoints- extension points added to the registry
-
removed
Description copied from interface:IRegistryEventListenerNotifies this listener that extensions were removed from the registry.The extensions supplied as the argument are valid only for the duration of the invocation of this method.
- Specified by:
removedin interfaceIRegistryEventListener- Parameters:
extensions- extensions removed from the registry
-
removed
Description copied from interface:IRegistryEventListenerNotifies this listener that extension points were removed from the registry.The extension points supplied as the argument are valid only for the duration of the invocation of this method.
- Specified by:
removedin interfaceIRegistryEventListener- Parameters:
extensionPoints- extension points removed from the registry
-