net.sf.doolin.gui.action.swing
Class JMenuBuilder

java.lang.Object
  extended by net.sf.doolin.gui.action.swing.AbstractMenuBuilder
      extended by net.sf.doolin.gui.action.swing.AbstractJMenuBuilder
          extended by net.sf.doolin.gui.action.swing.JMenuBuilder
All Implemented Interfaces:
MenuBuilder

public class JMenuBuilder
extends AbstractJMenuBuilder

MenuBuilder for a JMenu.

Author:
Damien Coraboeuf

Constructor Summary
JMenuBuilder(JMenu menu)
          Constructor.
 
Method Summary
 void add(SubscriberValidator subscriberValidator, Action swingAction)
          Adds a single action to the builder
 void clear()
          Removes all entries from the underlying component
protected  void createSeparator()
          This method is called when a sub-class must create a separator.
 MenuBuilder createSubMenu(String name, String label)
          Creates a sub-menu builder from this builder
protected  JMenu getMenuByName(String name)
          Utility method that looks for a sub-menu using the name of the menu as an identifier.
protected  JMenuItem getMenuItemByName(String name)
          Utility method that looks for a menu item using the name of the menu item as an identifier.
 
Methods inherited from class net.sf.doolin.gui.action.swing.AbstractJMenuBuilder
createMenu, createMenuItem
 
Methods inherited from class net.sf.doolin.gui.action.swing.AbstractMenuBuilder
add, addSeparator, noSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMenuBuilder

public JMenuBuilder(JMenu menu)
Constructor.

Parameters:
menu - Menu to build
Method Detail

createSubMenu

public MenuBuilder createSubMenu(String name,
                                 String label)
Description copied from interface: MenuBuilder
Creates a sub-menu builder from this builder

Parameters:
name - Identifier for the sub-menu
label - Label for the sub-menu
Returns:
Builder for the sub-menu

getMenuByName

protected JMenu getMenuByName(String name)
Utility method that looks for a sub-menu using the name of the menu as an identifier.

Parameters:
name - Name to find
Returns:
Found JMenu or null

getMenuItemByName

protected JMenuItem getMenuItemByName(String name)
Utility method that looks for a menu item using the name of the menu item as an identifier.

Parameters:
name - Name to find
Returns:
Found JMenuItem or null

clear

public void clear()
Description copied from interface: MenuBuilder
Removes all entries from the underlying component


createSeparator

protected void createSeparator()
Description copied from class: AbstractMenuBuilder
This method is called when a sub-class must create a separator.

Specified by:
createSeparator in class AbstractMenuBuilder

add

public void add(SubscriberValidator subscriberValidator,
                Action swingAction)
Description copied from interface: MenuBuilder
Adds a single action to the builder

Parameters:
subscriberValidator - Validator for any subscription on the Bus *
swingAction - Action to add


Copyright © 2011. All Rights Reserved.