sk.uniba.euromath.editor.actions
Class MultiViewActionContributor

java.lang.Object
  extended by org.eclipse.ui.part.EditorActionBarContributor
      extended by org.eclipse.ui.part.MultiPageEditorActionBarContributor
          extended by sk.uniba.euromath.editor.actions.MultiViewActionContributor
All Implemented Interfaces:
IEditorActionBarContributor, IFocusListener

public class MultiViewActionContributor
extends MultiPageEditorActionBarContributor
implements IFocusListener

MultiViewActionContributor is contributor for special IEditorPart - MutliViewXMLEditor. It is contributor for all opened documents and views (from that name multi view). Contributes to global bars by own contributions and by contributions of active IEditor. When focus is changed in EditorSite (active IEditor has changed) or in workbench page (another EditorSite has been activated, it means another view) contributions are updated.

Terminology

In Euromath MutliViewXMLEditor and MultiViewActionContributor correspond to one opened document. On this opened document can be opened many views(view corresponds to EditorSite) and one view is composed of many IEditors with IActionContributors corresponding to rendered namespaces in view.

Contributing by IEditor's IActionContributor

There are two possibilities to contribute to global bar:

NOT WORKING Action sharing in one opened document

Actions of in one type IEditor can be shared by it instances in all opened views. This is action sharing is implemented in views over opened document. Such shareable action contributed by IActionContributor must implement IMultiViewAction and must have unique id. Its context is changed by IMultiViewAction.setWorkbenchPart(org.eclipse.ui.IWorkbenchPart).

Author:
Tomáš Studva 19.9.2005

Constructor Summary
MultiViewActionContributor()
          Constructor.
 
Method Summary
 void contributeToMenu(IMenuManager menuManager)
           
 void contributeToStatusLine(IStatusLineManager statusLineManager)
           
 void contributeToToolBar(IToolBarManager toolBarManager)
           
 void focusGained(IEditor editor)
          Sent when IEditor gets focus.
 void focusLost(IEditor editor)
          Sent when IEditor loses focus.
 org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
          This contributor's action registry.
 void init(IActionBars bars)
           
 void setActivePage(IEditorPart activeEditor)
           
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorActionBarContributor
setActiveEditor
 
Methods inherited from class org.eclipse.ui.part.EditorActionBarContributor
contributeToCoolBar, dispose, getActionBars, getPage, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiViewActionContributor

public MultiViewActionContributor()
Constructor.

Method Detail

init

public void init(IActionBars bars)
Overrides:
init in class EditorActionBarContributor

setActivePage

public void setActivePage(IEditorPart activeEditor)
Specified by:
setActivePage in class MultiPageEditorActionBarContributor

getActionRegistry

public org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
This contributor's action registry.

Returns:
action registry used to registry actions used to contribute by this contributor

contributeToMenu

public void contributeToMenu(IMenuManager menuManager)
Overrides:
contributeToMenu in class EditorActionBarContributor

contributeToStatusLine

public void contributeToStatusLine(IStatusLineManager statusLineManager)
Overrides:
contributeToStatusLine in class EditorActionBarContributor

contributeToToolBar

public void contributeToToolBar(IToolBarManager toolBarManager)
Overrides:
contributeToToolBar in class EditorActionBarContributor

focusGained

public void focusGained(IEditor editor)
Description copied from interface: IFocusListener
Sent when IEditor gets focus.

Specified by:
focusGained in interface IFocusListener
Parameters:
editor - which has acquired focus

focusLost

public void focusLost(IEditor editor)
Description copied from interface: IFocusListener
Sent when IEditor loses focus.

Specified by:
focusLost in interface IFocusListener
Parameters:
editor - which has lost focus


Copyright © 2003-2006 null. All Rights Reserved.