Docs
ServoyCloudSupportSamplesOpen SourceCommunity
  • Home
  • GUIDES
    • Platform Overview
    • Get Servoy
    • Get Started
      • Chapter 0
      • Chapter 1
      • Chapter 2
      • Chapter 3
      • Chapter 4
      • Chapter 5
    • Get Help
      • SuLA Instructions
      • SuLA Terms
    • Develop
      • Application Design
        • Forms
          • Layout Management
            • Simple Layout
            • Fully Responsive
              • Bootstrap 12-Grid
              • Flexbox
              • Custom Div
              • Collapsible Container
              • Simple Collapsible
              • Center Container
              • Inline Group Container
            • Abstract Form
          • Form Containers
            • Form Container
            • Tab Panel
            • Split Pane
            • Collapse
            • Accordion Panel
            • Form Component
            • List Form Component
          • Form Inheritance
          • Form Components
        • UI Components
          • Buttons and Text
            • Badge
            • Button
            • Data Label
            • Dropdown
            • Image
            • Label
          • Grids
            • Data Grid
            • Power Grid
            • Table
          • Input Controls
            • Calendar
            • Calendar Inline
            • Checkbox
            • Choice Group
            • Combobox
            • Group Buttons
            • Html Area
            • Input Group
            • Rating
            • Slider
            • Switch
            • Spinner
            • TextArea
            • Textbox
            • TextBoxGroup
            • Type Ahead
            • select2tokenizer
          • Media
            • Carousel
            • Embedded YouTube
            • File upload
            • Image label
            • Lightbox Gallery
            • MultiFile Upload
            • PDF JS Viewer
            • PDF Viewer
          • Mobile
            • Native Data List
            • Native Select
          • Navigation
            • Breadcrumbs
            • Navbar
            • sidenav
          • Visualization
            • DBTreeview
            • Progress Bar
            • Treeview
            • ChartJS
              • Data Labels Plugin
              • Funnel Chart
              • OutLabels Plugin
              • TreeMap
          • Specialized Components
            • Smart Document Editor
            • Servoy PDF Viewer
            • Fullcalendar Component
              • Fullcalendar
              • Fullcalendar Events
              • Migrating calendar from Smart and Web client to NG client
            • Fullcalendar Component 2
            • Canvas
            • Google Charts
            • Google Maps
            • svySignature
            • svywebcam
        • Styling and Themes
          • Default Theme Properties
          • CSS / LESS
          • Component Variants
          • Font Icons
        • Data Modeling
          • Databases
            • Tables
              • Columns
              • Calculations
              • Aggregations
              • Methods
              • Events / Triggers
              • Table security
            • Views
            • Procedures
          • Relations
          • Value Lists
          • Menus
          • In-Memory Databases
          • View Datasource
        • Modular Design
      • Programming Guide
        • Scripting the UI
          • Scripting Forms
          • Interacting with Components
          • Navigation
          • Windows, Dialogs and Popups
          • Events Manager
        • Working with Data
          • Concepts
          • Loading
          • Sorting
          • Iterating
          • Searching
            • Find mode
            • Query Builder
            • SQL String
          • Filtering
          • Editing
          • Validation
        • Automation and Scheduling
          • Batch Processor
          • Headless API
          • Scheduler API
        • Creating REST APIs
        • Consuming Webservices
        • Working with Files
          • File Plugin Basics
          • Images
          • Excel
          • PDF
          • JSON
        • Browser Utilities
          • Notifications
            • Web Notifications (Toastr)
            • Web Notifications (Native)
            • Block UI
          • Session Management
          • Keyboard Utilities
          • NG Utils
        • Sending and Receiving Email
        • Servoy Jasper Reports
          • Input Type
          • Display Mode
          • Output format
          • Jaspe Reports Viewer
        • Extensions
          • Modules
            • svyPhonegap
              • First Use Guide
              • Barcode Scanner
              • Browser
              • Camera
              • File
              • Fingerprint
              • Location
              • Network Interface
              • Phonegap
              • Printer
              • Push Notifications
            • svyAPI
              • Getting Started
            • svyLookup
              • Custom Templates
              • API Documentation
              • svyLookup v1
                • API Documentation v1.0.0
                • Base Form svyLookupTable v1.0.0
                • Base Form AbstractLookup v1.0.0
            • svyNavigation
              • API Documentation
                • API svyNavigation
                • API svyNavigationHistory
                • API svyNavigationUX
            • svyPopupFilter
              • Simple Filter Pickers
              • Custom Templates
              • API Documentation
                • API svyToolbarFilter
                • API svyPopupFilter
              • API Documentation v1
                • API svyToolbarFilter v1
                • API svyPopupFilter v1
            • svySearch
            • svySecurity
              • Overview
              • Token-based Auth and SSO (NEW!)
              • API Documentation
              • Getting Started
              • Tenant replication
              • Security Management Console
                • Classic Security Management Console
              • svySecurityUX
              • svyProperties
              • API Doc svyProperties
            • svyUtils
              • Log Manager
              • Log Manager Appenders
              • Smart Doc Editor Utils
              • Custom Dialogs
              • Excel Utils
                • Full API Reference
              • Crypto Utils
      • Security
        • Authentication
        • Permissions
          • UI Permissions
          • Data Permissions
          • Runtime Permissions
        • Audit Logging
        • OAuth
        • JWT
      • Multi-Language Support
      • Mobile Development
        • Getting Started
        • Mobile Design
        • Native Mobile Integrations
        • Building a Native Binary for the App Store
      • Native Desktop Development
        • NGDesktop UI plugin
        • NGDesktop Utils
        • NGDesktop File Plugin
    • Deploy
      • WAR Deployment
      • Docker Deployment
      • Server Configuration
        • Server Settings
        • Server Plugins
        • Database Servers
          • Locks
          • Transactions
          • Oracle
          • SQLServer
        • Client Sessions
        • Batch Processors
        • License Management
        • Monitoring
          • Server Log
          • Browser Console Log
          • Websocket Log
          • Query Performance
          • Client Performance
          • Client Event Tracing
          • Monitoring Servoy with JMX
      • NGClient deployment
      • Troubleshooting
      • Other Topics
        • Security: Cross-site Scripting
        • Running in an iFrame
    • Extend
    • Contribute
  • Reference
    • Servoy Core
      • Object Model
        • Database Server
          • Table
            • Column
            • Calculation
            • Method
            • Aggregation
          • View
          • Procedure
        • Solution
          • Form
          • Form Component
          • Relation
          • Relation Item
          • Table Node
          • Value List
          • Menu
          • Menu item
          • In-Memory Data Source
          • View Foundset Data Source
          • Variable
          • Column Info
          • Media
          • Layout Container
          • Method
        • i18n Message Key
      • Developer API
        • Globals
        • Forms
          • RuntimeForm
            • controller
            • containers
              • RuntimeContainer
            • elements
              • Component
              • RuntimeAccordionPanel
              • RuntimeBean
              • RuntimeButton
              • RuntimeCalendar
              • RuntimeCheck
              • RuntimeCombobox
              • RuntimeComponent
              • RuntimeDataButton
              • RuntimeDataLabel
              • RuntimeGroup
              • RuntimeHtmlArea
              • RuntimeImageMedia
              • RuntimeInsetList
              • RuntimeLabel
              • RuntimeListBox
              • RuntimePassword
              • RuntimePortal
              • RuntimeRadio
              • RuntimeChecks
              • RuntimeRadios
              • RuntimeRectangle
              • RuntimeRtfArea
              • RuntimeSpinner
              • RuntimeSplitPane
              • RuntimeTabPanel
              • RuntimeTextArea
              • RuntimeTextField
              • RuntimeWebComponent
        • JS Lib
          • Array
          • BigInt
          • Boolean
          • Date
          • Function
          • IterableValue
          • Iterator
          • JSON
          • Map
          • Set
          • Math
          • Namespace
          • Number
          • Object
          • Promise
          • QName
          • RegExp
          • Special Operators
          • Statements
          • String
          • XML
          • XMLList
        • Application
          • APPLICATION_TYPES
          • CLIENTDESIGN
          • DRAGNDROP
          • ELEMENT_TYPES
          • LOGGINGLEVEL
          • NGCONSTANTS
          • UICONSTANTS
          • CSSPosition
          • JSDimension
          • JSDNDEvent
          • JSEvent
          • JSLogger
          • JSLogBuilder
          • JSPoint
          • JSUpload
          • JSWindow
          • JSBounds
          • Renderable
          • UUID
        • SolutionModel
          • ALIGNMENT
          • ANCHOR
          • BEVELTYPE
          • CURSOR
          • DEFAULTS
          • FONTSTYLE
          • MEDIAOPTION
          • PAGEORIENTATION
          • PRINTSLIDING
          • SCROLLBAR
          • TITLEJUSTIFICATION
          • TITLEPOSITION
          • UNITS
          • JSBean
          • JSButton
          • JSCalculation
          • JSComponent
          • JSDataSourceNode
          • JSField
          • JSForm
          • JSLabel
          • JSMedia
          • JSMethod
          • JSPart
          • JSPortal
          • JSRelation
          • JSRelationItem
          • JSStyle
          • JSTab
          • JSTabPanel
          • JSValueList
          • JSVariable
          • JSTitle
          • JSChecks
          • JSCombobox
          • JSHeader
          • JSInsetList
          • JSList
          • JSPassword
          • JSRadios
          • JSText
          • JSTextArea
          • JSWebComponent
          • JSLayoutContainer
        • Database Manager
          • QUERY_COLUMN_TYPES
          • SQL_ACTION_TYPES
          • JSColumn
          • JSDataSet
          • JSBaseRecord
          • JSBaseSqlRecord
          • JSBaseFoundset
          • JSBaseSQLFoundset
          • JSFoundSet
          • JSFoundSetUpdater
          • JSRecord
          • JSRecordMarker
          • JSRecordMarkers
          • JSTable
          • JSTableFilter
          • MenuFoundSet
          • MenuItemRecord
          • QBAggregate
          • QBAggregates
          • QBCase
          • QBCaseWhen
          • QBColumn
          • QBColumns
          • QBCondition
          • QBFunction
          • QBFunctions
          • QBGroupBy
          • QBJoin
          • QBJoins
          • QBLogicalCondition
          • QBParameter
          • QBParameters
          • QBPart
          • QBResult
          • QBSearchedCaseExpression
          • QBSelect
          • QBSort
          • QBSorts
          • QBTableClause
          • QBWhereCondition
          • ViewFoundSet
          • ViewRecord
        • Events Manager
          • EVENTS_AGGREGATION_TYPES
          • EventType
        • Menus
          • JSMenu
          • JSMenuItem
        • JSMenuDatasource
        • Utils
        • Client Utils
          • JSBlobLoaderBuilder
        • History
        • Security
        • i18n
        • ServoyException
          • DataException
        • JSUnit
        • Datasources
          • DBDataSource
          • DBDataSourceServer
          • JSConnectionDefinition
          • JSDataSource
          • MemDataSource
          • MenuDataSource
          • SPDataSource
          • SPDataSourceServer
          • ViewDataSource
        • JSViewDatasource
        • servoyDeveloper
        • enum
    • Extensions
      • UI Components
        • Buttons and Text
          • Badge
          • Button
          • Data Label
          • Drop Down
          • Image
          • Label
        • Form Containers
          • Accordion Panel
          • Collapse
          • Form Container
          • Form Component Container
          • List Form Component
          • Default Loading Indicator
          • Error Bean
          • Portal
          • Responsive Container
          • Servoy Default Navigator
          • Slider
          • Split Pane
          • TabPanel
        • Grids
          • Data Grid
          • Power Grid
          • Table
        • Input Controls
          • Calendar
          • Calendar Inline
          • Checkbox
          • Choice Group
          • Combobox
          • Floatinglabel Calendar
          • Floatinglabel Combobox
          • Floatinglabel Textarea
          • Floatinglabel Textbox
          • Floatinglabel Type Ahead
          • Group Buttons
          • Html Area
          • Input Group
          • Rating
          • Select2tokenizer
          • Slider
          • Spinner
          • Switch
          • TextArea
          • TextBox
          • TextBox Group
          • Type Ahead
        • Media
          • Carousel
          • Embedded YouTube
          • File upload
          • Image label
          • Lightbox Gallery
          • MultiFile Upload
          • PDF JS Viewer
          • PDF Viewer
        • Mobile
          • Native Data List
          • Native Select
        • Navigation
          • Breadcrumbs
          • Navbar
          • sidenav
        • SmartDocEditor
          • Smart Document Editor
        • Visualization
          • Canvas
          • Chart
          • Custom List
          • DBTreeview
          • Foundset List
          • Fullcalendar
          • Gauge
          • Google Maps
          • Kanban
          • Progress Bar
          • Treeview
      • Server Plugins
        • amortization
          • AmortizationCalculation
          • Polynomial
        • clientmanager
          • Broadcaster
          • JSClientInformation (cm)
        • excelxport
        • file
          • JSFile
          • JSProgressMonitor
        • headlessclient
          • JSClient
        • http
          • HTTP_STATUS
          • Cookie
          • DeleteRequest
          • GetRequest
          • HeadRequest
          • HttpClient
          • HttpClientConfig
          • OptionsRequest
          • PostRequest
          • PutRequest
          • Response
          • TraceRequest
          • PatchRequest
          • JSFileUpload
        • images
          • JSImage
        • jwt
          • Algorithm
          • Builder
          • JWTClaims
        • mail
          • Attachment
          • MailMessage
        • maintenance
          • JSClientInformation
          • JSColumnObject
          • JSServer
          • JSTableObject
        • mobileservice
          • OfflineDataDescription
        • oauth
          • ClientAuthentication
          • CustomApiBuilder
          • OAuthProviders
          • OAuthRequest
          • OAuthResponse
          • OAuthResponseBinary
          • OAuthResponseJSON
          • OAuthResponseText
          • OAuthService
          • OAuthServiceBuilder
          • OAuthTokenExtractors
          • RequestType
        • pdf_output
        • rawSQL
        • RestWs plugin
        • rest_ws
          • WsContents
          • WsCookie
          • WsRequest
          • WsResponse
        • scheduler
        • serialize
        • textxport
          • DataProviderExport
          • TabExporter
        • udp
          • JSPacket
        • XmlReader
          • XmlNode
      • Browser Plugins
        • Block UI
        • Block UI (ref)
        • Dialogs Plugin
        • Idle
        • Idle (ref)
        • Key Listener
        • Key Listener (ref)
        • NGDesktop File
        • NGDesktop File (ref)
        • NGDesktop UI (ref)
        • NGDesktop Utils (ref)
        • NG Utils (ref)
        • Office Javascript API for Servoy
        • Phonegap
        • Web Notifications (Native)
        • Web Notifications (Toastr)
        • Window Plugin
        • Font Awesome
      • Modules
        • Smart Doc Editor Utils
        • svyAPI
          • Getting Started
        • svyLookup
          • Custom Templates
          • API Documentation
          • svyLookup v1
            • API Documentation v1.0.0
            • Base Form svyLookupTable v1.0.0
            • Base Form AbstractLookup v1.0.0
        • svyLookupExample
        • svyNavigation
          • API Documentation
            • API svyNavigation
            • API svyNavigationHistory
            • API svyNavigationUX
        • svyNavigationUX
        • svyNavigationUXSample
        • svyPopupFilter
          • Simple Filter Pickers
          • Custom Templates
          • API Documentation
            • API svyToolbarFilter
            • API svyPopupFilter
          • API Documentation v1
            • API svyToolbarFilter v1
            • API svyPopupFilter v1
        • svyProperties
        • svySearch
        • svySecurity
          • Overview
          • Token-based Auth and SSO (NEW!)
          • API Documentation
          • Getting Started
          • Tenant replication
          • Security Management Console
            • Classic Security Management Console
          • svySecurityUX
          • svyProperties
          • API Doc svyProperties
        • svySecurityConsole
        • svySecurityUX
        • svyUtils
          • Log Manager
          • Log Manager Appenders
          • Smart Doc Editor Utils
          • Custom Dialogs
          • Excel Utils
          • Full API Reference
          • Crypto Utils
        • svyUtils$Excel
        • svyUtils$NGClient
        • svyUtils$customDialogs
        • svyUtils$logManagerAppenders
        • svyUtils$tableGrid
      • Layout
        • Boostrap 12grid layout
          • Collapsible Container
          • Simple Collapsible
          • Center Container
          • Inline Group Container
          • Flexbox Layout
      • Solutions
        • Sample Application
          • Tutorial Part 1
          • Tutorial Part 2
      • Packages
        • UI Component Packages
          • Advanced Renderers
          • Bootstrap Components
          • Bootstrap Extra Components
          • Canvas
          • Chart JS
          • Fullcalendar Component
          • googlemaps
          • kanban
          • Servoy Core
          • Servoy Extra Components
          • Servoy NG-Grids
          • Servoy PDF Viewer
          • smartDocumentEditor
        • Browser Plugin Packages
          • Block UI
          • Core NG only Services
          • Key Listener
          • NGDesktop File
          • NGDesktop UI
          • NGDesktop Utils
          • Web Notifications
          • Idle Web Service
    • Servoy Developer
      • Menu
        • File
        • Edit
        • Source
        • Refactor
        • Navigate
        • Search
        • Project
        • Actions
        • Run
        • Window
        • Help
      • Toolbar
      • Solution Explorer
        • Resources
          • Database Servers
            • Database Server
              • Procedures
              • Tables
              • Views
          • Security
          • i18n
        • All Solutions
          • Solution
          • Active Solution
            • Scopes
              • Scope
                • Variables
            • Forms
              • Working Set
              • Form
                • Controller
                • Variables
                • Elements
                • Relations
            • Form Components
              • Form Component
            • Relations
              • Relation
            • ValueLists
              • ValueList
            • Menus
              • Menu
                • MenuItem
            • Media
              • Folder
              • File
            • DataSources
              • In Memory DataSources
                • In Memory DataSource
              • View Foundsets DataSources
                • View Foundset DataSources
            • Servoy Packages
              • Package
            • Modules
              • Module
        • Solution Explorer Contextual List
      • Views
        • Command Console
        • Console
        • Problems
        • Tasks
        • Bookmarks
        • Search
        • Form Hierarchy
        • Help
        • JUnit
        • Outline
        • Profiler
        • Properties
        • Project Explorer
        • Call Hierarchy
      • Editors and Wizards
        • Property configurator for columns
        • Relation Editor
        • Text Format Editor
        • Date Format Editor
        • Number Format Editor
        • Database Synchronization Wizard
        • Security Editor
        • SQL Editor
        • i18n Editor
        • File Import Wizard
        • File Export Wizard
        • WAR Export Wizard
        • NGDesktop Export Wizard
        • Table Editor
        • Metadata Synchronization Wizard
        • Database Server Connection Editor
        • Text Property Editor
        • Valuelist Editor
        • Form Editor
          • Parts of the Form Editor
          • Designing a Form
          • Layout Tools
          • Using Containers
          • Creating and Using Forms
          • Using Servoy Beans
          • Using Shapes
          • Form Editor Subtabs
          • [Tips and Shortcuts][reference/servoy-developer/object-editors/form-editor-tips_and_shortcuts.md]
          • Editong a Responsive LayoutForm
          • CSS Positioning
        • Form Hierarchy
        • Component Properties Editor
        • Variable Editor
        • Method Selection Wizard
        • New Solution Wizard
        • Application Event Types Editor
        • New Form Wizard
        • Form Dataproviders Configurator
        • Servoy Resource Locator
        • Datasource Selection Wizard
        • Sorting Fields Wizard
        • Scripting Editor
          • Getting Started-Overview of Script Editor
          • Code Writing Features
          • Code Navigation
          • Code Rewriting Tools
          • Refactoring
          • Code Formatting
          • Script Editor Tips and Shortcuts
          • Unit Tests
        • Theme Editor
          • General Properties
          • Sidenav Properties
          • Navbar Properties
          • Tabs Properties
          • Windows Properties
          • Dialogs Properties
          • Tables Properties
          • Breadcrumb specific style Properties
          • Brand colors Properties
          • Validations Properties
          • Margins and Padding Properties
        • Editor Selection
        • Run Configurations
        • Debug Configurations
        • Externalize Strings Wizard
        • Font Chooser Wizard
        • Color Chooser Wizard
        • Project Properties Configurator
        • Move Wizard
        • External Tools Configurations
        • About Servoy Developer
        • Servoy Developer Installation Details
        • Eclipse Marketplace Wizard
        • Install Available Software Wizard
        • Cheat Sheet Selection Wizard
        • Servoy Developer Help Wizard
        • Switch to Editor Wizard
        • Find Actions Wizard
        • Customize Perspective Configurator
        • Quick Search Wizard
        • Search Wizard
        • Encoding Wizard
        • Task Wizard
        • Find - Replace Wizard
        • Properties Editor
        • New Project Wizard
        • New Method Wizard
        • New Menu Wizard
          • New MenuItem Wizard
        • Menu Editor
        • ServoyMenu Selection Wizard
        • JSMenu compatible component selector
        • Permissions Configuration Dialog
      • Project File Structure
        • Servoy Installation Directory
          • servoy.properties
        • Workspace Folder
          • Resources Directory
            • Database Information (.dbi) Files
          • Solution Folder
      • Package Manager
      • Preferences
      • Property Types for components / services
      • Debugger
        • Debug Explorer
        • Breakpoints
          • Breakpoint Properties
        • Variables
        • Expressions
        • Interactive Console
    • Application Server
    • Servoy Cloud
      • Cloud Control Center
        • Home
          • Setup Namespace
          • User profile
            • My Profile
            • Support
        • Download IDE
        • Application Overview
          • Applications
            • Pipelines
              • Jobs
                • Packages
                  • Commits
                  • Artifacts
                  • Configuration
                  • Quality reports
                  • Build markers
                • Job Configuration
                  • Build and Deploy or Build
                  • Mobile
                  • Desktop
            • Environments
              • Metrics
                • Users
                • Databases
                  • Metrics
                • System Health
                • Log Activity
                • App performance
                • Query performance
              • Cloud reporting
            • Security
              • Permissions
              • Tenants
            • Reports
            • Security Login Designer
              • Single Sign-On
                • Sign in with Google
                • Sign in with Microsoft
          • Code Repositories
        • Project Management
          • Tickets
          • Backlog
          • Active Sprints
        • User Management
          • Users
          • Roles
        • Administration
          • Security
            • ServoyCloud Roles
          • Credentials
          • Settings
        • Add-Ons
      • Database Backup
      • E2E Cypress Testing
        • Using Cypress
      • On-Premise Deployment
      • Privacy policy (ServoyAI)
      • FAQ
      • Migrate to Servoy Cloud
    • Extensions Developement
      • Component and Services
        • Component Development
        • Service Development
        • Tools and Dev Tips to use for Component/Service developement
        • Manifest (.mf file)
        • Specification (.spec file)
          • Property Types
            • Array property types
            • Custom object property types
            • Findmode property type
            • Foundset property type
            • Tags
        • Directives And Filters
          • Sablotabsequence
        • Console (serverside)
        • ServoyApi (serverside)
      • Serverside Plugins
        • Data Convertors and Validators
        • UI Convertors
  • Release notes
    • Release notes
      • 2025.03
      • 2024.03 (LTS)
      • 2023.03 (LTS)
      • 2025.03 (Servoy Cloud)
      • 2024.12
      • 2024.12 (Servoy Cloud)
      • 2024.09
      • 2024.09 (Servoy Cloud)
      • 2024.06
      • 2024.06 (Servoy Cloud)
      • 2024.03 (Servoy Cloud)
      • 2023.12
      • 2023.12 (Servoy Cloud)
      • 2023.09
      • 2023.09 (Servoy Cloud)
      • 2023.06
      • 2022.03 (LTS)
      • 2022.12 What's new
      • 2022.12
      • 2022.09 What's new
      • 2022.09
      • 2022.06 What's new
      • 2022.06
      • 2021.03.3 (LTS)
Powered by GitBook
On this page
  • Getting Started
  • Example Usage
  • API Documentation
  • Method Summary

Was this helpful?

  1. GUIDES
  2. Develop
  3. Native Desktop Development

NGDesktop UI plugin

PreviousNative Desktop DevelopmentNextNGDesktop Utils

Last updated 6 months ago

Was this helpful?

Welcome to the ngdesktopui wiki! This wiki provides comprehensive documentation to using the ngdesktopui web service. This service works with the NGDesktop Client as a bridge to execute client side calls dealing with UI from Servoy.

Getting Started

First import the service one of the release or via Servoy's Web Package Manager.

Example Usage

The following code snippet is create a sample menu for NGDesktop:

function createTestMenu(event) {

var isMac = application.getOSName().toUpperCase().indexOf('MAC')>=0;
var menu = plugins.ngdesktopui;
menu.removeAllMenus();
var ngdesktopIndex = menu.addMenu("Servoy NGDesktop"); //on MacOS this name is hidden
menu.addMenuItem(ngdesktopIndex,"About Servoy NGDesktop...",callback);
menu.addSeparator(ngdesktopIndex);
menu.addRoleItem(ngdesktopIndex,"services");
menu.addSeparator(ngdesktopIndex);
if (isMac) {
	menu.addRoleItem(ngdesktopIndex,"hide", "Hide this application");
	menu.addRoleItem(ngdesktopIndex,"hideOthers");
	menu.addSeparator(ngdesktopIndex);
}
menu.addRoleItem(ngdesktopIndex,"quit");

//add file menu
var fileIndex = menu.addMenu("File");
menu.addMenuItem(fileIndex,"New",callback);
menu.addMenuItem(fileIndex,"Open...",callback);

//insert menuitem example
//since this will be a submenu the callback is set to null
recentIndex = menu.addMenuItem(fileIndex,"Open recent", null, 1);
addRecentFiles(fileIndex, recentIndex);

//add edit menu
var editIndex = menu.addMenu("Edit");
menu.addRoleItem(editIndex,"undo");
menu.addRoleItem(editIndex,"redo");
menu.addSeparator(editIndex);
menu.addRoleItem(editIndex,"cut");
menu.addRoleItem(editIndex,"copy");
menu.addRoleItem(editIndex,"paste");

//add help menu
var helpIndex = menu.addMenu("Help");
menu.addMenuItem(helpIndex,"Search...",callback);
menu.addMenuItem(helpIndex,"Servoy NGDesktop help",callback)

}

function addRecentFiles(menuIndex, submenuIndex) {

var menu = plugins.ngdesktopui;
var position = menu.addMenuItem(menuIndex,"Bureau.pdf",callback, 0, submenuIndex);
position = menu.addMenuItem(menuIndex,"Advertising.pdf",callback, position + 1, submenuIndex);
position = menu.addSeparator(menuIndex,position + 1, submenuIndex);
position = menu.addRoleItem(menuIndex,"clearRecentDocuments", null, position + 1,submenuIndex);

}

The following issues has been discovered so far:

  • setMenuBarVisibility has no effect on MacOS. You can't hide a MacOS menu

  • removeAllMenus - for MacOS is display a minimal menu having the app name as Menu name and Quit option as menuItem

  • on macOS - the first menuName is always the app name: first addMenu(menuName) will not display the "menuName" but the app name. The name behind (which you will work with), still remain "menuName"

  • on MacOS - the checkboxes and radio buttons in menus are not correctly rendered. This seems to be a Chromium issue. Further investigation needed for this

  • When clicking on a radio button - it will be selected, and the previous radio buttons (from the adiacent radio items) will be deselected. However, calling multiple times addRadioButton(menuName, menuitemName, true) will add multiple selected radio buttons (they will unselect automatically when one radio button is selected). It is your responsability to call addRadioButton() with "selected" parameter set to true - only once. The same issue is true also for insertRadioButton

The following sample will create a custom tray menu for NG Desktop:

function createTrayMenu(event) {

var trayMenu = plugins.ngdesktopui.createTrayMenu();
trayMenu.title = NG Desktop'; //optional
trayMenu.tooltip = 'Testing tray menu'; //optional
trayMenu.icon = solutionModel.getMedia('tray_close.png').getBytes(); //optional
trayMenu.pressedIcon = solutionModel.getMedia('tray_open.png').getBytes();//optional

trayMenu.addMenuItem(0, 'Sys info', trayCallback);
trayMenu.addMenuItem(1, 'Maximise', trayCallback);
trayMenu.addMenuItem(2, 'Unmaximise', trayCallback);
trayMenu.addMenuItem(3, 'Home directory', trayCallback);
trayMenu.addSeparator(4);
trayMenu.addRoleItem(5, 'Quit');

trayMenu.done();

}

function trayCallback(itemName, itemType, itemStatus) {

switch (itemName ) {
	case 'Sys info':
		var sysInfo = plugins.ngdesktoputils.getSystemInformation();
		plugins.dialogs.showInfoDialog('System', 'Platform: ' + sysInfo.osPlatform + '     Version: ' + sysInfo.osRelease);
		break;
	case 'Maximise':
		plugins.ngdesktopui.maximizeWindow();
		break;
	case 'Unmaximise':
		plugins.ngdesktopui.unmaximizeWindow();
		break;
	case 'Home directory':
		plugins.dialogs.showInfoDialog('Home directory',plugins.ngdesktopfile.homeDir());
		break;
}

}

API Documentation

Callback function

The callback function is receiving the following parameters:

Params

Type
Name
Summary

string

text

clicked item name

string

type

clicked item type ("normal", "checkbox", "radio")

boolean

checked

check state (true or false for checkboxes, true for radio buttons and undefined for the other types)

Method Summary

addMenu

Add new menu to existing menubar

Params

Type
Name
Summary
Required

string

text

Menu label

Required

index

int

Insert position

Optional

removeMenu

Remove specified menu

Params

Type
Name
Summary
Required

index

int

Menu index (zero based)

Required

addDevToolsMenu

Add Developer Tools menu to the menu bar. Use it just for debugging. Remove any call to this function once you're done.

getMenuIndexByText

Return the index order of the menu (zero based index)

Params

Type
Name
Summary
Required

string

text

Menu label to query

Required

getMenuText

Return the menu label

Params

Type
Name
Summary
Required

int

index

Index to query

Required

getMenuCount

Count menus from the menubar

removeAllMenus

Cleanup the menubar. For Mac OS this means to display a minimal menu.

setMenuBarVisibility

Show/Hide menu bar. On MacOS this method has no effect

Params

Type
Name
Summary
Required

boolean

visibility

true - show menubar, false - hide menubar

Required

removeAllMenuItems

Cleanup the specified menu

Params

Type
Name
Summary
Required

int

index

Menu index to cleanup

Required

addSeparator

Add a separator line

Params

Type
Name
Summary
Required

int

index

Menu index

Required

int

position

Insert position

Optional

int

itemIndex

Submenu index

Optional

addMenuItem

Add an item to the specified menu

Params

Type
Name
Summary
Required

int

index

Menu index

Required

string

text

Menu label

Required

function

callback

Callback function

Required (may be null)

int

position

Insert position

Optional

int

itemIndex Submenu index

Optional

removeMenuItem

Delete an item

Params

Type
Name
Summary
Required

int

index

Menu index

Required

int

position

Insert position

Required

int

itemIndex Submenu index

Optional

getMenuItemsCount

Count items

Params

Type
Name
Summary
Required

int

index

Menu index

Required

int

itemIndex

Submenu index

Optional

addCheckBox

Add a checkbox to the specified menu

Params

Type
Name
Summary
Required

int

index

Menu index

Required

string

text

Menu label

Required

function

callback

Callback function

Required (may be null)

boolean

checked

initial checkbox status (default is false)

Optional

int

position

Insert position

Optional

int

itemIndex Submenu index

Optional

addRadioButton

Add a radio button to the specified menu. Note that the first added radio button in the group is alwasy selected regardless the 'selected' value There are no group creation method. A group consist from all adiacent radio buttons in a menu

Params

Type
Name
Summary
Required

int

index

Menu index

Required

string

text

Menu label

Required

function

callback

Callback function

Required (may be null)

boolean

selected

select radio button (default is false)

Optional

int

position

Insert position

Optional

int

itemIndex Submenu index

Optional

getMenuItemIndexByText

Get menuitem index from the specified menu

Params

Type
Name
Summary
Required

int

index

Menu index

Required

string

text

Item label to query for

Required

getMenuItemText

Get menuitem label

Params

Type
Name
Summary
Required

int

index

Menu index

Required

int

itemIndex

Menuitem index

Required

addRoleItem

Roles allow menu items to have predefined behaviors.

Params

Type
Name
Summary
Required

int

index

Menu index

Required

string

role

The item role (see below)

Required

string

text

The item label

Optional

int

position

Insert position

Optional

int

itemIndex

Submenu index

Optional

It is best to specify role for any menu item that matches a standard role, rather than trying to manually implement the behavior using a callback function. The built-in role behavior will give the best native experience.

The role property can have following values:

  • undo

  • about - Trigger a native about panel (custom message box on Window, which does not provide its own).

  • redo

  • cut

  • copy

  • paste

  • pasteAndMatchStyle

  • selectAll

  • delete

  • minimize - Minimize current window.

  • close - Close current window.

  • quit - Quit the application.

  • reload - Reload the current window.

  • forceReload - Reload the current window ignoring the cache.

  • toggleDevTools - Toggle developer tools in the current window.

  • togglefullscreen - Toggle full screen mode on the current window.

  • resetZoom - Reset the focused page's zoom level to the original size.

  • zoomIn - Zoom in the focused page by 10%.

  • zoomOut - Zoom out the focused page by 10%.

  • fileMenu - Whole default "File" menu (Close / Quit)

  • editMenu - Whole default "Edit" menu (Undo, Copy, etc.).

  • viewMenu - Whole default "View" menu (Reload, Toggle Developer Tools, etc.)

  • windowMenu - Whole default "Window" menu (Minimize, Zoom, etc.).

The following additional roles are available on macOS:

  • appMenu - Whole default "App" menu (About, Services, etc.)

  • hide - Map to the hide action.

  • hideOthers - Map to the hideOtherApplications action.

  • unhide - Map to the unhideAllApplications action.

  • startSpeaking - Map to the startSpeaking action.

  • stopSpeaking - Map to the stopSpeaking action.

  • front - Map to the arrangeInFront action.

  • zoom - Map to the performZoom action.

  • toggleTabBar - Map to the toggleTabBar action.

  • selectNextTab - Map to the selectNextTab action.

  • selectPreviousTab - Map to the selectPreviousTab action.

  • mergeAllWindows - Map to the mergeAllWindows action.

  • moveTabToNewWindow - Map to the moveTabToNewWindow action.

  • window - The submenu is a "Window" menu.

  • help - The submenu is a "Help" menu.

  • services - The submenu is a "Services" menu. This is only intended for use in the Application Menu and is not the same as the "Services" submenu used in context menus in macOS apps, which is not implemented in Electron.

  • recentDocuments - The submenu is an "Open Recent" menu.

  • clearRecentDocuments - Map to the clearRecentDocuments action.

createBrowserView

Creates a BrowserView (looks like an iframe) and adds this to the current window at the given coordinates with the given width and height. It returns and id that can be used to close/clean up this view later on, or to target that view to inject some javascript.

Params

Type
Name
Summary
Required

int

x

The X coordinate to position this view

Required

int

y

The Y coordinate to position this view

Required

int

width

The width of this view

Required

int

height

The height of this view

Required

string

url

The url to load into this view

Required

closeBrowserView

Closes a and destroys a previously created BrowserView by the given id.

Params

Type
Name
Summary
Required

int

id

The id of the view to close

Required

injectJSIntoBrowserView

Injects the given javascript into the content of the BrowserView of the given id. The javascript can be a function declaration that is then called later on. The last statement return value is given back to the callback as a first argument. If something goes wrong then the callback is called where the first argument is null and a second argument has the message of the exception.

Params

Type
Name
Summary
Required

int

id

The id of the view to execute javascript in

Required

string

js

The piece of javascript that is injected into this view

Required

function

callback

the callback function that is used to get the results or exception if the call fails

Required

createTrayMenu

Return a TrayMenu object type.

TrayMenu properties

Type | Name | Summary | Required string | title | tray menu title displayed next to the tray icon | Optional string | tooltip | just a tooptip | Optional byte[] | icon | icon to be displayed in the tray | Optional byte[] | pressedIcon | icon to be displayed when opening the tray (MacOS only) | Optional

TrayMenu api

This methods are available only through the TrayMenu object - trayMenu.method(params). The autocompletion is not yet available

Callback function

The callback function is receiving the following parameters:

Type
Name
Summary
Required

string

text

clicked item name

Required

string

type

clicked item type ("normal", "checkbox")

Required

boolean

checked

check state (true or false for checkboxes, false otherwise)

Required

addMenuItem

Add item to the tray menu

Type
Name
Summary
Required

int

index

zero based index where to add / insert items in tray menu

Required

string

text

menu item text

Required

function

callback

Callback function

Required

removeMenuItem

Type
Name
Summary
Required

int

index

zero based index of the item to be removed

Required

addCheckBox

Type
Name
Summary
Required

int

index

zero based index where to add / insert items in tray menu

Required

string

text

menu item text

Required

function

callback

Callback function

Required

boolean

checked

Initial status of the checkbox

Required

addSeparator

Params

Type
Name
Summary
Required

int

index

zero based index of the position where to add / insert the separator

Required

addRoleItem

Add a tray menu item with predefined (system) behavior. For details, check the documentation for the addRoleItem method above (for NG Desktop menu)

Params

Type
Name
Summary
Required

int

index

zero based index of the position where to add / insert role

Required

string

role

The item role (see above ethod with the same name)

Required

string

text

Role label

Optional

done

When all desired changes to the tray menu are finalized, call this method for the changes to takes effect.

Example Usage

// open google.com var id = plugins.ngdesktopui.createBrowserView(100,200,700,500,"https://www.google.com/"); // get the value of the search field and return this. plugins.ngdesktopui.injectJSIntoBrowserView(id, "function test() { return document.getElementsByName('q')[0].value};test();", callback);

binaries