use of org.talend.camel.designer.ui.editor.CamelProcessEditorInput 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);
}
}
}
use of org.talend.camel.designer.ui.editor.CamelProcessEditorInput in project tesb-studio-se by Talend.
the class ReadCamelProcess method doRun.
@Override
protected void doRun() {
final IRepositoryNode node = (IRepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
CamelProcessItem processItem = (CamelProcessItem) node.getObject().getProperty().getItem();
IWorkbenchPage page = getActivePage();
try {
CamelProcessEditorInput fileEditorInput = new CamelProcessEditorInput(processItem, true, null, true);
checkUnLoadedNodeForProcess(fileEditorInput);
IEditorPart editorPart = page.findEditor(fileEditorInput);
if (editorPart == null) {
fileEditorInput.setRepositoryNode(node);
page.openEditor(fileEditorInput, CamelMultiPageTalendEditor.ID, true);
} else {
page.activate(editorPart);
}
} catch (PartInitException | PersistenceException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.talend.camel.designer.ui.editor.CamelProcessEditorInput in project tesb-studio-se by Talend.
the class CreateCamelProcess method openEditor.
protected final void openEditor(ProcessItem processItem) throws PersistenceException, PartInitException {
// Set readonly to false since created job will always be editable.
CamelProcessEditorInput fileEditorInput = new CamelProcessEditorInput(processItem, false, true, false);
IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(fileEditorInput.getItem().getProperty().getId(), false);
fileEditorInput.setRepositoryNode(repositoryNode);
IWorkbenchPage page = getActivePage();
page.openEditor(fileEditorInput, getEditorId(), true);
// // use project setting true
// ProjectSettingManager.defaultUseProjectSetting(fileEditorInput.getLoadedProcess());
}
Aggregations