
jadex.commons.gui.PopupBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-commons-gui Show documentation
Show all versions of jadex-commons-gui Show documentation
Common GUI support classes.
package jadex.commons.gui;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Action;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import jadex.commons.SUtil;
/**
* The popup builder. Constructs a (non-nested) popup menu from actions.
*/
public class PopupBuilder
{
/** The menu-items and actions. */
protected List rawmenu;
/**
* Create the popup builder.
* @param rawmenu The raw menu.
*/
public PopupBuilder()
{
this.rawmenu = new ArrayList();
}
/**
* Create the popup builder.
* @param rawmenu The raw menu.
*/
public PopupBuilder(List rawmenu)
{
this.rawmenu = rawmenu;
}
/**
* Create the popup builder.
* @param rawmenu The raw menu.
*/
public PopupBuilder(Object[] rawmenu)
{
this.rawmenu = SUtil.arrayToList(rawmenu);
}
/**
* Build the popup menu.
* @return The popup menu.
*/
public JPopupMenu buildPopupMenu()
{
JPopupMenu pop = new JPopupMenu();
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy