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

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.JMenuBarBuilder
All Implemented Interfaces:
MenuBuilder

public class JMenuBarBuilder
extends AbstractJMenuBuilder

MenuBuilder for a JMenuBar.

Author:
Damien Coraboeuf

Constructor Summary
JMenuBarBuilder(JMenuBar menuBar)
          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.
 
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

JMenuBarBuilder

public JMenuBarBuilder(JMenuBar menuBar)
Constructor

Parameters:
menuBar - Menu bar 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

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.