org.eclipse.xtext.ui.editor.folding
Class FoldingActionGroup

java.lang.Object
  extended by org.eclipse.ui.actions.ActionGroup
      extended by org.eclipse.xtext.ui.editor.folding.FoldingActionGroup

public class FoldingActionGroup
extends org.eclipse.ui.actions.ActionGroup

Groups the Xtext folding actions. Initially copied from org.eclipse.jdt.internal.ui.actions.FoldingActionGroup

Author:
Michael Clay - Initial contribution and API

Constructor Summary
FoldingActionGroup(org.eclipse.ui.texteditor.ITextEditor editor, org.eclipse.jface.text.ITextViewer viewer)
          Creates a new projection action group for editor.
 
Method Summary
 void dispose()
          This method is called by the user of an action group to signal that the group is no longer needed.
 void fillMenu(org.eclipse.jface.action.IMenuManager manager)
          Fills the menu with all folding actions.
protected  boolean isEnabled()
          Returns true if the group is enabled.
protected  void update()
          Updates the actions.
 void updateActionBars()
          Updates the state of the actions added to the action bars, including any global action handlers, based on the state of the ActionContext.
 
Methods inherited from class org.eclipse.ui.actions.ActionGroup
fillActionBars, fillContextMenu, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FoldingActionGroup

public FoldingActionGroup(org.eclipse.ui.texteditor.ITextEditor editor,
                          org.eclipse.jface.text.ITextViewer viewer)
Creates a new projection action group for editor. If the supplied viewer is not an instance of ProjectionViewer, the action group is disabled.

Parameters:
editor - the text editor to operate on
viewer - the viewer of the editor
Method Detail

isEnabled

protected boolean isEnabled()
Returns true if the group is enabled.
 Invariant: isEnabled() <=> fViewer and all actions are != null.
 

Returns:
true if the group is enabled

dispose

public void dispose()
Description copied from class: org.eclipse.ui.actions.ActionGroup
This method is called by the user of an action group to signal that the group is no longer needed. Subclasses typically implement this method to deregister any listeners or to free other resources.

The default implementation calls setContext(null). Subclasses may extend this method.

Overrides:
dispose in class org.eclipse.ui.actions.ActionGroup

update

protected void update()
Updates the actions.


fillMenu

public void fillMenu(org.eclipse.jface.action.IMenuManager manager)
Fills the menu with all folding actions.

Parameters:
manager - the menu manager for the folding submenu

updateActionBars

public void updateActionBars()
Description copied from class: org.eclipse.ui.actions.ActionGroup
Updates the state of the actions added to the action bars, including any global action handlers, based on the state of the ActionContext.

The default implementation does nothing. Subclasses may override or extend this method.

Overrides:
updateActionBars in class org.eclipse.ui.actions.ActionGroup