<script TYPE="text/javascript" src="script/IlvAbstractPopupMenu.js"></script> <script TYPE="text/javascript" src="script/framework/IlvPopupMenu.js"></script>
//Creates the pop-up menu. var popupMenu = new IlvPopupMenu(); //Creates the menu model. var root = new IlvMenu("root"); var item1 = new IlvMenuItem("item1", true, "alert('item1 clicked')"); var item2 = new IlvMenuItem("item2", true, "alert('item2 clicked')"); root.add(item1); root.add(item2); //Sets the menu model to the pop-up menu. popupMenu.setMenu(root); [...] //Sets the pop-up menu to the view. view.setPopupMenu(popupMenu);
public class XmlGrapherServlet extends IlvManagerServlet { public XmlGrapherServlet() { [...] getSupport().setPopupEnabled(true); } [...] }
menuModelId
property
of the current interactor set on the view.var popupMenu = new IlvPopupMenu(); //Sets the pop-up menu to the view view.setPopupMenu(popupMenu);
public class XmlGrapherServlet extends IlvManagerServlet { public XmlGrapherServlet() { getSupport().setPopupEnabled(true); getSupport().getPopupMenuSupport().setMenuFactory (new XmlGrapherMenuFactory()); } [...] }
itemStyleClass
:
the base CSS class name applied to a menu item.itemHighlightedStyleClass
:
the style applied over the base style when the cursor is over the
item.itemDisabledStyleClass
:
the style applied over the base style when the cursor is disabled.[...] <style> .PopupMenuItem { background: #21bdbd; color: black; font-family: sans-serif; font-size: 12px; } .PopupMenuItemHighlighted { background: #057879; font-style: italic; color: white; } .PopupMenuItemDisabled { background-color: #EEEEEE; font-style: italic; color: black; } </style> [...] <script> var popupMenu = new IlvPopupMenu(); popupMenu.setItemStyleClass('PopupMenuItem'); popupMenu.setItemHighlightedStyleClass('PopupMenuItemHighlighted'); popupMenu.setItemDisabledStyleClass('PopupMenuItemDisabled'); </script>