Child pages
  • MenuItem

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#ALIGN_CENTER] Constant for centering menu items/checkbox/radiobuttons at creation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#ALIGN_LEFT] Constant for left aligning menu items/checkbox/radiobuttons at creation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#ALIGN_RIGHT] Constant for right aligning menu items/checkbox/radiobuttons at creation.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#enabled] Enable/disable the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[Object]\[]{td}{td}[#methodArguments] Set arguments that are sent to the callback method.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#name] The name of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#selected] Select/unselect the checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#text] Get/set the text of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#doClick]\() Script the selection (emulate a mouse click) of the item.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#getClientProperty]\(key) Gets the specified client property for the menu item/checkbox/radiobutton based on a key.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#putClientProperty]\(key, value) Sets the value for the specified client property key of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setAccelerator]\() Set the accelerator key of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setBackgroundColor]\() Set the background color of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setForegroundColor]\() Set the foreground color of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setIcon]\() Set the icon of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setMethod]\(method) Set the method for the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setMethod]\(method, arguments) Set the method for the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setMnemonic]\() Set the mnemonic key of the menu item/checkbox/radiobutton.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#setVisible]\(visible) Set the item visible.{td}{tr}{tbody}{table}\\ {table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=ALIGN_CENTER}{tr:id=name}{td}h6.ALIGN_CENTER{td}{tr}{tr:id=des}{td}{div:class=sIndent}Constant for centering menu items/checkbox/radiobuttons at creation.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#ALIGN_CENTER
Constant for centering menu items/checkbox/radiobuttons at creation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#ALIGN_LEFT
Constant for left aligning menu items/checkbox/radiobuttons at creation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#ALIGN_RIGHT
Constant for right aligning menu items/checkbox/radiobuttons at creation.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#enabled
Enable/disable the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#methodArguments
Set arguments that are sent to the callback method.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#name
The name of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#selected
Select/unselect the checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#text
Get/set the text of the menu item/checkbox/radiobutton.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#doClick()
Script the selection (emulate a mouse click) of the item.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getClientProperty(key)
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#putClientProperty(key, value)
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setAccelerator()
Set the accelerator key of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setBackgroundColor()
Set the background color of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setForegroundColor()
Set the foreground color of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setIcon()
Set the icon of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setMethod(method)
Set the method for the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setMethod(method, arguments)
Set the method for the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setMnemonic()
Set the mnemonic key of the menu item/checkbox/radiobutton.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#setVisible(visible)
Set the item visible.

HTML Table
idconstant
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Constants Details
Table Body (tbody)
idALIGN_CENTER
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for centering menu items/checkbox/radiobuttons at creation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idALIGN_LEFT
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for left aligning menu items/checkbox/radiobuttons

...

at

...

creation.

...

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idALIGN_RIGHT
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for right aligning menu items/checkbox/radiobuttons

...

at

...

creation.

...

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idenabled
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Enable/disable the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idmethodArguments
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set arguments that are sent to the callback method.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idname
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The name of the menu item/checkbox/radiobutton.

...

The

...

name

...

is

...

used

...

only

...

internally,

...

it

...

is

...

not

...


visible

...

in

...

the

...

user

...

interface.

...

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idselected
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Select/unselect the checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idtext
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get/set the text of the menu item/checkbox/radiobutton.;

...

This

...

can

...

be

...

also

...

html

...

if

...

enclosed

...

between

...

html

...

tags
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
iddoClick
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
doClick
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Script the selection (emulate a mouse click) of the item.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// simulate a click on the entry
entry.doClick();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getClientProperty-Object}{tr:id=name}{td}h6.getClientProperty{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}getClientProperty{span}{span}\(key){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the specified client property for the menu item/checkbox/radiobutton based on a key.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} key {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetClientProperty-Object
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getClientProperty
Span
(key)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} key
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// NOTE: Depending on the operating system, a user interface property name may be available.
// set the tooltip of the menu item/checkbox/radiobutton via client properties
// keep the original tooltip in a form or global variable
originalTooltip = entry.getClientProperty("ToolTipText");
entry.putClientProperty("ToolTipText", "changed tooltip");

// later restore the original tooltip from the variable
//var menubar = plugins.window.getMenuBar();
//var menuIndex = menubar.getMenuIndexByText("New Menu");
//var menu = menubar.getMenu(menuIndex);
//var entry = menu.getItem(0);
//entry.putClientProperty("ToolTipText", originalTooltip);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idputClientProperty-Object_Object
}{
Table Row (tr)
:
id
=
name
}{td}h6.putClientProperty{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
putClientProperty
{span}{span}\
Span
(key,
value)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Sets the value for the specified client property key of the menu
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} key \{[Object]} value {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} key
{Object} value
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// NOTE: Depending on the operating system, a user interface property name may be available.
// set the tooltip of the menu item/checkbox/radiobutton via client properties
// keep the original tooltip in a form or global variable
originalTooltip = entry.getClientProperty("ToolTipText");
entry.putClientProperty("ToolTipText", "changed tooltip");

// later restore the original tooltip from the variable
//var menubar = plugins.window.getMenuBar();
//var menuIndex = menubar.getMenuIndexByText("New Menu");
//var menu = menubar.getMenu(menuIndex);
//var entry = menu.getItem(0);
//entry.putClientProperty("ToolTipText", originalTooltip);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setAccelerator}{tr:id=name}{td}h6.setAccelerator{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MenuItem]{span}{span:style=font-weight: bold;}setAccelerator{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the accelerator key of the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetAccelerator
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setAccelerator
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the accelerator key of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// define an accelerator for the menu entry
entry.setAccelerator("ctrl alt Y");
// also define a mnemonic
entry.setMnemonic("y");
// set a custom background color
entry.setBackgroundColor("#111111");
// set a custom foreground color
entry.setForegroundColor("#EE5555");
// set an icon
entry.setIcon("media:///yourimage.gif");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setBackgroundColor}{tr:id=name}{td}h6.setBackgroundColor{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}setBackgroundColor{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the background color of the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetBackgroundColor
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setBackgroundColor
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the background color of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// define an accelerator for the menu entry
entry.setAccelerator("ctrl alt Y");
// also define a mnemonic
entry.setMnemonic("y");
// set a custom background color
entry.setBackgroundColor("#111111");
// set a custom foreground color
entry.setForegroundColor("#EE5555");
// set an icon
entry.setIcon("media:///yourimage.gif");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setForegroundColor}{tr:id=name}{td}h6.setForegroundColor{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}setForegroundColor{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the foreground color of the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetForegroundColor
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setForegroundColor
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the foreground color of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// define an accelerator for the menu entry
entry.setAccelerator("ctrl alt Y");
// also define a mnemonic
entry.setMnemonic("y");
// set a custom background color
entry.setBackgroundColor("#111111");
// set a custom foreground color
entry.setForegroundColor("#EE5555");
// set an icon
entry.setIcon("media:///yourimage.
gif"); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setIcon}{tr:id=name}{td}h6.setIcon{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MenuItem]{span}{span:style=font-weight: bold;}setIcon{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the icon of the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
gif");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetIcon
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setIcon
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the icon of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// define an accelerator for the menu entry
entry.setAccelerator("ctrl alt Y");
// also define a mnemonic
entry.setMnemonic("y");
// set a custom background color
entry.setBackgroundColor("#111111");
// set a custom foreground color
entry.setForegroundColor("#EE5555");
// set an icon
entry.setIcon("media:///yourimage.gif");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setMethod-Function}{tr:id=name}{td}h6.setMethod{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MenuItem]{span}{span:style=font-weight: bold;}setMethod{span}{span}\(method){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the method for the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} method {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetMethod-Function
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setMethod
Span
(method)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the method for the menu item/checkbox/radiobutton.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Function} method
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetMethod-Function_ObjectArray
}{
Table Row (tr)
:
id
=
name
}{td}h6.setMethod{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
MenuItem
]{span}{span:style=
Span
stylefont-weight:
bold;
}setMethod{span}{span}\
setMethod
Span
(method,
arguments)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the method for the menu
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the method for the menu item/checkbox/radiobutton.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} method \{[Object]\[]} arguments {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Function} method
{Object[]} arguments
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item at the first position in the menu
var entry = menu.addMenuItem(0);
// alternatively add a checkbox at the first position
//var entry = menu.addCheckBox(0);
// or alternatively add a radiobutton at the first position
//var entry = menu.addRadioButton(0);

// disable the newly added entry
entry.enabled = false;
// give a name to the entry (the name is not visible anywhere)
entry.name = "my_name";
// make the entry selected (affects checkboxes and radiobuttons)
entry.selected = true;
// set the text of the entry
entry.text = "menu entry";
// set the callback method
entry.setMethod(feedback);
// set the arguments to be sent to the callback method
// (an array of elements which will be passed as arguments 5, 6 and so on to the callback method)
// the first 5 arguments are fixed: 
//	[0] item index
//	[1] parent item index
//	[2] isSelected boolean
//	[3] parent menu text
//	[4] menu text
entry.methodArguments = [17, "data"];
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setMnemonic}{tr:id=name}{td}h6.setMnemonic{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MenuItem]{span}{span:style=font-weight: bold;}setMnemonic{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the mnemonic key of the menu item/checkbox/radiobutton.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetMnemonic
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setMnemonic
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the mnemonic key of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry = menu.addMenuItem("menu entry", feedback);
// alternatively add a checkbox
//var entry = menu.addCheckBox("menu entry", feedback);
// or alternatively add a radiobutton
//var entry = menu.addRadioButton("menu entry", feedback);

// define an accelerator for the menu entry
entry.setAccelerator("ctrl alt Y");
// also define a mnemonic
entry.setMnemonic("y");
// set a custom background color
entry.setBackgroundColor("#111111");
// set a custom foreground color
entry.setForegroundColor("#EE5555");
// set an icon
entry.setIcon("media:///yourimage.gif");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setVisible-Boolean}{tr:id=name}{td}h6.setVisible{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MenuItem]{span}{span:style=font-weight: bold;}setVisible{span}{span}\(visible){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the item visible.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Boolean]} visible {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MenuItem]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetVisible-Boolean
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setVisible
Span
(visible)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the item visible.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Boolean} visible
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a menu item
var entry_one = menu.addMenuItem("an entry", feedback);
// add a checkbox
var entry_two = menu.addCheckBox("another entry", feedback);
// add a radiobutton
var entry_three = menu.addRadioButton("yet another entry", feedback);

// hide the menu item
entry_one.setVisible(false);
// make sure the checkbox is visible
entry_two.setVisible(true);
// hide the radiobutton
entry_three.setVisible(false);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)