# Class EditorActionBars

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.SubActionBars
org.eclipse.ui.SubActionBars2
org.eclipse.ui.internal.EditorActionBars

All Implemented Interfaces:
  `IActionBars, IActionBars2`

public class EditorActionBars extends SubActionBars2
The action bars for an editor.

## Field Summary

### Fields inherited from class SubActionBars

`P_ACTION_HANDLERS`

## Constructor Summary

Constructors
Constructor
Description
`EditorActionBars(WorkbenchPage page, IServiceLocator serviceLocator, String type)`
Constructs the EditorActionBars for an editor.

## Method Summary

Modifier and Type
Method
Description
`void`
`activate(boolean forceVisibility)`
Activate the contributions.
`void`
`addRef()`
Add one ref to the bars.
`protected SubMenuManager`
`createSubMenuManager(IMenuManager parent)`
Returns a new sub menu manager.
`protected SubToolBarManager`
`createSubToolBarManager(IToolBarManager parent)`
Returns a new sub toolbar manager.
`void`
`deactivate(boolean forceVisibility)`
Deactivate the contributions.
`void`
`dispose()`
Dispose the contributions.
`IEditorActionBarContributor`
`getEditorContributor()`
Gets the editor contributor
`String`
`getEditorType()`
Returns the editor type.
`IEditorActionBarContributor`
`getExtensionContributor()`
Gets the extension contributor
`Expression`
`getHandlerExpression()`
Returns the expression used for action handler activation.
`WorkbenchPage`
`getPage()`
`int`
`getRef()`
Returns the reference count.
`IToolBarManager`
`getToolBarManager()`
Returns the tool bar manager.
`void`
`partChanged(IWorkbenchPart part)`
Sets the target part for the action bars.
`void`
`removeRef()`
Remove one ref to the bars.
`void`
`setEditorContributor(IEditorActionBarContributor c)`
Sets the editor contributor
`void`
`setExtensionContributor(IEditorActionBarContributor c)`
Sets the extension contributor

### Methods inherited from class SubActionBars2

`createSubCoolBarManager, getCastedParent, getCoolBarManager, setActive`

### Methods inherited from class SubActionBars

`activate, addPropertyChangeListener, basicSetActive, clearGlobalActionHandlers, deactivate, fireActionHandlersChanged, firePropertyChange, getActive, getGlobalActionHandler, getGlobalActionHandlers, getMenuManager, getParent, getServiceLocator, getStatusLineManager, isSubMenuManagerCreated, isSubStatusLineManagerCreated, isSubToolBarManagerCreated, removePropertyChangeListener, setGlobalActionHandler, setServiceLocator, updateActionBars`

### Methods inherited from class EventManager

`addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface IActionBars

`clearGlobalActionHandlers, getGlobalActionHandler, getMenuManager, getServiceLocator, getStatusLineManager, setGlobalActionHandler, updateActionBars`

## Constructor Details

### EditorActionBars

public EditorActionBars(WorkbenchPage page, IServiceLocator serviceLocator, String type)
Constructs the EditorActionBars for an editor.

## Method Details

### getPage

public WorkbenchPage getPage()

### activate

public void activate(boolean forceVisibility)
Activate the contributions.

Overrides:
  `activate` in class `SubActionBars`
Parameters:
  `forceVisibility` - (is not used)

### addRef

public void addRef()
Add one ref to the bars.

### createSubMenuManager

protected SubMenuManager createSubMenuManager(IMenuManager parent)
Description copied from class: `SubActionBars`
Returns a new sub menu manager.

Overrides:
  `createSubMenuManager` in class `SubActionBars`
Parameters:
  `parent` - the parent menu manager
Returns:
  the menu manager

### createSubToolBarManager

protected SubToolBarManager createSubToolBarManager(IToolBarManager parent)
Description copied from class: `SubActionBars`
Returns a new sub toolbar manager.

Overrides:
  `createSubToolBarManager` in class `SubActionBars`
Parameters:
  `parent` - the parent toolbar manager
Returns:
  the tool bar manager

### deactivate

public void deactivate(boolean forceVisibility)
Deactivate the contributions.

Overrides:
  `deactivate` in class `SubActionBars`
Parameters:
  `forceVisibility` - (not used)

### dispose

public void dispose()
Dispose the contributions.

Overrides:
  `dispose` in class `SubActionBars2`

### getEditorContributor

public IEditorActionBarContributor getEditorContributor()
Gets the editor contributor

### getEditorType

public String getEditorType()
Returns the editor type.

### getExtensionContributor

public IEditorActionBarContributor getExtensionContributor()
Gets the extension contributor

### getRef

public int getRef()
Returns the reference count.

### getToolBarManager

public IToolBarManager getToolBarManager()
Returns the tool bar manager. If items are added or removed from the manager be sure to call `updateActionBars`. Overridden to support CoolBars.

Specified by:
  `getToolBarManager` in interface `IActionBars`
Overrides:
  `getToolBarManager` in class `SubActionBars`
Returns:
  the tool bar manager

### partChanged

public void partChanged(IWorkbenchPart part)
Sets the target part for the action bars. For views this is ignored because each view has its own action vector. For editors this is important because the action vector is shared by editors of the same type.

Overrides:
  `partChanged` in class `SubActionBars`
Parameters:
  `part` - the part to be notified.

### removeRef

public void removeRef()
Remove one ref to the bars.

### setEditorContributor

public void setEditorContributor(IEditorActionBarContributor c)
Sets the editor contributor

### setExtensionContributor

public void setExtensionContributor(IEditorActionBarContributor c)
Sets the extension contributor

### getHandlerExpression

public Expression getHandlerExpression()
Returns the expression used for action handler activation.

Returns:
  the expression used for action handler activation.