public class PageSite extends Object implements IPageSite, org.eclipse.ui.internal.services.INestable
IPageSite provides a site for a page
within a PageBookView. Most methods are forwarded to the
view's site.| Constructor and Description |
|---|
PageSite(IViewSite parentViewSite)
Creates a new sub view site of the given parent view site.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Notifies this service that the component within which it exists has
become active.
|
void |
deactivate()
Notifies this service that the component within which it exists has
become inactive.
|
protected void |
dispose()
Disposes of the menu extender contributions.
|
IActionBars |
getActionBars()
The PageSite implementation of this
IPageSite method
returns the SubActionBars for this site. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class
associated with this object.
|
IWorkbenchPage |
getPage()
Returns the page containing this workbench site.
|
ISelectionProvider |
getSelectionProvider()
Returns the selection provider for this workbench site.
|
Object |
getService(Class key)
Retrieves the service corresponding to the given API.
|
Shell |
getShell()
Returns the shell for this workbench site.
|
IWorkbenchWindow |
getWorkbenchWindow()
Returns the workbench window containing this workbench site.
|
boolean |
hasService(Class key)
Whether this service exists within the scope of this service locator.
|
void |
registerContextMenu(String menuID,
MenuManager menuMgr,
ISelectionProvider selProvider)
Registers a pop-up menu with a particular id for extension.
|
void |
setSelectionProvider(ISelectionProvider provider)
Sets the selection provider for this workbench site.
|
public PageSite(IViewSite parentViewSite)
parentViewSite - the parent view siteprotected void dispose()
public IActionBars getActionBars()
IPageSite method
returns the SubActionBars for this site.getActionBars in interface IPageSitepublic Object getAdapter(Class adapter)
IAdaptablenull if
no such object can be found.getAdapter in interface IAdaptableadapter - the adapter class to look upnull if this object does not
have an adapter for the given classpublic IWorkbenchPage getPage()
IWorkbenchSitegetPage in interface IWorkbenchSitepublic ISelectionProvider getSelectionProvider()
IWorkbenchSitegetSelectionProvider in interface IWorkbenchSitenull if nonepublic final Object getService(Class key)
IServiceLocatorgetService in interface IServiceLocatorkey - This is the interface that the service implements. Must not be
null.null if no such service could be
found.public Shell getShell()
IWorkbenchSiteFor compatibility, this method will not throw an exception if called from outside the UI thread, but the returned Shell may be wrong.
getShell in interface IShellProvidergetShell in interface IWorkbenchSitepublic IWorkbenchWindow getWorkbenchWindow()
IWorkbenchSitegetWorkbenchWindow in interface IWorkbenchSitepublic final boolean hasService(Class key)
IServiceLocatorhasService in interface IServiceLocatorkey - This is the interface that the service implements. Must not be
null.true iff the service locator can find a service
for the given API; false otherwise.public void registerContextMenu(String menuID, MenuManager menuMgr, ISelectionProvider selProvider)
IPageSite
Within the workbench one plug-in may extend the pop-up menus for a view
or editor within another plug-in. In order to be eligible for extension,
the menu must be registered by calling registerContextMenu.
Once this has been done the workbench will automatically insert any action
extensions which exist.
A unique menu id must be provided for each registered menu. This id should be published in the Javadoc for the page.
Any pop-up menu which is registered with the workbench should also define a
GroupMarker in the registered menu with id
IWorkbenchActionConstants.MB_ADDITIONS. Other plug-ins will use this
group as a reference point for insertion. The marker should be defined at an
appropriate location within the menu for insertion.
registerContextMenu in interface IPageSitemenuID - the menu idmenuMgr - the menu managerselProvider - the selection providerpublic void setSelectionProvider(ISelectionProvider provider)
IWorkbenchSitesetSelectionProvider in interface IWorkbenchSiteprovider - the selection provider, or null to clear itpublic void activate()
org.eclipse.ui.internal.services.INestableactivate in interface org.eclipse.ui.internal.services.INestablepublic void deactivate()
org.eclipse.ui.internal.services.INestabledeactivate in interface org.eclipse.ui.internal.services.INestableGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.