dsto.dfc.swt.commands
Class CommandViewMenuBarProvider

java.lang.Object
  extended by dsto.dfc.swt.commands.CommandViewMenuBarProvider
All Implemented Interfaces:
CommandViewNodeListener, EventListener

public final class CommandViewMenuBarProvider
extends Object
implements CommandViewNodeListener

Synchronizes a menu bar with a CommandView.

Version:
$Revision$

Constructor Summary
CommandViewMenuBarProvider(org.eclipse.swt.widgets.Menu menuBar, CommandView commandView, CommandViewNode root)
          Create a new instance.
 
Method Summary
 void childAdded(CommandViewNodeEvent e)
          Fired when a child is added to the node.
 void childMoved(CommandViewNodeEvent e)
          Fired when a child is moved within the node.
 void childRemoved(CommandViewNodeEvent e)
          Fired when a child is removed from the node.
 void commandChanged(CommandViewNodeEvent e)
          Fired when a child is moved within the node.
 void dispose()
          Remove all listeners and references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandViewMenuBarProvider

public CommandViewMenuBarProvider(org.eclipse.swt.widgets.Menu menuBar,
                                  CommandView commandView,
                                  CommandViewNode root)
Create a new instance.

Parameters:
menuBar - The menu bar to synchronise.
commandView - The tree of commands.
root - The root node of the tree to use for this menu.
Method Detail

dispose

public void dispose()
Remove all listeners and references.


childAdded

public void childAdded(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is added to the node.

Specified by:
childAdded in interface CommandViewNodeListener
Parameters:
e - The event. e e.getNode () == new node, e.getOldIndex () == -1, e.getNewIndex () == index of new node.

childRemoved

public void childRemoved(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is removed from the node.

Specified by:
childRemoved in interface CommandViewNodeListener
Parameters:
e - The event. e.getNode () == removed node, e.getOldIndex () == old index of node, e.getNewIndex () == -1.

childMoved

public void childMoved(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is moved within the node.

Specified by:
childMoved in interface CommandViewNodeListener
Parameters:
e - The event. e.getNode () == moved node, e.getOldIndex () == old index of node, e.getNewIndex () == new index.

commandChanged

public void commandChanged(CommandViewNodeEvent e)
Description copied from interface: CommandViewNodeListener
Fired when a child is moved within the node.

Specified by:
commandChanged in interface CommandViewNodeListener
Parameters:
e - The event. e.getSourceNode () == node that changed, e.getNode () == null, e.getOldCommand () == old command (may be null), e.getNewCommand () == new command.


Copyright © 2008 Commonwealth of Australia