}
}
protected UIJob getUIJob() {
UIJob job = new UIJob(Messages.CommandDefinitionActions_TEXT_CMD_DEF) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
ITunnelServiceCommands commands = TunnelServiceCommandStore.getCurrentStore()
.getTunnelServiceCommands();
Shell shell = getShell();
if (shell != null) {
ServiceInfo serviceInfo = null;
if (serviceContext != null) {
String vendor = CloudUtil.getServiceVendor(serviceContext);
if (vendor != null) {
for (ServiceInfo info : ServiceInfo.values()) {
if (info.name().equals(vendor)) {
serviceInfo = info;
break;
}
}
}
}
TunnelCommandDefinitionWizard wizard = new TunnelCommandDefinitionWizard(commands, serviceInfo);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
if (dialog.open() == Window.OK) {
commands = wizard.getExternalToolLaunchCommandsServer();
try {
TunnelServiceCommandStore.getCurrentStore().storeServerServiceCommands(commands);
}
catch (CoreException e) {
CloudFoundryPlugin.log(e);
}
}
}
}
catch (CoreException e) {
CloudFoundryPlugin.log(e);
}
return Status.OK_STATUS;
}
};
job.setSystem(true);
return job;
}