use of org.talend.camel.designer.ui.wizards.SaveAsRoutesWizard in project tesb-studio-se by Talend.
the class SaveAsRoutesAction method run.
@Override
public void run() {
SaveAsRoutesWizard processWizard = new SaveAsRoutesWizard((JobEditorInput) editorPart.getEditorInput());
WizardDialog dlg = new WizardDialog(editorPart.getSite().getShell(), processWizard);
if (dlg.open() == Window.OK) {
try {
// Set readonly to false since created routes will always be editable.
JobEditorInput newRoutesEditorInput = new CamelProcessEditorInput(processWizard.getProcess(), true, true, false);
IWorkbenchPage page = editorPart.getSite().getPage();
IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(newRoutesEditorInput.getItem().getProperty().getId(), false);
newRoutesEditorInput.setRepositoryNode(repositoryNode);
// close the old editor
page.closeEditor(editorPart, false);
// open the new editor, because at the same time, there will update the routes view
page.openEditor(newRoutesEditorInput, CamelMultiPageTalendEditor.ID, true);
} catch (Exception e) {
MessageDialog.openError(editorPart.getSite().getShell(), "Error", "Routes could not be saved" + " : " + e.getMessage());
ExceptionHandler.process(e);
}
}
}
Aggregations