<menuItem> Element

This element specifies an item to include within a menu in Ephox EditLive! for Java.

Element Tree Structure

<editLiveForJava>
    <menuBar>
        <menu>
            <menuItem>

<editLiveForJava>
     ...
     <menuBar>
          <menu>
               <menuItem ... />
          </menu>
     </menuBar>
     ...
</editLiveForJava>

Required Attributes

Attribute Description
name This attribute gives the name for the menu item.  For use within a <menu> element it must be one of the following:
  • mnuNew - The New command.
  • mnuOpen - The Open... command.
  • mnuSave - The Save command.
  • mnuSaveAs - The Save As... command.
  • mnuUndo - The Undo command.
  • mnuRedo - The Redo command.
  • mnuCut - The Cut command.
  • mnuCopy - The Copy command.
  • mnuPaste - The Paste command.
  • mnuSelectAll - The Select All command.
  • mnuFind - The Find... command.
  • mnuHLink - The Insert Hyperlink... command.
  • mnuHRule - The Insert Horizontal Rule command.
  • mnuSymbol - The Insert Symbol... command.
  • mnuBookmark - The Insert Bookmark... command.
  • mnuImageLocal - The Insert Local Image... command.
  • mnuImageServer - The Insert Server Image... command.
  • mnuInsTable - The Insert Table... command.
  • mnuInsRowCol - The Insert Row or Column command.
  • mnuInsCell - The Insert Cell command.
  • mnuDelRow -The Delete Row command.
  • mnuDelCol - The Delete Column command.
  • mnuDelCell - The Delete Cell command.
  • mnuSplit - The Split Cell... command.
  • mnuMerge - The Merge Cells command.
  • mnuPropCell - The Cell Properties... command.
  • mnuPropRow - The Row Properties... command.
  • mnuPropColumn - The Column Properties... command.
  • mnuPropTable - The Table Properties... command.
  • mnuGridlines - The Show Gridlines command.
  • mnuSpelling - The Spelling... command.
  • mnuWordCount - The Word Count... command.
  • mnuColor - The (text) Color command.
  • mnuHighlightColor - The text Highlight Color command.
  • mnuBold - The Bold command.
  • mnuItalic - The Italic command.
  • mnuUnderline - The Underline command.
  • mnuStrike - The Strikethrough command.
  • mnuIncreaseIndent - The Increase Indent command.
  • mnuDecreaseIndent - The Decrease Indent command.
  • mnuPropList - The List Properties... command.
  • mnuRemoveFormatting - The Remove Formatting command.

In <submenu> items this attribute provides the value of the attribute.  It should correspond to the name or size of the relevant font or the value for the style.  The value used for this attribute will be inserted into the HTML source of the document when the submenu item is selected.

Optional Attributes

text This attribute is only valid for <submenu> menu items.  The attribute defines what the menu command is listed as in the <submenu>

Examples

The following example demonstrates how to add the mnuUndo, mnuRedo, mnuCut, mnuPaste, mnuSelectAll and mnuFind items to the Edit menu.  Thus the instance of EditLive! for Java using this configuration will have only an Edit menu with these items.

<editLiveForJava>
    ...
    <menuBar>
        <menu name="Edit">
            <menuItem name="mnuUndo"/>
            <menuItem name="mnuRedo"/>
            <menuItem name="mnuCut"/>
            <menuItem name="mnuCopy"/>
            <menuItem name="mnuPaste"/>
            <menuItem name="mnuSelectAll"/>
            <menuItem name="mnuFind"/>
        </menu>
    </menuBar>
    ...
</editLiveForJava>

The following example demonstrates how to add the Times New Roman, Courier New and Arial fonts to the mnuFontFace <submenu>.  They will be listed as the New Roman, Courier and Company Default fonts respectively, in the submenu due to their text attributes

<editLiveForJava>
    ...
    <menuBar>
        <menu name="Format">
            <submenu name="mnuFontFace">
                <menuItem name="Times New Roman" text="New Roman"/>
                <menuItem name="Courier New" text="Courier"/>
                <menuItem name="Arial" text="Company Default"/>
            </submenu>
        </menu>
    </menuBar>
    ...
</editLiveForJava>

Remarks

The <menuItem> element can appear multiple times within the <menu> element.

The <menuItem> element must be a complete tag, it cannot contain a tag body.  Therefore the tag must be closed in the same line.  See the example below:

    <menuItem name=... />

See Also