use of org.compiere.swing.CMenuItem in project adempiere by adempiere.
the class AProcess method createProcessMenuItem.
private CMenuItem createProcessMenuItem(final I_AD_Process process) {
final CMenuItem mi = new CMenuItem(model.getDisplayName(process));
mi.setToolTipText(model.getDescription(process));
mi.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
startProcess(process);
}
});
return mi;
}
use of org.compiere.swing.CMenuItem in project adempiere by adempiere.
the class AppsAction method getMenuItem.
// getButton
/**
* Return MenuItem
* @return MenuItem
*/
public JMenuItem getMenuItem() {
if (m_menu == null) {
if (m_toggle) {
m_menu = new CCheckBoxMenuItem(this);
m_menu.setSelectedIcon(m_smallPressed);
} else
m_menu = new CMenuItem(this);
m_menu.setAccelerator(m_accelerator);
m_menu.setActionCommand(m_action);
}
return m_menu;
}
use of org.compiere.swing.CMenuItem in project adempiere by adempiere.
the class AEnv method addMenuItem.
// getMenu
/**
* Create Menu Item.
* @param actionName action command
* @param iconName optional name of the icon, defaults to action if null
* @param ks optional key stroke
* @param menu menu to add menu item to
* @param al action listener to register
* @return MenuItem
*/
public static JMenuItem addMenuItem(String actionName, String iconName, KeyStroke ks, JMenu menu, ActionListener al) {
if (iconName == null)
iconName = actionName;
String text = Msg.getMsg(Env.getCtx(), actionName);
ImageIcon icon = Env.getImageIcon2(iconName + "16");
CMenuItem mi = new CMenuItem(text, icon);
mi.setActionCommand(actionName);
if (ks != null)
mi.setAccelerator(ks);
if (menu != null)
menu.add(mi);
if (al != null)
mi.addActionListener(al);
return mi;
}
Aggregations