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: 39453 $ ($Author: gjoseph $)
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_BASE64, ENCODING_NO, ENCODING_UNIX, RICHEDIT_FCK, RICHEDIT_KUPU, RICHEDIT_NONE, VALUETYPE_MULTIPLE, VALUETYPE_SINGLE
 
Constructor Summary
ContextMenu(java.lang.String menuName)
          Create a context menu and provide the name (used in javascript)
 
Method Summary
 void addMenuItem(ContextMenuItem item)
          Add a item
 java.lang.String getHtml()
          Renders the HTML Code.
 java.lang.String getJavascript()
           
 ContextMenuItem getMenuItem(int col)
           
 ContextMenuItem getMenuItemByName(java.lang.String name)
           
 java.util.List<ContextMenuItem> getMenuItems()
           
 void setMenuItems(java.util.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(java.lang.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 java.util.List<ContextMenuItem> getMenuItems()
Returns:
all menu items

setMenuItems

public void setMenuItems(java.util.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(java.lang.String name)

addMenuItem

public void addMenuItem(ContextMenuItem item)
Add a item

Parameters:
item - the item object

getHtml

public java.lang.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 java.lang.String getJavascript()


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