use of org.talend.camel.designer.ui.wizards.CamelNewProcessWizard in project tesb-studio-se by Talend.
the class CreateCamelProcess method doRun.
@Override
protected void doRun() {
final CamelNewProcessWizard processWizard;
if (isToolbar()) {
processWizard = new CamelNewProcessWizard(null);
} else {
ISelection selection = getSelection();
if (selection == null) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
IPath path = service.getRepositoryPath((IRepositoryNode) obj);
if (RepositoryConstants.isSystemFolder(path.toString())) {
// Not allowed to create in system folder.
return;
}
processWizard = new CamelNewProcessWizard(path);
}
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
if (dlg.open() == Window.OK) {
if (processWizard.getProcess() == null) {
return;
}
try {
openEditor(processWizard.getProcess());
} catch (PartInitException e) {
ExceptionHandler.process(e);
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
Aggregations