Class TabbedPropertySheetPage
java.lang.Object
org.eclipse.ui.part.Page
org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage
- All Implemented Interfaces:
EventListener
,ILabelProviderListener
,ISelectionListener
,IPage
,IPageBookViewPage
,IPropertySheetPage
public class TabbedPropertySheetPage
extends Page
implements IPropertySheetPage, ILabelProviderListener
A property sheet page that provides a tabbed UI.
- Author:
- Anthony Hunter
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTabbedPropertySheetPage
(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) create a new tabbed property sheet page.TabbedPropertySheetPage
(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor, boolean showTitleBar) create a new tabbed property sheet page. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTabSelectionListener
(ITabSelectionListener listener) Add a tab selection listener.void
createControl
(Composite parent) Creates the SWT control for this page under the given parent control.protected TabContents
createTab
(ITabDescriptor tabDescriptor) Create the tab contents for the provided tab descriptor.void
dispose()
ThePage
implementation of thisIPage
method disposes of this page's control (if it has one and it has not already been disposed).protected void
Dispose the contributor with the provided contributor id.protected void
disposeTabs
(Collection tabs) Disposes the TabContents objects passed to this method.Returns the list of currently active tabs.ThePage
implementation of thisIPage
method returnsnull
.protected String
Get the currently active contributor id.protected ISelection
Get the current selectionGet the currently active tab.Returns the currently selected tab.protected ITabbedPropertySheetPageContributor
Get the current selection-contributor if anyprotected TabContents
getTabContents
(ITabDescriptor tabDescriptor) Returns the TabContents object corresponding to the given tab-descriptor.protected IStructuredContentProvider
Gets the tab list content provider for the contributor.getTitleImage
(ISelection selection) Returns the title image for given selection.getTitleText
(ISelection selection) Returns text of the properties title for given selection.Get the widget factory.protected void
Handle the part activated event.void
Notifies this listener that the state of the label provider has changed in a way that affects the labels it computes.void
Override the tabs with a new set of tabs.void
refresh()
Refresh the currently active tab.void
Remove a tab selection listener.void
Resize the scrolled composite enclosing the sections, which may result in the addition or removal of scroll bars.void
selectionChanged
(IWorkbenchPart part, ISelection selection) Notifies this listener that the selection has changed.void
setActionBars
(IActionBars actionBars) This method exists for backward compatibility.void
setFocus()
ThePage
implementation of thisIPage
method does nothing.void
setSelectedTab
(String id) Set the currently selected tab to be that of the provided tab id.protected void
updateTabs
(ITabDescriptor[] descriptors) Update the current tabs to represent the given input object.Methods inherited from class org.eclipse.ui.part.Page
getSite, init, makeContributions
-
Field Details
-
tabListContentProvider
-
-
Constructor Details
-
TabbedPropertySheetPage
public TabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) create a new tabbed property sheet page.- Parameters:
tabbedPropertySheetPageContributor
- the tabbed property sheet page contributor.
-
TabbedPropertySheetPage
public TabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor, boolean showTitleBar) create a new tabbed property sheet page.- Parameters:
tabbedPropertySheetPageContributor
- the tabbed property sheet page contributor.showTitleBar
- boolean indicating if the title bar should be shown; default value istrue
- Since:
- 3.5
-
-
Method Details
-
handlePartActivated
Handle the part activated event.- Parameters:
part
- the new activated part.
-
createControl
Description copied from interface:IPage
Creates 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:
createControl
in interfaceIPage
- Specified by:
createControl
in classPage
- Parameters:
parent
- the parent control- See Also:
-
getTabListContentProvider
Gets the tab list content provider for the contributor.- Returns:
- the tab list content provider for the contributor.
-
disposeContributor
protected void disposeContributor()Dispose the contributor with the provided contributor id. This happens on part close as well as when contributors switch between the workbench part and contributor from a selection.- Since:
- 3.6
-
dispose
public void dispose()Description copied from class:Page
ThePage
implementation of thisIPage
method disposes of this page's control (if it has one and it has not already been disposed). Subclasses may extend. -
getControl
Description copied from class:Page
ThePage
implementation of thisIPage
method returnsnull
. Subclasses must reimplement.- Specified by:
getControl
in interfaceIPage
- Specified by:
getControl
in classPage
- Returns:
- the SWT control for this page, or
null
if this page does not have a control
-
setActionBars
Description copied from class:Page
This method exists for backward compatibility. Subclasses should reimplementinit
.- Specified by:
setActionBars
in interfaceIPage
- Overrides:
setActionBars
in classPage
- Parameters:
actionBars
- the action bars for this page
-
setFocus
public void setFocus()Description copied from class:Page
ThePage
implementation of thisIPage
method does nothing. Subclasses must implement. -
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 selectionselection
- the current selection. This may benull
ifINullSelectionListener
is implemented.- See Also:
-
resizeScrolledComposite
public void resizeScrolledComposite()Resize the scrolled composite enclosing the sections, which may result in the addition or removal of scroll bars.- Since:
- 3.5
-
disposeTabs
Disposes the TabContents objects passed to this method. If the 'currentTab' is going to be disposed, then the caller should call aboutToBeHidden() on the currentTab and set it to null before calling this method. Also, the caller needs to ensure that descriptorToTab map entries corresponding to the disposed TabContents objects are also removed.- Parameters:
tabs
- tabs to dispose- Since:
- 3.6
-
updateTabs
Update the current tabs to represent the given input object. When tabs apply for both the old and new input they are reused otherwise they are disposed. If the current visible tab will not be reused (i.e. will be disposed) we have to send it an aboutToBeHidden() message.- Since:
- 3.4
-
createTab
Create the tab contents for the provided tab descriptor.- Parameters:
tabDescriptor
- the tab descriptor.- Returns:
- the tab contents.
- Since:
- 3.4
-
refresh
public void refresh()Refresh the currently active tab. -
getCurrentTab
Get the currently active tab.- Returns:
- the currently active tab.
- Since:
- 3.4
-
addTabSelectionListener
Add a tab selection listener.- Parameters:
listener
- a tab selection listener.
-
removeTabSelectionListener
Remove a tab selection listener.- Parameters:
listener
- a tab selection listener.
-
overrideTabs
public void overrideTabs()Override the tabs with a new set of tabs. The tab list is obtained from theAbstractOverridableTabListPropertySection
by theIOverridableTabListContentProvider
.- Since:
- 3.4
-
getWidgetFactory
Get the widget factory.- Returns:
- the widget factory.
-
labelProviderChanged
Description copied from interface:ILabelProviderListener
Notifies this listener that the state of the label provider has changed in a way that affects the labels it computes.A typical response would be to refresh all labels by re-requesting them from the label provider.
- Specified by:
labelProviderChanged
in interfaceILabelProviderListener
- Parameters:
event
- the label provider change event
-
getSelectedTab
Returns the currently selected tab.- Returns:
- the currently selected tab or
null
if there is no tab selected. - Since:
- 3.5
-
getActiveTabs
Returns the list of currently active tabs.- Returns:
- the currently active tabs.
- Since:
- 3.5
-
setSelectedTab
Set the currently selected tab to be that of the provided tab id.- Parameters:
id
- The string id of the tab to select.- Since:
- 3.5
-
getTitleText
Returns text of the properties title for given selection. If selection is null, then currentSelection is used- Parameters:
selection
- Selection whose properties title text is to be returned- Returns:
- String representing title text.
- Since:
- 3.5
-
getTitleImage
Returns the title image for given selection. If selection is null, then currentSelection is used.- Parameters:
selection
- Selection whose properties title image is to be returned- Returns:
- Image that is used as a title image.
- Since:
- 3.5
-
getTabContents
Returns the TabContents object corresponding to the given tab-descriptor.- Parameters:
tabDescriptor
- tab-descriptor whose TabContents object is to be returned- Returns:
- TabContents object corresponding to the given tab-descriptor key in descriptorToTab map, or null if the key does not exist in the map
- Since:
- 3.6
-
getSelectionContributor
Get the current selection-contributor if any- Returns:
- The selection-contributor, or null.
- Since:
- 3.6
-
getCurrentContributorId
Get the currently active contributor id. It may not match the contributor id from the workbench part that created this instance because if all the elements in a structured selection implement ITabbedPropertySheetPageContributor and they all return the same unique contributor ID, then tabs and sections associated with that contributor ID are used by the tabbed property view for that selection.- Returns:
- contributor id
- Since:
- 3.6
-
getCurrentSelection
Get the current selection- Returns:
- selection
- Since:
- 3.6
-