: false;
}
@Override
public boolean performFinish() {
AddCommandDisplayPart part = page != null ? page.getCommandPart() : null;
if (part != null) {
editedCommand = new ServiceCommandManager(commands).createCommand(part.getDisplayName());
if (editedCommand != null) {
// External application location should never be null
ExternalApplication appInfo = new ExternalApplication();
appInfo.setExecutableNameAndPath(part.getExecutableLocation());
editedCommand.setExternalApplication(appInfo);
// Options and terminal may be optional
String optionsVal = part.getOptions();
if (optionsVal != null) {
optionsVal = optionsVal.trim();
}
if (optionsVal != null && optionsVal.length() > 0) {
CommandOptions options = new CommandOptions();
options.setOptions(optionsVal);
editedCommand.setOptions(options);
}
else {
editedCommand.setOptions(null);
}
String terminalLocationVal = part.getTerminal();
if (terminalLocationVal != null) {
terminalLocationVal = terminalLocationVal.trim();
}
if (terminalLocationVal != null && terminalLocationVal.length() > 0) {
CommandTerminal terminal = new CommandTerminal();
terminal.setTerminal(terminalLocationVal);
editedCommand.setCommandTerminal(terminal);
}
else {
editedCommand.setCommandTerminal(null);
}
List<EnvironmentVariable> envVars = part.getEnvironmentVariables();
if (envVars != null && !envVars.isEmpty()) {
editedCommand.setEnvironmentVariables(envVars);
}
else {
editedCommand.setEnvironmentVariables(null);