de.cau.cs.kieler.ksbase.ui.menus
Class DynamicBundleLoader

java.lang.Object
  extended by de.cau.cs.kieler.ksbase.ui.menus.DynamicBundleLoader
All Implemented Interfaces:
IPageListener, IPartListener, IWindowListener

public final class DynamicBundleLoader
extends Object
implements IWindowListener, IPageListener, IPartListener

The dynamic bundle loader class. This class contains lists of bundles which are loaded when a specific editor is activated. The bundle data is generated by the DynamicMenuContributions class.

Rating proposed yellow
(2009-12-15)

Field Summary
static DynamicBundleLoader INSTANCE
          Instance of this class.
 
Method Summary
 void activateAllEditors()
          Activates all pending bundles without caring of active editors.
 void addBundle(EditorTransformationSettings editor, URI bundlePath)
          Adding a bundle to the queue.
 void checkForWaitingEditor(String activeEditor)
          Checks if a given editor has pending activations.
 void pageActivated(IWorkbenchPage page)
          A page has been activated so we are checking the active editor Id.
 void pageClosed(IWorkbenchPage page)
          A page has been closed.
 void pageOpened(IWorkbenchPage page)
          A page has been opened so we are checking the active editor Id.
 void partActivated(IWorkbenchPart part)
          A workbench part has been activated so we are checking the site Id.
 void partBroughtToTop(IWorkbenchPart part)
          A part has been brought to top.
 void partClosed(IWorkbenchPart part)
          A part has been closed.
 void partDeactivated(IWorkbenchPart part)
          A part has been deactivated.
 void partOpened(IWorkbenchPart part)
          A part has been opened, so we are checking the site id.
 void windowActivated(IWorkbenchWindow window)
          A window has been activated.
 void windowClosed(IWorkbenchWindow window)
          A window has been closed.
 void windowDeactivated(IWorkbenchWindow window)
          A window has been deactivated.
 void windowOpened(IWorkbenchWindow window)
          A window has been opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DynamicBundleLoader INSTANCE
Instance of this class.

Method Detail

addBundle

public void addBundle(EditorTransformationSettings editor,
                      URI bundlePath)
Adding a bundle to the queue.

Parameters:
editor - The editor to add
bundlePath - The URI to the bundle path

activateAllEditors

public void activateAllEditors()
Activates all pending bundles without caring of active editors. This is used for debugging purposes while the open editor bug is fixed.


checkForWaitingEditor

public void checkForWaitingEditor(String activeEditor)
Checks if a given editor has pending activations. It will load and activate dynamic bundles that contribute the buttons and menu commands for the editor. The method is marked as synchronized to avoid concurrent modification exceptions when two events appear at the same time.

Parameters:
activeEditor - The editor class name to check

windowActivated

public void windowActivated(IWorkbenchWindow window)
A window has been activated. If the editor has an active page and editor the bundles are checked

Specified by:
windowActivated in interface IWindowListener
Parameters:
window - The activated window

windowOpened

public void windowOpened(IWorkbenchWindow window)
A window has been opened. If the editor has an active page and editor the bundles are checked

Specified by:
windowOpened in interface IWindowListener
Parameters:
window - The opened window

pageActivated

public void pageActivated(IWorkbenchPage page)
A page has been activated so we are checking the active editor Id.

Specified by:
pageActivated in interface IPageListener
Parameters:
page - The activated page

pageOpened

public void pageOpened(IWorkbenchPage page)
A page has been opened so we are checking the active editor Id.

Specified by:
pageOpened in interface IPageListener
Parameters:
page - The opened page

partActivated

public void partActivated(IWorkbenchPart part)
A workbench part has been activated so we are checking the site Id.

Specified by:
partActivated in interface IPartListener
Parameters:
part - The activated part

partOpened

public void partOpened(IWorkbenchPart part)
A part has been opened, so we are checking the site id.

Specified by:
partOpened in interface IPartListener
Parameters:
part - The opened part

partBroughtToTop

public void partBroughtToTop(IWorkbenchPart part)
A part has been brought to top. We are ignoring this event.

Specified by:
partBroughtToTop in interface IPartListener
Parameters:
part - The top part.

partClosed

public void partClosed(IWorkbenchPart part)
A part has been closed. We are ignoring this event.

Specified by:
partClosed in interface IPartListener
Parameters:
part - The closed part

partDeactivated

public void partDeactivated(IWorkbenchPart part)
A part has been deactivated. We are ignoring this event

Specified by:
partDeactivated in interface IPartListener
Parameters:
part - The deactivated part.

pageClosed

public void pageClosed(IWorkbenchPage page)
A page has been closed. We are ignoring this event.

Specified by:
pageClosed in interface IPageListener
Parameters:
page - The closed page

windowClosed

public void windowClosed(IWorkbenchWindow window)
A window has been closed. We are ignoring this event

Specified by:
windowClosed in interface IWindowListener
Parameters:
window - The closed window

windowDeactivated

public void windowDeactivated(IWorkbenchWindow window)
A window has been deactivated. We are ignoring this event

Specified by:
windowDeactivated in interface IWindowListener
Parameters:
window - The deactivated window