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
IPropertySheetPage
s.
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
Modifier and TypeFieldDescriptionstatic final String
No longer used but preserved to avoid api changeFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
added
(IExtension[] extensions) Notifies this listener that extensions were added to the registry.void
added
(IExtensionPoint[] extensionPoints) Notifies this listener that extension points were added to the registry.protected IPage
createDefaultPage
(PageBook book) Creates and returns the default page for this view.void
createPartControl
(Composite parent) ThePropertySheet
implementation of thisIWorkbenchPart
method creates aPageBook
control with its default page showing.protected IPage
Creates and returns a default properties page for this view.void
dispose()
ThePageBookView
implementation of thisIWorkbenchPart
method cleans up all the pages.protected PageBookView.PageRec
doCreatePage
(IWorkbenchPart part) Creates a new page in the pagebook for a particular part.protected void
doDestroyPage
(IWorkbenchPart part, PageBookView.PageRec rec) Destroys a page in the pagebook for a particular part.protected IWorkbenchPart
Returns the active, important workbench part for this view.protected ISaveablePart
Returns anISaveablePart
that delegates to the source part for the current page if it implementsISaveablePart
, ornull
otherwise.Returns the context to show, ornull
if there is currently no valid context to show.protected <T> T
getViewAdapter
(Class<T> key) ThePropertySheet
implementation of thisPageBookView
method handles theISaveablePart
adapter case by callinggetSaveablePart()
.void
Initializes this view with the given view site.boolean
Defines the dirty state indication behavior of thePropertySheet
instance for the current tracked part if it is aISaveablePart
instance or provides an adapter toISaveablePart
.protected boolean
isImportant
(IWorkbenchPart part) Returns whether the given part should be added to this view.boolean
isPinned()
void
partActivated
(IWorkbenchPart part) ThePropertySheet
implementation of thisIPartListener
method first sees if the active part is anIContributedContentsView
adapter and if so, asks it for its contributing part.void
partClosed
(IWorkbenchPart part) ThePageBookView
implementation of thisIPartListener
method deal with the closing of the active part.protected void
partHidden
(IWorkbenchPart part) Make sure that the part is not considered if it is hidden.protected void
partVisible
(IWorkbenchPart part) Make sure that the part is not considered if it is hidden.void
removed
(IExtension[] extensions) Notifies this listener that extensions were removed from the registry.void
removed
(IExtensionPoint[] extensionPoints) Notifies this listener that extension points were removed from the registry.void
Saves the object state within a memento.void
selectionChanged
(IWorkbenchPart part, ISelection sel) Notifies this listener that the selection has changed.void
setPinned
(boolean pinned) boolean
show
(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, showPageRec
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, setContentDescription, setInitializationData, setPartName
Methods 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, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:PageBookView
Creates 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:
createDefaultPage
in classPageBookView
- Parameters:
book
- the pagebook control- Returns:
- the default page
-
createPartControl
ThePropertySheet
implementation of thisIWorkbenchPart
method creates aPageBook
control with its default page showing.- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Overrides:
createPartControl
in classPageBookView
- Parameters:
parent
- the parent control
-
dispose
public void dispose()Description copied from class:PageBookView
ThePageBookView
implementation of thisIWorkbenchPart
method cleans up all the pages. Subclasses may extend.- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classPageBookView
-
doCreatePage
Description copied from class:PageBookView
Creates 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:
doCreatePage
in 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:PageBookView
Destroys a page in the pagebook for a particular part. This page was returned as a result fromdoCreatePage
.Subclasses must implement this method.
- Specified by:
doDestroyPage
in classPageBookView
- Parameters:
part
- the input partrec
- a page record for the part- See Also:
-
getBootstrapPart
Description copied from class:PageBookView
Returns 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
null
if none found.Subclasses must implement this method.
- Specified by:
getBootstrapPart
in classPageBookView
- Returns:
- the active important part, or
null
if none
-
init
Description copied from interface:IViewPart
Initializes 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:
init
in interfaceIViewPart
- Overrides:
init
in classPageBookView
- Parameters:
site
- the view site- Throws:
PartInitException
- may be thrown from overrides
-
saveState
Description copied from interface:IViewPart
Saves the object state within a memento. -
isImportant
Description copied from class:PageBookView
Returns whether the given part should be added to this view.Subclasses must implement this method.
- Specified by:
isImportant
in classPageBookView
- Parameters:
part
- the input part- Returns:
true
if the part is relevant, andfalse
otherwise
-
partClosed
Description copied from class:PageBookView
ThePageBookView
implementation of thisIPartListener
method deal with the closing of the active part. Subclasses may extend.- Specified by:
partClosed
in interfaceIPartListener
- Overrides:
partClosed
in classPageBookView
- Parameters:
part
- the part that was closed- See Also:
-
partVisible
Description copied from class:PageBookView
Make sure that the part is not considered if it is hidden.- Overrides:
partVisible
in classPageBookView
- Parameters:
part
- the part which got visible
-
partHidden
Description copied from class:PageBookView
Make sure that the part is not considered if it is hidden.- Overrides:
partHidden
in classPageBookView
- Parameters:
part
- the part which got hidden
-
partActivated
ThePropertySheet
implementation of thisIPartListener
method first sees if the active part is anIContributedContentsView
adapter and if so, asks it for its contributing part.- Specified by:
partActivated
in interfaceIPartListener
- Overrides:
partActivated
in classPageBookView
- Parameters:
part
- the part that was activated- See Also:
-
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 selectionsel
- the current selection. This may benull
ifINullSelectionListener
is implemented.- See Also:
-
isDirtyStateSupported
public boolean isDirtyStateSupported()Defines the dirty state indication behavior of thePropertySheet
instance for the current tracked part if it is aISaveablePart
instance 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
IPropertySheetPage
to the tracked part, or providingISecondarySaveableSource
adapter by the tracked part or by contributingISecondarySaveableSource
adapter to thePropertySheet
class.Strategy for the search is going from the smallest scope to the global scope, searching for the first
ISecondarySaveableSource
adapter.The current page is asked for the
ISecondarySaveableSource
adapter 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
IAdaptable
and return adapter toISecondarySaveableSource
.- Specified by:
isDirtyStateSupported
in interfaceISecondarySaveableSource
- Returns:
- returns
false
if the dirty state indication behavior is not desired. - Since:
- 3.9
-
getViewAdapter
ThePropertySheet
implementation of thisPageBookView
method handles theISaveablePart
adapter case by callinggetSaveablePart()
.- Overrides:
getViewAdapter
in classPageBookView
- Parameters:
key
- the adapter class to look up- Returns:
- a object castable to 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
-
isPinned
public boolean isPinned()- Returns:
- whether this property sheet is currently pinned
- Since:
- 3.4
-
getShowInContext
Description copied from interface:IShowInSource
Returns the context to show, ornull
if there is currently no valid context to show.- Specified by:
getShowInContext
in interfaceIShowInSource
- Returns:
- the context to show, or
null
-
show
Description copied from interface:IShowInTarget
Shows 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:
show
in interfaceIShowInTarget
- Parameters:
aContext
- the context to show- Returns:
true
if the context could be shown,false
otherwise
-
setPinned
public void setPinned(boolean pinned) - Parameters:
pinned
- Whether this sheet should be pinned- Since:
- 3.4
-
added
Description copied from interface:IRegistryEventListener
Notifies 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:
added
in interfaceIRegistryEventListener
- Parameters:
extensions
- extensions added to the registry
-
added
Description copied from interface:IRegistryEventListener
Notifies 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:
added
in interfaceIRegistryEventListener
- Parameters:
extensionPoints
- extension points added to the registry
-
removed
Description copied from interface:IRegistryEventListener
Notifies 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:
removed
in interfaceIRegistryEventListener
- Parameters:
extensions
- extensions removed from the registry
-
removed
Description copied from interface:IRegistryEventListener
Notifies 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:
removed
in interfaceIRegistryEventListener
- Parameters:
extensionPoints
- extension points removed from the registry
-