META-INF.dirigible.template-extension-perspective.api.menu-perspective.js.template Maven / Gradle / Ivy
/*
* Copyright (c) 2018 SAP and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
* Contributors:
* SAP - initial API and implementation
*/
var extensions = require('extensions/extensions');
var response = require('http/response');
var mainmenu = [];
var menuExtensions = extensions.getExtensions('ide-{{fileName}}-menu');
for (var i=0; i < menuExtensions.length; i++) {
var module = menuExtensions[i];
menuExtension = require(module);
var menu = menuExtension.getMenu();
mainmenu.push(menu);
}
mainmenu.sort(function(p, n) {
return (parseInt(p.order) - parseInt(n.order));
});
response.println(JSON.stringify(mainmenu));
© 2015 - 2025 Weber Informatics LLC | Privacy Policy