use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class ConfigRoutineLibraryAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
ConfigExternalLibWizard wizard = new ConfigExternalLibWizard();
IWorkbench workbench = getWorkbench();
wizard.init(workbench, (IStructuredSelection) getSelection());
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, wizard);
dialog.open();
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class EditContextAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
if (repositoryNode == null) {
repositoryNode = getCurrentRepositoryNode();
}
ContextWizard contextWizard = new ContextWizard(PlatformUI.getWorkbench(), false, repositoryNode, false);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), contextWizard);
dlg.open();
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class ReadContextAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
protected void doRun() {
if (repositoryNode == null) {
repositoryNode = getCurrentRepositoryNode();
}
ContextWizard contextWizard = new ContextWizard(PlatformUI.getWorkbench(), false, repositoryNode, true);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), contextWizard);
dlg.open();
RepositoryNode node = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
refresh(node);
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class CreateSqlpatternAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
RepositoryNode sqlPatternNode = null;
if (!isFromSqlPatternComposite) {
sqlPatternNode = getCurrentRepositoryNode();
}
if (isToolbar()) {
if (sqlPatternNode != null && sqlPatternNode.getContentType() != ERepositoryObjectType.SQLPATTERNS) {
sqlPatternNode = null;
}
if (sqlPatternNode == null) {
sqlPatternNode = getRepositoryNodeForDefault(ERepositoryObjectType.SQLPATTERNS);
}
}
RepositoryNode node = null;
IPath path;
if (this.sqlPatternPath != null) {
path = new Path(this.sqlPatternPath);
} else if (isToolbar()) {
path = RepositoryNodeUtilities.getPath(sqlPatternNode);
} else {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (RepositoryNode) obj;
path = RepositoryNodeUtilities.getPath(node);
}
NewSqlpatternWizard routineWizard = new NewSqlpatternWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), routineWizard);
if (dlg.open() == Window.OK) {
try {
openSQLPatternEditor(routineWizard.getSQLPattern(), false);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.
the class SaveAsBusinessModelAction method run.
@Override
public void run() {
SaveAsBusinessModelWizard businessModelWizard = new SaveAsBusinessModelWizard(editorPart);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), businessModelWizard);
if (dlg.open() == Window.OK) {
try {
BusinessProcessItem businessProcessItem = businessModelWizard.getBusinessProcessItem();
IRepositoryNode repositoryNode = RepositoryNodeUtilities.getRepositoryNode(businessProcessItem.getProperty().getId(), false);
// because step1, the fresh will unload the resource(EMF), so, assign a new one...
businessProcessItem = (BusinessProcessItem) repositoryNode.getObject().getProperty().getItem();
IWorkbenchPage page = getActivePage();
DiagramResourceManager diagramResourceManager = new DiagramResourceManager(page, new NullProgressMonitor());
IFile file = businessModelWizard.getTempFile();
// Set readonly to false since created job will always be editable.
RepositoryEditorInput newBusinessModelEditorInput = new RepositoryEditorInput(file, businessProcessItem);
newBusinessModelEditorInput.setRepositoryNode(repositoryNode);
// here really do the normal save as function
IDocumentProvider provider = ((BusinessDiagramEditor) this.editorPart).getDocumentProvider();
provider.aboutToChange(newBusinessModelEditorInput);
provider.saveDocument(null, newBusinessModelEditorInput, provider.getDocument(this.editorPart.getEditorInput()), true);
provider.changed(newBusinessModelEditorInput);
// copy back from the *.business_diagram file to *.item file.
// @see:BusinessDiagramEditor.doSave(IProgressMonitor progressMonitor)
diagramResourceManager.updateFromResource(businessProcessItem, newBusinessModelEditorInput.getFile());
// notice: here, must save it, save the item to disk, otherwise close the editor
// without any modification, there won't save the
// model again, so, will lost the graphic when reopen it.
ProxyRepositoryFactory.getInstance().save(businessProcessItem);
// close the old editor
page.closeEditor(this.editorPart, false);
// open the new editor, because at the same time, there will update the jobSetting/componentSetting view
IEditorPart openEditor = page.openEditor(newBusinessModelEditorInput, BusinessDiagramEditor.ID, true);
} catch (Exception e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Business model could not be saved" + " : " + e.getMessage());
ExceptionHandler.process(e);
}
}
}
Aggregations