Page History
Wiki Markup |
---|
{hiddendiv:style=display: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 EXTRACTAUTO CHANGES FROMUPDATE THE PAGECONTENT ANDTHROUGH MERGETHE THEM BACK INTO SERVOY SOURCE{hiddenDOC GENERATOR{div} {sub-sectiondiv:id=description|text=}{sub-sectiondiv}\\ {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}[Menu]{td}{td}[#addMenu]\() Add a menu to the menubar.{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#addMenu]\(index) Add a menu to the menubar.{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#getMenu]\(index) Get the menu at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMenuCount]\() Get the number of (top level) menu's.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMenuIndexByText]\(name) Retrieve the index of the item by text.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeAllMenus]\() Remove all menus from the menubar.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeMenu]\(index) Remove the menu(s) at the selected index/indices.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#reset]\() Reset the menubar to the default.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setVisible]\(visible) Show/hide the menu bar{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addMenu|class=node}{tr:id=name}{td}h6.addMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=floatfont-weight: left; font-weight: bold;bold;}addMenu{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=desret}{td}{sub-section:addMenu_des|trigger=button|text=}{sub-section}{sub-section:addMenu_des|trigger=none|*Returns*\\{div:class=sIndent}Replace with description{sub-section[Menu]{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:addMenu_snc|trigger=button|text=}{sub-section}{sub-section:addMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu_prs|trigger=button|text=}{sub-section}{sub-section:addMenu_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu_ret|trigger=button|text=}{sub-section}{sub-section:addMenu_ret|trigger=none|class=sIndent}[Menu]{sub-sectiondiv:class=sIndent}{code:language=javascript} // Note: method addMenu only works in the smart client. // when you don't define an index the menu will be added at the last // positon of the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); // set the text of the menu menu.text = "add menu"; // set the mnemonic key menu.setMnemonic("a"); // add another menu at a specific position in the menubar var another_menu = menubar.addMenu(2); another_menu.text = "another menu"; another_menu.setMnemonic("t") // REMARK: normally you would add menu items, checkboxes etc in the same method // this example will show no menu items for now! // IMPORTANT: Working with menu's on developer and client can differ {code}{div}{td}{tr}{builder-showtr:permissionclass=editlastDetailRow}{tr:id=seetd}{td}*Also see*\\{sub-section:addMenu_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:addMenu_see|trigger=none}{sub-section}{div}{{tr}{tbody}{tbody:id=addMenu-Number}{tr:id=name}{td}h6.addMenu{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linksig}{td}*External links*\\{sub-section:addMenu_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:addMenu_link|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}[Menu]{span}{span:style=font-weight: bold;}addMenu{span}{span}\(index){span}{td}{tr}{builder-show}{tr:id=samprs}{td}*SampleParameters*\\{sub-section:addMenu_sam|trigger=button|text=}{sub-section}div:class=sIndent}\{[Number]} index {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}{sub-section:addMenu_sam|trigger=none}[Menu]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} // Note: method addMenu only works in the smart client. // when you don't define an index the menu will be added at the last // positon of the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); // set the text of the menu menu.text = "add menu"; // set the mnemonic key menu.setMnemonic("a"); // add another menu at a specific position in the menubar var another_menu = menubar.addMenu(2); another_menu.text = "another menu"; another_menu.setMnemonic("t") // REMARK: normally you would add menu items, checkboxes etc in the same method // this example will show no menu items for now! // IMPORTANT: Working with menu's on developer and client can differ {code}{sub-sectiondiv}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenugetMenu-Number|class=node}{tr:id=name}{td}h6.addMenugetMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenugetMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:addMenu-Number_des|trigger=button|text=}{sub-section}{sub-section:addMenu-Number_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Number]} index {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Menu]{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:addMenu-Number_snc|trigger=button|text=}{sub-section}{sub-section:addMenu-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu-Number_prs|trigger=button|text=}{sub-section}{sub-section:addMenu-Number_prs|trigger=none|class=sIndent}\{[Number]} index {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu-Number_ret|trigger=button|text=}{sub-section}{sub-section:addMenu-Number_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenu-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenu-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenu-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_sam|trigger=none}{code:language=javascript} // Note: method addMenudiv:class=sIndent}{code:language=javascript} // Note: method getMenu only works in the smart client. var menubar = plugins.window.getMenuBar(); // get the menu at index 2 // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = menubar.getMenu(2); // set the text of the menu at the chose position menu.text = "get menu"; // set the mnemonic key menu.setMnemonic("g"); // disable the menu menu.setEnabled(false); // REMARK: we actually changed an original menu! As a result resetting the // menubar will NOT reset the above changes. We need to reset the menu // manually the following way: // get the menu //var menu = menubar.getMenu(2); // reset the values to default // notice we use an i18n message here the same way you would use it with // standard Servoy methods and plugins //menu.text = "i18n:servoy.menuitem.showAll"; //menu.setEnabled(true); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenuCount}{tr:id=name}{td}h6.getMenuCount{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getMenuCount{span}{span}\(){span}{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} // Note: method getMenuCount only works in the smart client. // whenadd youa don'tnew definemenu anbefore indexthe thelast menu willvar bemenubar added at the last // positon of the menubar var menubar = plugins.window.getMenuBar= plugins.window.getMenuBar(); var count = menubar.getMenuCount(); var menu = menubar.addMenu(count-1); // set the text of the menu menu.text = "add'new menu"; // set the mnemonic key menu.setMnemonic("a"); // add another menu at a specific position in the menubar var another_menu = menubar.addMenu(2); another_menu.text = "another menu"; another_menu.setMnemonic("t") // REMARK: normally you would add menu items, checkboxes etc in the same method // this example will show no menu items for now! // IMPORTANT: Working with menu's on developer and client can differ {code}{sub-section}{div}{'; {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenuIndexByText-String}{tr:id=name}{td}h6.getMenuIndexByText{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getMenuIndexByText{span}{span}\(name){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name {div}{td}{tr}{tr:classid=lastDetailRowret}{td}{td}{tr}{tbody}{tbody:id=getMenu-Number|class=node}{tr:id=name}{td}h6.getMenu*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sigsam}{td}*Sample*\\{spandiv:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getMenu-Number_des|trigger=button|text=}{sub-section}{sub-section:getMenu-Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getMenu-Number_snc|trigger=button|text=}{sub-section}{sub-section:getMenu-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getMenu-Number_prs|trigger=button|text=}{sub-section}{sub-section:getMenu-Number_prs|trigger=none|class=sIndent}\{[Number]} index {sub-section}{class=sIndent}{code:language=javascript} // Note: method getMenuIndexByText only works in the smart client. var menubar = plugins.window.getMenuBar(); // find the index of the View menu var idx = menubar.getMenuIndexByText("View"); // add a menu before the View menu var menu = menubar.addMenu(idx); menu.text = "new menu"; {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeAllMenus}{tr:id=name}{td}h6.removeAllMenus{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}removeAllMenus{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getMenu-Number_ret|trigger=button|text=}{sub-section}{sub-section:getMenu-Number_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=editdiv:class=sIndent}void{div}{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:getMenu-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenu-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getMenu-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenu-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-showcode:language=javascript} // Note: method removeAllMenus only works in the smart client. // Potentially dangerous because all accelerator (short) keys // will be deleted also (including the quit item) var menubar = plugins.window.getMenuBar(); menubar.removeAllMenus(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeMenu-ObjectArray}{tr:id=name}{td}h6.removeMenu{td}{tr}{tr:id=samsig}{td}*Sample*\\{sub-section:getMenu-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenu-Number_sam|trigger=none}{code:language=javascript} // Note: method getMenu only works in the smart client. var menubar = plugins.window.getMenuBar(); // get the menu at index 2 // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = menubar.getMenu(2); // set the text of the menu at the chose position menu.text = "get menu"; // set the mnemonic key menu.setMnemonic("g"); // disable the menu menu.setEnabled(false); // REMARK: we actually changed an original menu! As a result resetting the // menubar will NOT reset the above changes. We need to reset the menu // manually the following way: // get the menu //var menu = menubar.getMenu(2); // reset the values to default // notice we use an i18n message here the same way you would use it with // standard Servoy methods and plugins //menu.text = "i18n:servoy.menuitem.showAll"; //menu.setEnabled(true); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenuCount|class=node}{tr:id=name}{td}h6.getMenuCount{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenuCount{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getMenuCount_des|trigger=button|text=}{sub-section}{sub-section:getMenuCount_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getMenuCount_snc|trigger=button|text=}{sub-section}{sub-section:getMenuCount_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getMenuCount_prs|trigger=button|text=}{sub-section}{sub-section:getMenuCount_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getMenuCount_ret|trigger=button|text=}{sub-section}{sub-section:getMenuCount_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getMenuCount_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuCount_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getMenuCount_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuCount_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getMenuCount_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuCount_sam|trigger=none}{code:language=javascript} // Note: method getMenuCount only works in the smart client. // add a new menu before the last menu var menubar = plugins.window.getMenuBar(); var count = menubar.getMenuCount(); var menu = menubar.addMenu(count-1); menu.text = 'new menu'; {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenuIndexByText-String|class=node}{tr:id=name}{td}h6.getMenuIndexByText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenuIndexByText{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getMenuIndexByText-String_des|trigger=button|text=}{sub-section}{sub-section:getMenuIndexByText-String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getMenuIndexByText-String_snc|trigger=button|text=}{sub-section}{sub-section:getMenuIndexByText-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getMenuIndexByText-String_prs|trigger=button|text=}{sub-section}{sub-section:getMenuIndexByText-String_prs|trigger=none|class=sIndent}\{[String]} name {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getMenuIndexByText-String_ret|trigger=button|text=}{sub-section}{sub-section:getMenuIndexByText-String_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getMenuIndexByText-String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuIndexByText-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getMenuIndexByText-String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuIndexByText-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getMenuIndexByText-String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getMenuIndexByText-String_sam|trigger=none}{code:language=javascript} // Note: method getMenuIndexByText only works in the smart client. var menubar = plugins.window.getMenuBar(); // find the index of the View menu var idx = menubar.getMenuIndexByText("View"); // add a menu before the View menu var menu = menubar.addMenu(idx); menu.text = "new menu"; {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeAllMenus|class=node}{tr:id=name}{td}h6.removeAllMenus{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeAllMenus{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:removeAllMenus_des|trigger=button|text=}{sub-section}{sub-section:removeAllMenus_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeAllMenus_snc|trigger=button|text=}{sub-section}{sub-section:removeAllMenus_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:removeAllMenus_prs|trigger=button|text=}{sub-section}{sub-section:removeAllMenus_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:removeAllMenus_ret|trigger=button|text=}{sub-section}{sub-section:removeAllMenus_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeAllMenus_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeAllMenus_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeAllMenus_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeAllMenus_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeAllMenus_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeAllMenus_sam|trigger=none}{code:language=javascript} // Note: method removeAllMenus only works in the smart client. // Potentially dangerous because all accelerator (short) keys // will be deleted also (including the quit item) var menubar = plugins.window.getMenuBar(); menubar.removeAllMenus(); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeMenu-ObjectArray|class=node}{tr:id=name}{td}h6.removeMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:removeMenu-ObjectArray_des|trigger=button|text=}{sub-section}{sub-section:removeMenu-ObjectArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeMenu-ObjectArray_snc|trigger=button|text=}{sub-section}{sub-section:removeMenu-ObjectArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:removeMenu-ObjectArray_prs|trigger=button|text=}{sub-section}{sub-section:removeMenu-ObjectArray_prs|trigger=none|class=sIndent}\{[Object]\[]} index -- array of one or more indexes corresponding to menus to remove {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:removeMenu-ObjectArray_ret|trigger=button|text=}{sub-section}{sub-section:removeMenu-ObjectArray_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeMenu-ObjectArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeMenu-ObjectArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeMenu-ObjectArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeMenu-ObjectArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeMenu-ObjectArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:removeMenu-ObjectArray_sam|trigger=none}{code:language=javascript} // Note: method removeMenu only works in the smart client. var menubar = plugins.window.getMenuBar(); // To remove the last menu in the menubar we count the number of menu's in the menubar // because the index starts at 0 we have to substract 1 from the counted menu's // to actually remove the last menu from the menubar var index = menubar.getMenuCount() - 1; menubar.removeMenu(index); // To remove the last 3 (three) menu's from the menubar we // can do that by adding additional indexes to the method // and delimit them with a comma. index = menubar.getMenuCount() - 1; menubar.removeMenu(index, index-1, index-2); // For 'security' reasons it is best to ALWAYS remove the menu with the last index // first to avoid index out of range issues and other issues // EXAMPLE: when you first remove the menu at index 2 and then the menu at index 4 // you actually remove the menu at index 2 and index 5 // after removing the menu at index 2 all other menu's moved one index to the left // so the menu at index 4 moved to index 3 and the menu at index 5 moved to index 4 etc. {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=reset|class=node}{tr:id=name}{td}h6.reset{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}reset{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:reset_des|trigger=button|text=}{sub-section}{sub-section:reset_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:reset_snc|trigger=button|text=}{sub-section}{sub-section:reset_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:reset_prs|trigger=button|text=}{sub-section}{sub-section:reset_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:reset_ret|trigger=button|text=}{sub-section}{sub-section:reset_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:reset_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:reset_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:reset_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:reset_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:reset_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:reset_sam|trigger=none}{code:language=javascript} // Note: method removeMenu only works in the smart client. // When the menubar settings are solution specific it is advised to reset // the bar to its default settings when closing the solution. // Another reason is that when a client/developer is started first the // plugin will save the current settings in memory. // REMARK: Don't manipulate standard Servoy menuitems but remove // them and create new ones! Due to the way menuitems are managed by java it is not // possible to reset a menuitem anymore. var menubar = plugins.window.getMenuBar(); // add a menu var menu = menubar.addMenu(); menu.text = "new menu"; // reset the menubar, the newly added menu will dissapear menubar.reset(); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setVisible-Boolean|class=node}{tr:id=name}{td}h6.setVisible{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setVisible{span}{span:id=iets|style=float: left;}\(visible){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:setVisible-Boolean_des|trigger=button|text=}{sub-section}{sub-section:setVisible-Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setVisible-Boolean_snc|trigger=button|text=}{sub-section}{sub-section:setVisible-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setVisible-Boolean_prs|trigger=button|text=}{sub-section}{sub-section:setVisible-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} visible {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setVisible-Boolean_ret|trigger=button|text=}{sub-section}{sub-section:setVisible-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setVisible-Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setVisible-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setVisible-Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setVisible-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}removeMenu{span}{span}\(index){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]\[]} index -- array of one or more indexes corresponding to menus to remove {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} // Note: method removeMenu only works in the smart client. var menubar = plugins.window.getMenuBar(); // To remove the last menu in the menubar we count the number of menu's in the menubar // because the index starts at 0 we have to substract 1 from the counted menu's // to actually remove the last menu from the menubar var index = menubar.getMenuCount() - 1; menubar.removeMenu(index); // To remove the last 3 (three) menu's from the menubar we // can do that by adding additional indexes to the method // and delimit them with a comma. index = menubar.getMenuCount() - 1; menubar.removeMenu(index, index-1, index-2); // For 'security' reasons it is best to ALWAYS remove the menu with the last index // first to avoid index out of range issues and other issues // EXAMPLE: when you first remove the menu at index 2 and then the menu at index 4 // you actually remove the menu at index 2 and index 5 // after removing the menu at index 2 all other menu's moved one index to the left // so the menu at index 4 moved to index 3 and the menu at index 5 moved to index 4 etc. {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=reset}{tr:id=name}{td}h6.reset{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}reset{span}{span}\(){span}{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} // Note: method removeMenu only works in the smart client. // When the menubar settings are solution specific it is advised to reset // the bar to its default settings when closing the solution. // Another reason is that when a client/developer is started first the // plugin will save the current settings in memory. // REMARK: Don't manipulate standard Servoy menuitems but remove // them and create new ones! Due to the way menuitems are managed by java it is not // possible to reset a menuitem anymore. var menubar = plugins.window.getMenuBar(); // add a menu var menu = menubar.addMenu(); menu.text = "new menu"; // reset the menubar, the newly added menu will dissapear menubar.reset(); {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;}void{span}{span:style=font-weight: bold;}setVisible{span}{span}\(visible){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Boolean]} visible {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{sub-section:setVisible-Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setVisible-Boolean_sam|trigger=none}{code:language=javascript} // Note: method setVisible only works in the smart client. // hide the menu bar var menubar = plugins.window.getMenuBar(); menubar.setVisible(false); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |
Overview
Content Tools
Activity