This element specifies the properties for a developer defined custom menu item for use within Ephox EditLive! for Java.
<editLiveForJava>
<menuBar>
<menu>
<customMenuItem>
<editLiveForJava> ... <menuBar> ... <menu> <customMenuItem... /> </menu> ... </menuBar> ... </editLiveForJava> |
Attribute | Description |
name | The name which uniquely defines this custom menu item. |
text | The text to place on the menu for this item. |
action | The action which this menu item performs when clicked on. Note: This attribute has four possible values; insertHTMLAtCursor, insertHyperlinkAtCursor, raiseEvent or customPropertiesDialog. The raiseEvent functionality should not be used with the EditLive! for Java JavaBean. |
value | The value of the text or hyperlink to be inserted or the
name of the JavaScript function to be called when this menu item is
clicked. Note: When using the insertHTMLAtCursor action the HTML to be inserted must be URL encoded in the XML file. For example, <p>HTML to insert<p> becomes %3Cp%3EHTML%20to%20insert%3C/p%3E. |
Attribute | Description |
enableintag | The name of the tag in which a customPropertiesDialog
menu item is to be available.
Note: To enable a custom properties dialog within a custom tag this property must be set to custom regardless of the name of the tag in which the functionality it to be enabled. Enabling this functionality for custom tags via the custom value will enable it in all custom tags. |
imageURL | The URL of the image to be placed on the menu with the menu
item text. The image should be of a .gif format and be a size of
twenty (20) pixels high and twenty (20) pixels wide. Note: This URL can be relative or absolute. |
The following example demonstrates how to define a custom menu item for use within EditLive! for Java. The menu item defined in this example will insert HTML to insert at the cursor, note that the value in the example below is URL encoded.
<editLiveForJava>
...
<menuBar>
...
<menu>
<customMenuItem
name="customItem1"
text="Custom Item"
imageURL="http://www.someserver.com/image20x20.gif"
action="insertHTMLAtCursor"
value="%3Cp%3EHTML%20to%20insert%3C/p%3E" />
</menu>
...
</menuBar>
...
</editLiveForJava>
The following example demonstrates how to define a custom properties dialog which is launched from a custom menu item for use within EditLive! for Java. The custom properties dialog will be available for use when the cursor is inside any <td> tag.
<editLiveForJava>
...
<menuBar>
...
<menu>
<customMenuItem
name="customProperties1"
text="Custom td Properties"
action="customPropertiesDialog"
value="customTDFunction"
enableintag="td"/>
</menu>
...
</menuBar>
...
</editLiveForJava>
The <customMenuItem> element can appear multiple times within the <menu> element.
The <customMenuItem> 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:
<customMenuItem name=... />
Text assigned to the value attribute must be URL encoded as it is in the example above.
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.