Package org.eclipse.ui.internal

# Class EditorSite

java.lang.Object
org.eclipse.ui.internal.PartSite
org.eclipse.ui.internal.EditorSite

All Implemented Interfaces:
  `IAdaptable`, `IShellProvider`, `IEditorSite`, `IWorkbenchPartSite`, `IWorkbenchSite`, `IServiceLocator`

public class EditorSite extends PartSite implements IEditorSite
An editor container manages the services for an editor.

## Field Summary

### Fields inherited from class org.eclipse.ui.internal.PartSite

`menuExtenders, model, serviceLocator`

## Constructor Summary

Constructors
Constructor
Description
`EditorSite(MPart model, IWorkbenchPart part, IWorkbenchPartReference ref, IConfigurationElement element)`
Constructs an EditorSite for an editor.

## Method Summary

Modifier and Type
Method
Description
`void`
`activateActionBars(boolean forceVisibility)`
`void`
`deactivateActionBars(boolean forceHide)`
`void`
`dispose()`
Dispose the contributions.
`IEditorActionBarContributor`
`getActionBarContributor()`
Returns the editor action bar contributor for this editor.
`IEditorPart`
`getEditorPart()`
Returns the editor
`IEditorActionBarContributor`
`getExtensionActionBarContributor()`
Returns the extension editor action bar contributor for this editor.
`protected String`
`getInitialScopeId()`
`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

public void setActionBars(SubActionBars bars)
Description copied from class: `PartSite`
Sets the action bars for the part.

Overrides:
  `setActionBars` in class `PartSite`

### activateActionBars

public void activateActionBars(boolean forceVisibility)

Overrides:
  `activateActionBars` in class `PartSite`

### deactivateActionBars

public void deactivateActionBars(boolean forceHide)

Overrides:
  `deactivateActionBars` in class `PartSite`

### getActionBarContributor

public IEditorActionBarContributor 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 interface `IEditorSite`
Returns:
  the editor action bar contributor

### getExtensionActionBarContributor

public IEditorActionBarContributor getExtensionActionBarContributor()
Returns the extension editor action bar contributor for this editor.

### getEditorPart

public IEditorPart getEditorPart()
Returns the editor

### getInitialScopeId

protected String getInitialScopeId()

Overrides:
  `getInitialScopeId` in class `PartSite`

### dispose

public void dispose()
Description copied from class: `PartSite`
Dispose the contributions.

Overrides:
  `dispose` in class `PartSite`

### 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` as `false`. 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 interface `IEditorSite`
Parameters:
  `menuManager` - the menu manager; must not be `null`.
  `selectionProvider` - the selection provider; must not be `null`.
  `includeEditorInput` - Whether the editor input should be included when adding object contributions to this context menu.
See Also:
  - `IWorkbenchPartSite.registerContextMenu(MenuManager, ISelectionProvider)`

### 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` as `false`. 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 interface `IEditorSite`
Parameters:
  `menuId` - the menu id; must not be `null`.
  `menuManager` - the menu manager; must not be `null`.
  `selectionProvider` - the selection provider; must not be `null`.
  `includeEditorInput` - Whether the editor input should be included when adding object contributions to this context menu.
See Also:
  - `IWorkbenchPartSite.registerContextMenu(MenuManager, ISelectionProvider)`