Class EditorSite
- All Implemented Interfaces:
IAdaptable
,IShellProvider
,IEditorSite
,IWorkbenchPartSite
,IWorkbenchSite
,IServiceLocator
-
Field Summary
Fields inherited from class org.eclipse.ui.internal.PartSite
menuExtenders, model, serviceLocator
-
Constructor Summary
ConstructorDescriptionEditorSite
(MPart model, IWorkbenchPart part, IWorkbenchPartReference ref, IConfigurationElement element) Constructs an EditorSite for an editor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateActionBars
(boolean forceVisibility) void
deactivateActionBars
(boolean forceHide) void
dispose()
Dispose the contributions.Returns the editor action bar contributor for this editor.Returns the editorReturns the extension editor action bar contributor for this editor.protected String
final void
registerContextMenu
(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Registers a pop-up menu with a particular id for extension.final void
registerContextMenu
(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Registers a pop-up menu with the default id for extension.void
setActionBars
(SubActionBars bars) Sets the action bars for the part.Methods inherited from class org.eclipse.ui.internal.PartSite
getActionBars, getAdapter, getContext, getContextMenuIds, getId, getKeyBindingService, getModel, getPage, getPart, getPartReference, getPluginId, getRegisteredName, getSelectionProvider, getService, getShell, getWorkbenchWindow, hasService, registerContextMenu, registerContextMenu, registerContextMenu, setPart, setSelectionProvider, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.ui.IEditorSite
getActionBars
Methods inherited from interface org.eclipse.ui.services.IServiceLocator
getService, hasService
Methods inherited from interface org.eclipse.ui.IWorkbenchPartSite
getId, getKeyBindingService, getPart, getPluginId, getRegisteredName, registerContextMenu, registerContextMenu
Methods inherited from interface org.eclipse.ui.IWorkbenchSite
getPage, getSelectionProvider, getShell, getWorkbenchWindow, setSelectionProvider
-
Constructor Details
-
EditorSite
public EditorSite(MPart model, IWorkbenchPart part, IWorkbenchPartReference ref, IConfigurationElement element) Constructs an EditorSite for an editor.
-
-
Method Details
-
setActionBars
Description copied from class:PartSite
Sets the action bars for the part.- Overrides:
setActionBars
in classPartSite
-
activateActionBars
public void activateActionBars(boolean forceVisibility) - Overrides:
activateActionBars
in classPartSite
-
deactivateActionBars
public void deactivateActionBars(boolean forceHide) - Overrides:
deactivateActionBars
in classPartSite
-
getActionBarContributor
Returns the editor action bar contributor for this editor.An action contributor is responsable for the creation of actions. By design, this contributor is used for one or more editors of the same type. Thus, the contributor returned by this method is not owned completely by the editor. It is shared.
- Specified by:
getActionBarContributor
in interfaceIEditorSite
- Returns:
- the editor action bar contributor
-
getExtensionActionBarContributor
Returns the extension editor action bar contributor for this editor. -
getEditorPart
Returns the editor -
getInitialScopeId
- Overrides:
getInitialScopeId
in classPartSite
-
dispose
public void dispose()Description copied from class:PartSite
Dispose the contributions. -
registerContextMenu
public final void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Description copied from interface:IEditorSite
Registers 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
includeEditorInput
asfalse
. 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:
registerContextMenu
in 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
public final void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) Description copied from interface:IEditorSite
Registers 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
includeEditorInput
asfalse
. 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:
registerContextMenu
in 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:
-