Class MultiPageEditorSite
- All Implemented Interfaces:
IAdaptable,IShellProvider,IEditorSite,org.eclipse.ui.internal.services.INestable,IWorkbenchPartSite,IWorkbenchSite,IServiceLocator
The base implementation of MultiPageEditor.createSite creates an
instance of this class. This class may be instantiated or subclassed.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiPageEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor) Creates a site for the given editor nested within the given multi-page editor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidactivate()Notifies the multi page editor service that the component within which it exists has become active.final voidNotifies the multi page editor service that the component within which it exists has been deactived.voiddispose()Dispose the contributions.TheMultiPageEditorSiteimplementation of thisIEditorSitemethod returnsnull, since nested editors do not have their own action bar contributor.TheMultiPageEditorSiteimplementation of thisIEditorSitemethod forwards to the multi-page editor to return the action bars.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Deprecated.use IWorkbench.getDecoratorManager()Returns the nested editor.getId()TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.Returns the key binding service in use.Returns the multi-page editor.protected IWorkbenchPartSitegetPage()TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the workbench page.getPart()Returns the part associated with this siteTheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns the selection provider set bysetSelectionProvider.final <T> TgetService(Class<T> key) Retrieves the service corresponding to the given API.getShell()TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the shell.TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the workbench window.protected voidHandles a post selection changed even from the nexted editor.protected voidHandles a selection changed event from the nested editor.final booleanhasService(Class key) Whether this service exists within the scope of this service locator.voidregisterContextMenu(String menuID, MenuManager menuMgr, ISelectionProvider selProvider) TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor for registration.final voidregisterContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Registers a pop-up menu with a particular id for extension.voidregisterContextMenu(MenuManager menuManager, ISelectionProvider selProvider) TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor for registration.final voidregisterContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Registers a pop-up menu with the default id for extension.voidsetSelectionProvider(ISelectionProvider provider) TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod remembers the selection provider, and also hooks a listener on it, which callshandleSelectionChangedwhen a selection changed event occurs.toString()
-
Constructor Details
-
MultiPageEditorSite
Creates a site for the given editor nested within the given multi-page editor.- Parameters:
multiPageEditor- the multi-page editoreditor- the nested editor
-
-
Method Details
-
activate
public final void activate()Notifies the multi page editor service that the component within which it exists has become active.- Specified by:
activatein interfaceorg.eclipse.ui.internal.services.INestable- Since:
- 3.2
-
deactivate
public final void deactivate()Notifies the multi page editor service that the component within which it exists has been deactived.- Specified by:
deactivatein interfaceorg.eclipse.ui.internal.services.INestable- Since:
- 3.2
-
dispose
public void dispose()Dispose the contributions. -
getActionBarContributor
TheMultiPageEditorSiteimplementation of thisIEditorSitemethod returnsnull, since nested editors do not have their own action bar contributor.- Specified by:
getActionBarContributorin interfaceIEditorSite- Returns:
null
-
getActionBars
TheMultiPageEditorSiteimplementation of thisIEditorSitemethod forwards to the multi-page editor to return the action bars.- Specified by:
getActionBarsin interfaceIEditorSite- Returns:
- The action bars from the parent multi-page editor.
-
getAdapter
Description 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 interfaceIAdaptable- 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
-
getDecoratorManager
Deprecated.use IWorkbench.getDecoratorManager()TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the decorator manager.- Returns:
- The decorator from the workbench window.
-
getEditor
Returns the nested editor.- Returns:
- the nested editor
-
getId
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.- Specified by:
getIdin interfaceIWorkbenchPartSite- Returns:
- An empty string.
-
getKeyBindingService
Description copied from interface:IWorkbenchPartSiteReturns the key binding service in use.The part will access this service to register all of its actions, to set the active scope.
- Specified by:
getKeyBindingServicein interfaceIWorkbenchPartSite- Returns:
- the key binding service in use
- See Also:
-
getMultiPageEditor
Returns the multi-page editor.- Returns:
- the multi-page editor
-
getPage
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the workbench page.- Specified by:
getPagein interfaceIWorkbenchSite- Returns:
- The workbench page in which this editor site resides.
-
getPart
Description copied from interface:IWorkbenchPartSiteReturns the part associated with this site- Specified by:
getPartin interfaceIWorkbenchPartSite- Returns:
- the part associated with this site
-
getPluginId
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.- Specified by:
getPluginIdin interfaceIWorkbenchPartSite- Returns:
- An empty string.
-
getRegisteredName
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns an empty string since the nested editor is not created from the registry.- Specified by:
getRegisteredNamein interfaceIWorkbenchPartSite- Returns:
- An empty string.
-
getSelectionProvider
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod returns the selection provider set bysetSelectionProvider.- Specified by:
getSelectionProviderin interfaceIWorkbenchSite- Returns:
- The current selection provider.
-
getService
Description copied from interface:IServiceLocatorRetrieves the service corresponding to the given API.- Specified by:
getServicein interfaceIServiceLocator- Parameters:
key- This is the interface that the service implements. Must not benull.- Returns:
- The service, or
nullif no such service could be found.
-
getShell
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the shell.- Specified by:
getShellin interfaceIShellProvider- Specified by:
getShellin interfaceIWorkbenchSite- Returns:
- The shell in which this editor site resides.
-
getWorkbenchWindow
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor to return the workbench window.- Specified by:
getWorkbenchWindowin interfaceIWorkbenchSite- Returns:
- The workbench window in which this editor site resides.
-
getNestedEditorSite
- Returns:
IWorkbenchPartSiteof the nested multi-page editor.- Since:
- 3.115
-
handlePostSelectionChanged
Handles a post selection changed even from the nexted editor.Subclasses may extend or reimplement this method
- Parameters:
event- the event- Since:
- 3.2
-
handleSelectionChanged
Handles a selection changed event from the nested editor. The default implementation gets the selection provider from the multi-page editor's site, and callsfireSelectionChangedon it (only if it is an instance ofMultiPageSelectionProvider), passing a new event object.Subclasses may extend or reimplement this method.
- Parameters:
event- the event
-
hasService
Description 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 interfaceIServiceLocator- Parameters:
key- This is the interface that the service implements. Must not benull.- Returns:
trueif the service locator can find a service for the given API;falseotherwise.
-
registerContextMenu
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor for registration.- Specified by:
registerContextMenuin interfaceIWorkbenchPartSite- Parameters:
menuManager- The menu managerselProvider- The selection provider.
-
registerContextMenu
public final void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Description copied from interface:IEditorSiteRegisters a pop-up menu with the default id for extension. The default id is defined as the part id.
By default, context menus include object contributions based on the editor input for the current editor. It is possible to override this behaviour by calling this method with
includeEditorInputasfalse. This might be desirable for editors that present a localized view of an editor input (e.g., a node in a model editor).For a detailed description of context menu registration see
IWorkbenchPartSite.registerContextMenu(MenuManager, ISelectionProvider)- Specified by:
registerContextMenuin interfaceIEditorSite- Parameters:
menuManager- the menu manager; must not benull.selectionProvider- the selection provider; must not benull.includeEditorInput- Whether the editor input should be included when adding object contributions to this context menu.- See Also:
-
registerContextMenu
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod forwards to the multi-page editor for registration.- Specified by:
registerContextMenuin interfaceIWorkbenchPartSite- Parameters:
menuID- The identifier for the menu.menuMgr- The menu managerselProvider- The selection provider.
-
registerContextMenu
public final void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Description copied from interface:IEditorSiteRegisters a pop-up menu with a particular id for extension. This method should only be called if the target part has more than one context menu to register.
By default, context menus include object contributions based on the editor input for the current editor. It is possible to override this behaviour by calling this method with
includeEditorInputasfalse. This might be desirable for editors that present a localized view of an editor input (e.g., a node in a model editor).For a detailed description of context menu registration see
IWorkbenchPartSite.registerContextMenu(MenuManager, ISelectionProvider)- Specified by:
registerContextMenuin interfaceIEditorSite- Parameters:
menuId- the menu id; must not benull.menuManager- the menu manager; must not benull.selectionProvider- the selection provider; must not benull.includeEditorInput- Whether the editor input should be included when adding object contributions to this context menu.- See Also:
-
setSelectionProvider
TheMultiPageEditorSiteimplementation of thisIWorkbenchPartSitemethod remembers the selection provider, and also hooks a listener on it, which callshandleSelectionChangedwhen a selection changed event occurs.- Specified by:
setSelectionProviderin interfaceIWorkbenchSite- Parameters:
provider- The selection provider.- See Also:
-
toString
-