com.ibm.jdg2e.extensionpoint
Class ToolActionsPulldownDelegate

java.lang.Object
  extended bycom.ibm.jdg2e.extensionpoint.ToolActionsPulldownDelegate
All Implemented Interfaces:
java.util.EventListener, org.eclipse.ui.IActionDelegate, org.eclipse.core.runtime.IRegistryChangeListener, org.eclipse.ui.IWorkbenchWindowActionDelegate, org.eclipse.ui.IWorkbenchWindowPulldownDelegate

public class ToolActionsPulldownDelegate
extends java.lang.Object
implements org.eclipse.ui.IWorkbenchWindowPulldownDelegate, org.eclipse.core.runtime.IRegistryChangeListener

Creates the menu items for the common tools toolbar pulldown menu. When an item is selected, it invokes the run method of the corresponding IToolsAction instance specified on the <tool action=IToolAction label="xxx"> tag.

This class also responds to dynamic additions to the extension registry by listening for Platform.getExtensionRegistry().addRegistryChangeListener events. See Handling Dynamic Plug-ins in Chapter 11 and FAQ 118, How do I make my plug-in dynamic aware? for more details.

See Also:
IToolAction, IWorkbenchWindowPulldownDelegate

Constructor Summary
ToolActionsPulldownDelegate()
           
 
Method Summary
 void dispose()
           
 org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)
          Returns the menu for this pull down action.
protected  java.util.List getToolActionDescriptors()
           
 void init(org.eclipse.ui.IWorkbenchWindow window)
           
 void registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent event)
          Handle plug-in registry changes by reconstructing the tool actions pulldown.
 void run(org.eclipse.jface.action.IAction action)
          Notifies this action delegate that menu pulldown was selected (i.e., not one of its menu item choices).
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolActionsPulldownDelegate

public ToolActionsPulldownDelegate()
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate

getMenu

public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)
Returns the menu for this pull down action. This method will only be called if the user opens the pull down menu for the action. The menu is disposed after use.

Specified by:
getMenu in interface org.eclipse.ui.IWorkbenchWindowPulldownDelegate
Returns:
the menu

getToolActionDescriptors

protected java.util.List getToolActionDescriptors()
Returns:
Returns the IToolActionDescriptors.

init

public void init(org.eclipse.ui.IWorkbenchWindow window)
Specified by:
init in interface org.eclipse.ui.IWorkbenchWindowActionDelegate

registryChanged

public void registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent event)
Handle plug-in registry changes by reconstructing the tool actions pulldown.

Specified by:
registryChanged in interface org.eclipse.core.runtime.IRegistryChangeListener
See Also:
IRegistryChangeListener.registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent)

run

public void run(org.eclipse.jface.action.IAction action)
Notifies this action delegate that menu pulldown was selected (i.e., not one of its menu item choices).

Specified by:
run in interface org.eclipse.ui.IActionDelegate

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate