Packagecom.adobe.bridge
Classpublic class MenuElement
InheritanceMenuElement Inheritance CSHostObject Inheritance flash.utils.Proxy

Since : CS5

Adobe Bridge creates MenuElement instances for each of the existing menu elements, and you can create additional instances to extend the existing menus. A script can execute a menu command using app.document.chooseMenuItem().Existing menu elements that can be extended have predefined identifiers, listed in the Adobe Bridge JavaScript Reference. Not all existing menu elements can be extended. You can only add a new menu or command before or after an existing menu or command, which you must specify using the predefined unique identifier. Use the create() static function to create new menu items, rather than the new operator. This function behaves correctly if a menu item with the same name already exists.



Public Properties
 PropertyDefined By
  altDown : Boolean
[read-only] When true, the Alt modifier key was pressed when the item was selected.
MenuElement
  canBeChecked : Boolean
[read-only] Whether the menu item can be checked.
MenuElement
  checked : Boolean
Whether the item is checked.
MenuElement
  cmdDown : Boolean
[read-only] When true, the Command modifier key was pressed when the item was selected.
MenuElement
  ctrlDown : Boolean
[read-only] When true, the Control modifier key was pressed when the item was selected.
MenuElement
  enabled : Boolean
Whether the menu or item is enabled.
MenuElement
 InheritedhostObjectDelegate : HostObject
Getter for the delegate
CSHostObject
  id : String
[read-only] A unique identifier for the element.
MenuElement
  location : String
[read-only] A string describing the location of the new menu element, with respect to existing menu elements.
MenuElement
  optionDown : Boolean
[read-only] When true, the Option modifier key was pressed when the item was selected.
MenuElement
  separatorAfter : Boolean
Whether there is a separator after this item.
MenuElement
  separatorBefore : Boolean
Whether there is a separator before this item.
MenuElement
  shiftDown : Boolean
[read-only] When true, the Shift modifier key was pressed when the item was selected.
MenuElement
  text : String
The displayed label text, a localizable string.
MenuElement
  type : String
[read-only] The type of menu element, a menu or command.
MenuElement
Public Methods
 MethodDefined By
  
MenuElement(type:String = null, text:String = null, location:String = null, id:String = null)
MenuElement
  
create(type:String, text:String, location:String, id:String):MenuElement
[static] Adds a new menu to the menu bar, a new submenu to an existing menu, or a new command to an existing menu or submenu.
MenuElement
 Inherited
filterArgsForHBAPI(args:Array):Array
[static] Function to clean up the argument list and put it into a format that makes sense for HBAPI.
CSHostObject
 Inherited
filterSingleObjectForHBAPI(value:Object):Object
[static]
CSHostObject
  
find(id:String):MenuElement
[static] Retrieves a menu element object using its unique identifier.
MenuElement
 Inherited
getClassObjectForName(className:String):HostObject
[static] This returns a "Class" object, meaning, a HostObject that can be used to make static function calls or get static properties
CSHostObject
 Inherited
getSpecialTranslation(className:String, ho:HostObject, expectedReturnType:Class, ownerName:String):*
[static]
CSHostObject
 Inherited
hostCall(name:String, expectedReturnType:Class, rawargs:Array):*
Encapsulates a function call to the host
CSHostObject
 Inherited
hostCallStatic(className:String, methodName:String, expectedReturnType:Class, rawargs:Array):*
[static] Implements a safe call of a static method on the host
CSHostObject
 Inherited
hostGet(name:String, expectedReturnType:Class):*
Encapsulates a property get to the host
CSHostObject
 Inherited
hostGetIndex(idx:Object, expectedReturnType:Class):*
Encapsulates a indexed get to the host
CSHostObject
 Inherited
hostGetStatic(className:String, propertyName:String, expectedReturnType:Class):*
[static] Implements a safe get of a static property on the host Used by for instance, all the enum implementations.
CSHostObject
 Inherited
hostSet(name:String, rawvalue:*):void
Encapsulates a property set to the host
CSHostObject
 Inherited
hostSetStatic(className:String, propertyName:String, rawvalue:*):*
[static] Implements a safe set of a static property on the host
CSHostObject
 Inherited
isDescendedFrom(clz:Class, ancClass:Class):Boolean
[static] Efficiently determines whether or not one class descends from another in inheritance hierarchy- class relationships are cached by the ClassUtils implementation- (uses org.as3commons lib to quickly discover class hierarchy.
CSHostObject
  
remove(id:String):void
[static] Removes a script-defined menu or menu item.
MenuElement
 Inherited
replaceDefaultArgs(args:Array, defaultArgs:Array):Array
Function to tidy up arguments prior to call.
CSHostObject
 Inherited
wrapReturnedHostObject(rawObject:Object, expectedReturnType:Class, client:CSHostObject, propertyName:String):*
[static] Method used on static/normal get/ hostcalls
CSHostObject
Protected Methods
 MethodDefined By
  
createWithArgs(args:Array):void
[override]
MenuElement
 Inherited
hostCreate(args:Array):void
CSHostObject
Property Detail
altDownproperty
altDown:Boolean  [read-only]

Since : CS5

When true, the Alt modifier key was pressed when the item was selected.


Implementation
    public function get altDown():Boolean
canBeCheckedproperty 
canBeChecked:Boolean  [read-only]

Since : CS5

Whether the menu item can be checked.


Implementation
    public function get canBeChecked():Boolean
checkedproperty 
checked:Boolean

Since : CS5

Whether the item is checked.


Implementation
    public function get checked():Boolean
    public function set checked(value:Boolean):void
cmdDownproperty 
cmdDown:Boolean  [read-only]

Since : CS5

When true, the Command modifier key was pressed when the item was selected.


Implementation
    public function get cmdDown():Boolean
ctrlDownproperty 
ctrlDown:Boolean  [read-only]

Since : CS5

When true, the Control modifier key was pressed when the item was selected.


Implementation
    public function get ctrlDown():Boolean
enabledproperty 
enabled:Boolean

Since : CS5

Whether the menu or item is enabled.


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
idproperty 
id:String  [read-only]

Since : CS5

A unique identifier for the element.


Implementation
    public function get id():String
locationproperty 
location:String  [read-only]

Since : CS5

A string describing the location of the new menu element, with respect to existing menu elements.


Implementation
    public function get location():String
optionDownproperty 
optionDown:Boolean  [read-only]

Since : CS5

When true, the Option modifier key was pressed when the item was selected.


Implementation
    public function get optionDown():Boolean
separatorAfterproperty 
separatorAfter:Boolean

Since : CS5

Whether there is a separator after this item.


Implementation
    public function get separatorAfter():Boolean
    public function set separatorAfter(value:Boolean):void
separatorBeforeproperty 
separatorBefore:Boolean

Since : CS5

Whether there is a separator before this item.


Implementation
    public function get separatorBefore():Boolean
    public function set separatorBefore(value:Boolean):void
shiftDownproperty 
shiftDown:Boolean  [read-only]

Since : CS5

When true, the Shift modifier key was pressed when the item was selected.


Implementation
    public function get shiftDown():Boolean
textproperty 
text:String

Since : CS5

The displayed label text, a localizable string.


Implementation
    public function get text():String
    public function set text(value:String):void
typeproperty 
type:String  [read-only]

Since : CS5

The type of menu element, a menu or command.


Implementation
    public function get type():String
Constructor Detail
MenuElement()Constructor
public function MenuElement(type:String = null, text:String = null, location:String = null, id:String = null)

Since : CS5

Parameters
type:String (default = null) — (String)
 
text:String (default = null) — (String)
 
location:String (default = null) — (String)
 
id:String (default = null) — (String)
Method Detail
create()method
public static function create(type:String, text:String, location:String, id:String):MenuElement

Since : CS5

Adds a new menu to the menu bar, a new submenu to an existing menu, or a new command to an existing menu or submenu.

Parameters

type:String — (String)
 
text:String — (String)
 
location:String — (String)
 
id:String — (String)

Returns
MenuElement
createWithArgs()method 
override protected function createWithArgs(args:Array):void

Since : CS5

Parameters

args:Array

find()method 
public static function find(id:String):MenuElement

Since : CS5

Retrieves a menu element object using its unique identifier.

Parameters

id:String — (String)

Returns
MenuElement
remove()method 
public static function remove(id:String):void

Since : CS5

Removes a script-defined menu or menu item.

Parameters

id:String — (String)