Difference between revisions of "UIMenuConstants"
From OpenKM Documentation
(Created page with 'Constant to be used in OpenKM extensions to identify some menus where add own menu extensions. Note if menu location is not defined in extension, by default is set value '''NEW_…') |
(No difference)
|
Revision as of 11:40, 27 November 2010
Constant to be used in OpenKM extensions to identify some menus where add own menu extensions.
Note if menu location is not defined in extension, by default is set value NEW_MENU location. That means it'll be created as new menu into main menu desktop view.
Example
How adding new submenu in default tools menu:
public class SubMenuMessage {
private MenuItemExtension messageMenu;
private MenuBarExtension subMenuMessage;
private MenuItemExtension sendNewMessage;
/**
* SubMenuMessage
*/
public SubMenuMessage() {
// All menu items
sendNewMessage = new MenuItemExtension("img/icon/actions/new_message.png", "New message", sendMessage);
// Principal submenu
subMenuMessage = new MenuBarExtension();
subMenuMessage.addItem(sendNewMessage);
messageMenu = new MenuItemExtension("img/icon/actions/message.png", "Message", subMenuMessage);
messageMenu.setMenuLocation(UIMenuConstants.MAIN_MENU_TOOLS);
}
/**
* @return
*/
public MenuItemExtension getMenu() {
return messageMenu;
}
/**
* option1Action
*/
Command sendMessage = new Command() {
public void execute() {
Window.alert("some action");
}
};
}