summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2014-03-21 12:56:32 -0400
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2014-03-21 16:41:36 -0400
commitac20c37d7000deade10661d9cf71bb1437acbce6 (patch)
tree2ca9300c588fffa0a0ae649af5386c1eaee268a6
parentd280486d4b376f9a26426cebf79424906b1e1062 (diff)
downloadorg.eclipse.orion.client-origin/R5.0_maintenance.zip
org.eclipse.orion.client-origin/R5.0_maintenance.tar.gz
org.eclipse.orion.client-origin/R5.0_maintenance.tar.bz2
Bug 430891 - Allow deploy and deploy as buttons to be removed if project not configured for deployingorigin/R5.0_maintenance
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
index 8e555c5..f7d0041 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
@@ -270,10 +270,12 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm
});
},
visibleWhen: function(items) {
+ if (!(command.showCommand == undefined || command.showCommand)) return false;
var item = forceSingleItem(items);
return(item.Project === treeRoot.Project);
}
});
+ deployLaunchConfigurationCommands.isLaunchCommand = true;
commandService.addCommand(deployLaunchConfigurationCommands);
})(launchConfigurations[i]);
}
@@ -600,6 +602,25 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm
return commands;
};
+ /**
+ * Gets any launch project commands in the given <code>commandRegistry</code>. If {@link #createProjectCommands}, has not been called,
+ * this returns an empty array.
+ * @name orion.projectCommands.getLaunchProjectCommands
+ * @function
+ * @param {orion.commandregistry.CommandRegistry} commandRegistry The command registry to consult.
+ * @returns {orion.commands.Command[]} All the launch project commands added to the given <code>commandRegistry</code>.
+ */
+ projectCommandUtils.getLaunchProjectCommands = function(commandRegistry) {
+ var commands = [];
+ for (var commandId in commandRegistry._commandList) {
+ var command = commandRegistry._commandList[commandId];
+ if (command.isLaunchProject) {
+ commands.push(command);
+ }
+ }
+ return commands;
+ };
+
var explorer;
projectCommandUtils.setExplorer = function(theExplorer) {
explorer = theExplorer;
@@ -1062,6 +1083,7 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm
projectCommandUtils.createDependencyCommands(serviceRegistry, commandService, fileClient, projectClient, dependencyTypes);
function createDeployProjectCommand(deployService){
+ var command;
var commandParams = {
name: deployService.name,
tootlip: deployService.tooltip,
@@ -1098,6 +1120,7 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm
},
visibleWhen: function(item) {
+ if (!(command.showCommand == undefined || command.showCommand)) return false;
item = explorer.treeRoot;
if(!item.Project || !item.children || item.children.length === 0){
return false;
@@ -1108,7 +1131,7 @@ define(['i18n!orion/navigate/nls/messages', 'orion/webui/littlelib', 'orion/comm
commandParams.parameters = getCommandParameters(deployService.parameters, deployService.optionalParameters);
- var command = new mCommands.Command(commandParams);
+ command = new mCommands.Command(commandParams);
command.isDeployProject = true;
commandService.addCommand(command);
}