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:
IPartListener, IWindowListener

public final class DynamicBundleLoader
extends Object
implements IWindowListener, 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 partActivated(IWorkbenchPart part)
          A workbench part has been activated and needs to be checked against the waiting editors.
 void partBroughtToTop(IWorkbenchPart part)
          A workbench part has been brought to top.
 void partClosed(IWorkbenchPart part)
          A workbench part has been closed.
 void partDeactivated(IWorkbenchPart part)
          A workbench part has been deactivated.
 void partOpened(IWorkbenchPart part)
          A workbench part has been opened.
 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. 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

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

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

partActivated

public void partActivated(IWorkbenchPart part)
A workbench part has been activated and needs to be checked against the waiting editors.

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

partBroughtToTop

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

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

partClosed

public void partClosed(IWorkbenchPart part)
A workbench 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 workbench part has been deactivated. We are ignoring this event.

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

partOpened

public void partOpened(IWorkbenchPart part)
A workbench part has been opened. We are checking the opened part against the waiting bundles

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