info.magnolia.cms.gui.control
Class ContextMenu

java.lang.Object
  extended by info.magnolia.cms.gui.control.ControlImpl
      extended by info.magnolia.cms.gui.control.ContextMenu
All Implemented Interfaces:
Control
Direct Known Subclasses:
FunctionBar

public class ContextMenu
extends ControlImpl

This class encapsulates the context menu, used in the tree.

Version:
$Revision$ ($Author$)
Author:
Philipp Bracher

Field Summary
 
Fields inherited from class info.magnolia.cms.gui.control.ControlImpl
BUTTONSTATE_DISABLED, BUTTONSTATE_MOUSEDOWN, BUTTONSTATE_MOUSEOVER, BUTTONSTATE_NORMAL, BUTTONSTATE_PUSHED, BUTTONTYPE_CHECKBOX, BUTTONTYPE_PUSHBUTTON, BUTTONTYPE_RADIO, CSSCLASS_CONTROLBAR, CSSCLASS_CONTROLBARSMALL, CSSCLASS_CONTROLBUTTON, CSSCLASS_CONTROLBUTTONSMALL, ENCODING_NO, ENCRYPTION_HASH_BCRYPT, ENCRYPTION_HASH_SHA, ENCRYPTION_NO, ENCRYPTION_NO_ENCODING_BASE64, RICHEDIT_FCK, RICHEDIT_KUPU, RICHEDIT_NONE, VALUETYPE_MULTIPLE, VALUETYPE_SINGLE
 
Constructor Summary
ContextMenu(String menuName)
          Create a context menu and provide the name (used in javascript)
 
Method Summary
 void addMenuItem(ContextMenuItem item)
          Add a item
 String getHtml()
          Renders the HTML Code.
 String getJavascript()
           
 ContextMenuItem getMenuItem(int col)
           
 ContextMenuItem getMenuItemByName(String name)
           
 List<ContextMenuItem> getMenuItems()
           
 void setMenuItems(List<ContextMenuItem> menuItems)
          Populate it with a list
 
Methods inherited from class info.magnolia.cms.gui.control.ControlImpl
escapeHTML, getCssClass, getCssStyles, getCssStyles, getCssStyles, getEncoding, getEvents, getHtmlCssClass, getHtmlCssStyles, getHtmlEvents, getHtmlId, getHtmlInter, getHtmlInter, getHtmlPost, getHtmlPost, getHtmlPre, getHtmlPre, getHtmlSaveInfo, getId, getIsRichEditValue, getLabel, getName, getNodeCollectionName, getNodeCollectionName, getNodeName, getNodeName, getPath, getRequest, getSaveInfo, getType, getValue, getValues, getValueType, getWebsiteNode, println, setCssClass, setCssStyles, setCssStyles, setEncoding, setEvent, setEvent, setEvents, setHtmlInter, setHtmlPost, setHtmlPre, setId, setIsRichEditValue, setLabel, setName, setNodeCollectionName, setNodeName, setPath, setRequest, setSaveInfo, setType, setType, setValue, setValues, setValueType, setWebsiteNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenu

public ContextMenu(String menuName)
Create a context menu and provide the name (used in javascript)

Parameters:
menuName - the name used for the menu
Method Detail

getMenuItems

public List<ContextMenuItem> getMenuItems()
Returns:
all menu items

setMenuItems

public void setMenuItems(List<ContextMenuItem> menuItems)
Populate it with a list

Parameters:
menuItems - the list

getMenuItem

public ContextMenuItem getMenuItem(int col)
Parameters:
col - index
Returns:
the item

getMenuItemByName

public ContextMenuItem getMenuItemByName(String name)

addMenuItem

public void addMenuItem(ContextMenuItem item)
Add a item

Parameters:
item - the item object

getHtml

public String getHtml()
Renders the HTML Code. Creates a div with all the containing menuitems and adds the initialization in javascript

Specified by:
getHtml in interface Control
Overrides:
getHtml in class ControlImpl
Returns:
html code
See Also:
Control.getHtml()

getJavascript

public String getJavascript()


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.