Class PageSite
- All Implemented Interfaces:
- IAdaptable,- IShellProvider,- org.eclipse.ui.internal.services.INestable,- IWorkbenchSite,- IPageSite,- IServiceLocator
IPageSite provides a site for a page
 within a PageBookView. Most methods are forwarded to the view's
 site.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivate()Notifies this service that the component within which it exists has become active.voidNotifies this service that the component within which it exists has become inactive.protected voiddispose()Disposes of the menu extender contributions.The PageSite implementation of thisIPageSitemethod returns theSubActionBarsfor this site.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.getPage()Returns the page containing this workbench site.Returns the selection provider for this workbench site.final <T> TgetService(Class<T> key) Retrieves the service corresponding to the given API.getShell()Returns the shell for this workbench site.Returns the workbench window containing this workbench site.final booleanhasService(Class<?> key) Whether this service exists within the scope of this service locator.voidregisterContextMenu(String menuID, MenuManager menuMgr, ISelectionProvider selProvider) Registers a pop-up menu with a particular id for extension.voidsetSelectionProvider(ISelectionProvider provider) Sets the selection provider for this workbench site.
- 
Constructor Details- 
PageSiteCreates a new sub view site of the given parent view site.- Parameters:
- parentViewSite- the parent view site
 
 
- 
- 
Method Details- 
disposeprotected void dispose()Disposes of the menu extender contributions.
- 
getActionBarsThe PageSite implementation of thisIPageSitemethod returns theSubActionBarsfor this site.- Specified by:
- getActionBarsin interface- IPageSite
- Returns:
- the subactionbars for this site
 
- 
getAdapterDescription copied from interface:IAdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean)rather than invoking it directly.- Specified by:
- getAdapterin interface- IAdaptable
- Type Parameters:
- T- the class type
- Parameters:
- adapter- the adapter class to look up
- Returns:
- a object of the given class, or nullif this object does not have an adapter for the given class
 
- 
getPageDescription copied from interface:IWorkbenchSiteReturns the page containing this workbench site.- Specified by:
- getPagein interface- IWorkbenchSite
- Returns:
- the page containing this workbench site
 
- 
getSelectionProviderDescription copied from interface:IWorkbenchSiteReturns the selection provider for this workbench site.- Specified by:
- getSelectionProviderin interface- IWorkbenchSite
- Returns:
- the selection provider, or nullif none
 
- 
getServiceDescription copied from interface:IServiceLocatorRetrieves the service corresponding to the given API.- Specified by:
- getServicein interface- IServiceLocator
- Parameters:
- key- This is the interface that the service implements. Must not be- null.
- Returns:
- The service, or nullif no such service could be found.
 
- 
getShellDescription copied from interface:IWorkbenchSiteReturns the shell for this workbench site. Not intended to be called from outside the UI thread. Clients should call IWorkbench.getDisplay() to gain access to the display rather than calling getShell().getDisplay().For compatibility, this method will not throw an exception if called from outside the UI thread, but the returned Shell may be wrong. - Specified by:
- getShellin interface- IShellProvider
- Specified by:
- getShellin interface- IWorkbenchSite
- Returns:
- the shell for this workbench site
 
- 
getWorkbenchWindowDescription copied from interface:IWorkbenchSiteReturns the workbench window containing this workbench site.- Specified by:
- getWorkbenchWindowin interface- IWorkbenchSite
- Returns:
- the workbench window containing this workbench site
 
- 
hasServiceDescription copied from interface:IServiceLocatorWhether this service exists within the scope of this service locator. This does not include looking for the service within the scope of the parents. This method can be used to determine whether a particular service supports nesting in this scope.- Specified by:
- hasServicein interface- IServiceLocator
- Parameters:
- key- This is the interface that the service implements. Must not be- null.
- Returns:
- trueif the service locator can find a service for the given API;- falseotherwise.
 
- 
registerContextMenuDescription copied from interface:IPageSiteRegisters a pop-up menu with a particular id for extension.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 GroupMarkerin the registered menu with idIWorkbenchActionConstants.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.- Specified by:
- registerContextMenuin interface- IPageSite
- Parameters:
- menuID- the menu id
- menuMgr- the menu manager
- selProvider- the selection provider
 
- 
setSelectionProviderDescription copied from interface:IWorkbenchSiteSets the selection provider for this workbench site.- Specified by:
- setSelectionProviderin interface- IWorkbenchSite
- Parameters:
- provider- the selection provider, or- nullto clear it
 
- 
activatepublic void activate()Description copied from interface:org.eclipse.ui.internal.services.INestableNotifies this service that the component within which it exists has become active. The service should modify its state as appropriate.- Specified by:
- activatein interface- org.eclipse.ui.internal.services.INestable
 
- 
deactivatepublic void deactivate()Description copied from interface:org.eclipse.ui.internal.services.INestableNotifies this service that the component within which it exists has become inactive. The service should modify its state as appropriate.- Specified by:
- deactivatein interface- org.eclipse.ui.internal.services.INestable
 
 
-