use of org.talend.designer.core.ui.wizards.NewProcessWizard in project tesb-studio-se by Talend.
the class CreateNewJobAction method getNewProcessWizard.
private NewProcessWizard getNewProcessWizard(RepositoryNode node) {
NewProcessWizard processWizard = null;
if (isToolbar()) {
processWizard = new NewProcessWizard(null);
} else {
ItemCacheManager.clearCache();
String operationName = ((OperationRepositoryObject) node.getObject()).getName();
String portName = "defaultPort";
String servicesName = "Services";
if (node.getParent() != null) {
portName = node.getParent().getObject().getLabel();
if (node.getParent().getParent() != null) {
servicesName = node.getParent().getParent().getObject().getLabel();
}
}
IPath path = new Path(servicesName).append(portName).append(operationName);
if (RepositoryConstants.isSystemFolder(path.toString())) {
// Not allowed to create in system folder.
return null;
}
processWizard = new NewProcessWizard(path, initLabel(node));
}
return processWizard;
}
use of org.talend.designer.core.ui.wizards.NewProcessWizard in project tesb-studio-se by Talend.
the class CreateNewJobAction method doRun.
@Override
protected void doRun() {
RepositoryNode node = getSelectedRepositoryNode();
if (node == null) {
return;
}
NewProcessWizard processWizard = getNewProcessWizard(node);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
if (dlg.open() == Window.OK) {
createNewProcess(node, processWizard.getProcess());
}
}
use of org.talend.designer.core.ui.wizards.NewProcessWizard in project tdi-studio-se by Talend.
the class CreateProcess method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
final NewProcessWizard processWizard;
if (isToolbar()) {
processWizard = new NewProcessWizard(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 NewProcessWizard(path);
}
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
if (dlg.open() == Window.OK) {
if (processWizard.getProcess() == null) {
return;
}
ProcessEditorInput fileEditorInput;
try {
// Set readonly to false since created job will always be editable.
fileEditorInput = new ProcessEditorInput(processWizard.getProcess(), false, true, false);
IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(fileEditorInput.getItem().getProperty().getId(), false);
fileEditorInput.setRepositoryNode(repositoryNode);
IWorkbenchPage page = getActivePage();
page.openEditor(fileEditorInput, MultiPageTalendEditor.ID, true);
// // use project setting true
// ProjectSettingManager.defaultUseProjectSetting(fileEditorInput.getLoadedProcess());
} catch (PartInitException e) {
// TODO Auto-generated catch block
ExceptionHandler.process(e);
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
Aggregations