Class PropertySheet

  • All Implemented Interfaces:
    EventListener, IAdaptable, IExecutableExtension, IRegistryEventListener, IPartListener, IPersistable, ISecondarySaveableSource, ISelectionListener, IViewPart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IShowInSource, IShowInTarget, IWorkbenchPartOrientation

    public class PropertySheet
    extends PageBookView
    implements ISelectionListener, IShowInTarget, IShowInSource, IRegistryEventListener, ISecondarySaveableSource
    Main class for the Property Sheet View.

    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:
    IPropertySheetPage, PropertySheetPage
    Restriction:
    This class is not intended to be subclassed by clients.
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

      • HELP_CONTEXT_PROPERTY_SHEET_VIEW

        public static final String HELP_CONTEXT_PROPERTY_SHEET_VIEW
        No longer used but preserved to avoid api change
        See Also:
        Constant Field Values
    • Constructor Detail

      • PropertySheet

        public PropertySheet()
        Creates a property sheet view.
    • Method Detail

      • createDefaultPage

        protected IPage createDefaultPage​(PageBook book)
        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 class PageBookView
        Parameters:
        book - the pagebook control
        Returns:
        the default page
      • createPartControl

        public void createPartControl​(Composite parent)
        The PropertySheet implementation of this IWorkbenchPart method creates a PageBook control with its default page showing.
        Specified by:
        createPartControl in interface IWorkbenchPart
        Overrides:
        createPartControl in class PageBookView
        Parameters:
        parent - the parent control
      • dispose

        public void dispose()
        Description copied from class: PageBookView
        The PageBookView implementation of this IWorkbenchPart method cleans up all the pages. Subclasses may extend.
        Specified by:
        dispose in interface IWorkbenchPart
        Overrides:
        dispose in class PageBookView
      • getBootstrapPart

        protected IWorkbenchPart 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 class PageBookView
        Returns:
        the active important part, or null if none
      • init

        public void init​(IViewSite site)
                  throws PartInitException
        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 interface IViewPart
        Overrides:
        init in class PageBookView
        Parameters:
        site - the view site
        Throws:
        PartInitException - if this view was not initialized successfully
      • isImportant

        protected boolean isImportant​(IWorkbenchPart part)
        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 class PageBookView
        Parameters:
        part - the input part
        Returns:
        true if the part is relevant, and false otherwise
      • selectionChanged

        public void selectionChanged​(IWorkbenchPart part,
                                     ISelection sel)
        Description copied from interface: ISelectionListener
        Notifies this listener that the selection has changed.

        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.

        Specified by:
        selectionChanged in interface ISelectionListener
        Parameters:
        part - the workbench part containing the selection
        sel - the current selection. This may be null if INullSelectionListener is implemented.
      • isDirtyStateSupported

        public boolean isDirtyStateSupported()
        Defines the dirty state indication behavior of the PropertySheet instance for the current tracked part if it is a ISaveablePart instance or provides an adapter to ISaveablePart.

        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 providing ISecondarySaveableSource adapter by the tracked part or by contributing ISecondarySaveableSource adapter to the PropertySheet 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 to ISecondarySaveableSource.

        Specified by:
        isDirtyStateSupported in interface ISecondarySaveableSource
        Returns:
        returns false if the dirty state indication behavior is not desired.
        Since:
        3.9
      • getViewAdapter

        protected <T> T getViewAdapter​(Class<T> key)
        The PropertySheet implementation of this PageBookView method handles the ISaveablePart adapter case by calling getSaveablePart().
        Overrides:
        getViewAdapter in class PageBookView
        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

        protected ISaveablePart getSaveablePart()
        Returns an ISaveablePart that delegates to the source part for the current page if it implements ISaveablePart, or null otherwise.
        Returns:
        an ISaveablePart or null
        Since:
        3.2
      • isPinned

        public boolean isPinned()
        Returns:
        whether this property sheet is currently pinned
        Since:
        3.4
      • getShowInContext

        public ShowInContext getShowInContext()
        Description copied from interface: IShowInSource
        Returns the context to show, or null if there is currently no valid context to show.
        Specified by:
        getShowInContext in interface IShowInSource
        Returns:
        the context to show, or null
      • show

        public boolean show​(ShowInContext aContext)
        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 interface IShowInTarget
        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

        public void added​(IExtension[] extensions)
        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 interface IRegistryEventListener
        Parameters:
        extensions - extensions added to the registry
      • added

        public void added​(IExtensionPoint[] extensionPoints)
        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 interface IRegistryEventListener
        Parameters:
        extensionPoints - extension points added to the registry
      • removed

        public void removed​(IExtension[] extensions)
        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 interface IRegistryEventListener
        Parameters:
        extensions - extensions removed from the registry
      • removed

        public void removed​(IExtensionPoint[] extensionPoints)
        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 interface IRegistryEventListener
        Parameters:
        extensionPoints - extension points removed from the registry