OverviewSingleDeprecated

jsx3.gui

class Menu

Object
->jsx3.lang.Object
  ->jsx3.app.Model
    ->jsx3.gui.Painted
      ->jsx3.gui.Block
        ->jsx3.gui.Menu

All Implemented Interfaces:

jsx3.gui.Form, jsx3.gui.Interactive, jsx3.util.EventDispatcher, jsx3.xml.CDF, jsx3.xml.Cacheable

class Menu
extends jsx3.gui.Block
Create GUI menus, similar in functionality to system menus (File, Edit, etc) created by the host OS.

This class implements the CDF interface. Each record represents an item in the rendered menu. The following CDF attributes are supported by default:

Field Summary
static String
DEFAULTBACKGROUND
background-image:url(JSX/images/menu/bg.gif);backround-repeat:repeat-y; (default)
static String
DEFAULTBACKGROUNDCOLOR
#ffffff (default)
static int
DEFAULTCONTEXTLEFTOFFSET
static String
Deprecated.
static String
DEFAULTXSLURL
static String
Deprecated.
Constructor Summary
void
init(strName : String, strText : String)
The instance initializer.
Method Summary
void
Deprecated. No-op.
jsx3.gui.Menu
deselectItem(strRecordId : String)
flags a a menu item as being unselected (the default state)
jsx3.gui.Menu
disableItem(strRecordId : String)
disables a menu item with the given id; this ID is the jsxid attribute on the record adhereing to the JSX Common Data Format (CDF);
int
Sets the validation state for the menu and returns the validation state.
jsx3.gui.Menu
enableItem(strRecordId : String, bEnabled : boolean)
enables a menu item with the given id by removing its 'jsxselected'; this ID is the jsxid attribute on the record adhereing to the JSX Common Data Format (CDF);
jsx3.gui.Menu
executeRecord(strRecordId : String)
Executes the specific jsxexecute code for the menu record.
void
Returns the JSX GUI object that owns (contains) the context item (a CDF record) being acted upon.
void
Returns the CDF record ID for the context item being acted upon.
int
Returns whether this menu renders a visual divider on its left side.
String
Returns url for 16x16 pixel image (preferably a gif with a transparent background); returns null if no image specified or an empty string
String
Returns the jsxid value in the CDF for the menu item last executed; returns null if unavailable
static String
Deprecated.
boolean
isItemEnabled(strRecordId : String)
Returns whether a record is enabled.
boolean
isItemSelected(strRecordId : String)
Returns whether a record is selected.
String
Returns the DHTML, used for this object's on-screen VIEW
jsx3.gui.Menu
resets the cached DHTML content; hides any open menu; when the menu is next expanded (repainted), the update will be relected
jsx3.gui.Menu
selectItem(strRecordId : String, bSelected : boolean)
flags a a menu item as being selected; if the menu item is part of a group (e.g.
jsx3.gui.Menu
setDivider(intDivider : int, bRecalc : ?)
Sets whether this menu renders a visual divider on its left side.
jsx3.gui.Menu
setImage(strURL : String)
Sets url for 16x16 pixel image (preferably a gif with a transparent background); returns a reference to self to facilitate method chaining
Methods Inherited From jsx3.xml.Cacheable
clearXmlData, getNodeSet, getShareResources, getXML, getXMLId, getXMLString, getXMLTransformers, getXMLURL, getXSL, getXSLId, getXSLParams, getXSLString, getXSLURL, getXmlAsync, getXmlBind, onXmlBinding, removeXSLParam, removeXSLParams, resetCacheData, resetData, resetXmlCacheData, resetXslCacheData, setNodeSet, setShareResources, setSourceXML, setXMLId, setXMLString, setXMLTransformers, setXMLURL, setXSLId, setXSLParam, setXSLString, setXSLURL, setXmlAsync, setXmlBind
Methods Inherited From jsx3.xml.CDF
adoptRecord, adoptRecordBefore, convertProperties, deleteRecord, deleteRecordProperty, getRecord, getRecordNode, insertRecord, insertRecordBefore, insertRecordNode, insertRecordProperty, reloadFromSource
Methods Inherited From jsx3.gui.Form
doKeyBinding, doReset, getDisabledBackgroundColor, getDisabledColor, getEnabled, getKeyBinding, getRequired, getValidationState, setDisabledBackgroundColor, setDisabledColor, setEnabled, setKeyBinding, setRequired, setValidationState, setValue
Methods Inherited From jsx3.gui.Block
getBackground, getBackgroundColor, getBorder, getCSSOverride, getClassName, getColor, getCursor, getDimensions, getDisplay, getFontName, getFontSize, getFontWeight, getHeight, getIndex, getLeft, getMargin, getOverflow, getPadding, getRelativePosition, getTagName, getText, getTextAlign, getTip, getTop, getVisibility, getWidth, getZIndex, hideMask, setBackground, setBackgroundColor, setBorder, setCSSOverride, setClassName, setColor, setCursor, setDimensions, setDisplay, setFontName, setFontSize, setFontWeight, setHeight, setIndex, setLeft, setMargin, setOverflow, setPadding, setRelativePosition, setTagName, setText, setTextAlign, setTip, setTop, setVisibility, setWidth, setZIndex, showMask
Methods Inherited From jsx3.gui.Interactive
doEvent, getCanDrag, getCanDrop, getCanMove, getCanSpy, getEvent, getEvents, getMenu, hasEvent, registerHotKey, removeEvent, removeEvents, setCanDrag, setCanDrop, setCanMove, setCanSpy, setEvent, setMenu, setSpyStyles, showSpy
Methods Inherited From jsx3.gui.Painted
focus, getAbsolutePosition, getAttribute, getAttributes, getDynamicProperty, getRendered, insertHTML, onAfterPaint, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute, setDynamicProperty
Methods Inherited From jsx3.app.Model
adoptChild, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, setChild, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

DEFAULTBACKGROUND

static String DEFAULTBACKGROUND
background-image:url(JSX/images/menu/bg.gif);backround-repeat:repeat-y; (default)

DEFAULTBACKGROUNDCOLOR

static String DEFAULTBACKGROUNDCOLOR
#ffffff (default)

DEFAULTCONTEXTLEFTOFFSET

static int DEFAULTCONTEXTLEFTOFFSET

DEFAULTXSLCACHEID

static String DEFAULTXSLCACHEID
Deprecated.
JSX_MENU_XSL (default)

DEFAULTXSLURL

static String DEFAULTXSLURL

NODATAMESSAGE

static String NODATAMESSAGE
Deprecated.
Constructor Detail

init

void init(strName : String, strText : String)
The instance initializer.

Parameters:

strNameunique name distinguishing this object from all other JSX GUI objects in the JSX application
strTexttext for the menu (the persistent on-screen anchor that one would click to expand the menu); if the menu is only used as a context menu, this can be left null and the display property for the menu should be set to null
Method Detail

clearCachedContent

void clearCachedContent()
Deprecated. No-op.

deselectItem

jsx3.gui.Menu deselectItem(strRecordId : String)
flags a a menu item as being unselected (the default state)

Parameters:

strRecordIdthe jsxid property on the record node corresponding to the menu item to be deselected

Returns:

this object.  

disableItem

jsx3.gui.Menu disableItem(strRecordId : String)
disables a menu item with the given id; this ID is the jsxid attribute on the record adhereing to the JSX Common Data Format (CDF);

Parameters:

strRecordIdthe jsxid property on the record node corresponding to the menu item to be disabled

Returns:

this object.  

doValidate

int doValidate()
Sets the validation state for the menu and returns the validation state.

Returns:

jsx3.gui.Form.STATEVALID  

Overrides:

doValidate in jsx3.gui.Form

enableItem

jsx3.gui.Menu enableItem(strRecordId : String, bEnabled : boolean)
enables a menu item with the given id by removing its 'jsxselected'; this ID is the jsxid attribute on the record adhereing to the JSX Common Data Format (CDF);

Parameters:

strRecordIdthe jsxid property on the record node corresponding to the menu item to be enabled
bEnabledif false then disable the item

Returns:

this object.  

executeRecord

jsx3.gui.Menu executeRecord(strRecordId : String)
Executes the specific jsxexecute code for the menu record. This method also fires EXECUTE event for this menu but only under the deprecated 3.0 model event protocol.

Parameters:

strRecordIdid for the record whose code will be fire/execute

Returns:

this object  

getContextParent

void getContextParent()
Returns the JSX GUI object that owns (contains) the context item (a CDF record) being acted upon. For example, when a context menu is shown by right-clicking on a list tree, a ref to the tree/list is persisted as this value.

getContextRecordId

void getContextRecordId()
Returns the CDF record ID for the context item being acted upon. For example, when a context menu is shown by right-clicking on a row in a list or a node in a tree, the CDF record ID corresponding to the clicked item is persisted as this value.

getDivider

int getDivider()
Returns whether this menu renders a visual divider on its left side.

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE.  

getImage

String getImage()
Returns url for 16x16 pixel image (preferably a gif with a transparent background); returns null if no image specified or an empty string

Returns:

valid URL  

getValue

String getValue()
Returns the jsxid value in the CDF for the menu item last executed; returns null if unavailable

Returns:

 

Overrides:

getValue in jsx3.gui.Form

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

isItemEnabled

boolean isItemEnabled(strRecordId : String)
Returns whether a record is enabled.

Parameters:

strRecordIdthe jsxid property on the record node to query

Returns:

 

isItemSelected

boolean isItemSelected(strRecordId : String)
Returns whether a record is selected.

Parameters:

strRecordIdthe jsxid property on the record node to query.

Returns:

 

paint

String paint()
Returns the DHTML, used for this object's on-screen VIEW

Returns:

DHTML  

Overrides:

paint in jsx3.gui.Block

redrawRecord

jsx3.gui.Menu redrawRecord()
resets the cached DHTML content; hides any open menu; when the menu is next expanded (repainted), the update will be relected

Returns:

this object  

Overrides:

redrawRecord in jsx3.xml.CDF

selectItem

jsx3.gui.Menu selectItem(strRecordId : String, bSelected : boolean)
flags a a menu item as being selected; if the menu item is part of a group (e.g., when the record node has an attribute called 'jsxgroupname'), all other menu items belonging to that group will be deselected

Parameters:

strRecordIdthe jsxid property on the record node corresponding to the menu item to be selected
bSelectedif false then deselect the item

Returns:

this object.  

setDivider

jsx3.gui.Menu setDivider(intDivider : int, bRecalc : ?)
Sets whether this menu renders a visual divider on its left side. The divider is useful for visually separating this menu from the next menu to the left.

Parameters:

intDividerjsx3.Boolean.TRUE or jsx3.Boolean.FALSE.
bRecalc

Returns:

this objectt.  

setImage

jsx3.gui.Menu setImage(strURL : String)
Sets url for 16x16 pixel image (preferably a gif with a transparent background); returns a reference to self to facilitate method chaining

Parameters:

strURLvalid URL

Returns:

this object