dsto.dfc.swt.commands
Class CommandViewToolBarProvider

java.lang.Object
  extended by dsto.dfc.swt.commands.CommandViewToolBarProvider
All Implemented Interfaces:
CommandViewNodeListener, EventListener, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.internal.SWTEventListener

public final class CommandViewToolBarProvider
extends Object
implements CommandViewNodeListener, org.eclipse.swt.events.DisposeListener

Synchronizes a command view with a SWT CoolBar.


Constructor Summary
CommandViewToolBarProvider(org.eclipse.swt.widgets.CoolBar coolbar, CommandView commandView)
           
CommandViewToolBarProvider(org.eclipse.swt.widgets.CoolBar coolbar, CommandView commandView, CommandViewNode root)
          Create a new instance, adding all the entries, and setting up all the listeners.
 
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 then remove all the commands and command groups.
static void itemSizeChanged(org.eclipse.swt.widgets.ToolBar toolbar)
          Item providers can call this method to let the toolbar provider know the size of one of the items on the provider's toolbar may have changed (e.g.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandViewToolBarProvider

public CommandViewToolBarProvider(org.eclipse.swt.widgets.CoolBar coolbar,
                                  CommandView commandView)

CommandViewToolBarProvider

public CommandViewToolBarProvider(org.eclipse.swt.widgets.CoolBar coolbar,
                                  CommandView commandView,
                                  CommandViewNode root)
Create a new instance, adding all the entries, and setting up all the listeners.

Parameters:
coolbar - The JToolBar that you want syncronized.
commandView - The CommandView that you want synchronized.
root - The root CommandViewNode that you want to start from.
Method Detail

dispose

public void dispose()
Remove all listeners, and then remove all the commands and command groups.


widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e)
Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener

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.

itemSizeChanged

public static void itemSizeChanged(org.eclipse.swt.widgets.ToolBar toolbar)
Item providers can call this method to let the toolbar provider know the size of one of the items on the provider's toolbar may have changed (e.g. if the text or image changes). The toolbar provider will re-layout the toolbar/coolbar as needed.

Parameters:
toolbar - The toolbar instance that the provider created its items in.


Copyright © 2008 Commonwealth of Australia