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

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

public class JPopupMenuBuilder
extends AbstractJMenuBuilder

Pop-up menu builder

Author:
Damien Coraboeuf

Constructor Summary
JPopupMenuBuilder(JPopupMenu popupMenu)
          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

JPopupMenuBuilder

public JPopupMenuBuilder(JPopupMenu popupMenu)
Constructor.

Parameters:
popupMenu - Pop-up menu to build.
Method Detail

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

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

clear

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


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

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


Copyright © 2011. All Rights Reserved.