On my OSX application I have a JMenubar with JMenus and Actions
editMenu= new JMenu("EDIT);
editMenu.add(new CopyAction());
editMenu.add(new PasteAction());
but I want to add menu to the dock which I can with Apple extensions and:
Application.getApplication().setDockMenu(java.awt.PopupMenu popupMenu)
Note this is awt from than swing, so I need to add MenuItems rather than JMenuItems
public class DockMenu extends PopupMenu
{
public DockMenu()
{
add(createMenuItemFromAction(new CopyAction()));
add(createMenuItemFromAction(new PasteAction()));
}
public MenuItem createMenuItemFromAction(Action action)
{
MenuItem mi = new MenuItem();
//TODO How do I convert
}
}
But Im really not clear how do this conversion, as menuitem doent use actions