use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.
the class ExportServiceAction method doRun.
@Override
protected void doRun() {
try {
if (!isAllOperationsAssignedJob(serviceItem)) {
boolean isContinue = MessageDialog.openQuestion(shell, Messages.ExportServiceAction_noJobDialogTitle, Messages.ExportServiceAction_noJobDialogMsg);
if (!isContinue) {
return;
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
ServiceExportWizard processWizard = new ServiceExportWizard(serviceItem);
IWorkbench workbench = getWorkbench();
processWizard.setWindowTitle(EXPORT_SERVICE_LABEL);
WizardDialog dialog = new WizardDialog(shell, processWizard);
workbench.saveAllEditors(true);
dialog.open();
}
use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.
the class NewAssignJobAction method doRun.
@Override
protected void doRun() {
AssignJobWizard assignJobWizard = new AssignJobWizard(assignJobAction, newJobAction);
WizardDialog wizardDialog = new AssignJobWizardDialog(getWorkbench().getActiveWorkbenchWindow().getShell(), assignJobWizard);
wizardDialog.open();
}
use of org.eclipse.jface.wizard.WizardDialog in project sling by apache.
the class ExportContentAction method run.
private void run(ISelection selection) {
if (!(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
for (Iterator<?> it = structuredSelection.iterator(); it.hasNext(); ) {
Object selected = it.next();
if (selected instanceof IResource) {
IResource resource = (IResource) selected;
Shell activeShell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
ExportWizard wiz = new ExportWizard();
if (resource instanceof IProject) {
resource = ProjectUtil.getSyncDirectory((IProject) resource);
}
wiz.init(PlatformUI.getWorkbench(), resource);
WizardDialog dialog = new WizardDialog(activeShell, wiz);
dialog.open();
}
}
}
use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.
the class BndEditor method doAutoResolveOnSave.
private void doAutoResolveOnSave(IProgressMonitor monitor) {
final Shell shell = getEditorSite().getShell();
final IFile file = ResourceUtil.getFile(getEditorInput());
if (file == null) {
MessageDialog.openError(shell, "Resolution Error", "Unable to run resolution because the file is not in the workspace. NB.: the file will still be saved.");
reallySave(monitor);
return;
}
// Create resolver job and pre-validate
final ResolveJob job = new ResolveJob(model);
IStatus validation = job.validateBeforeRun();
if (!validation.isOK()) {
String message = "Unable to run the resolver. NB.: the file will still be saved.";
ErrorDialog.openError(shell, "Resolution Validation Problem", message, validation, IStatus.ERROR | IStatus.WARNING);
reallySave(monitor);
return;
}
// Add operation to perform at the end of resolution (i.e. display
// results and actually save the file)
final UIJob completionJob = new UIJob(shell.getDisplay(), "Display Resolution Results") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ResolutionResult result = job.getResolutionResult();
ResolutionWizard wizard = new ResolutionWizard(model, file, result);
if (result.getOutcome() != ResolutionResult.Outcome.Resolved) /*|| !result.getResolve().getOptionalResources().isEmpty() */
{
WizardDialog dialog = new WizardDialog(shell, wizard);
if (dialog.open() != Window.OK) {
if (!wizard.performFinish()) {
MessageDialog.openError(shell, "Error", "Unable to store resolution results into Run Bundles list.");
}
}
} else {
if (!wizard.performFinish()) {
MessageDialog.openError(shell, "Error", "Unable to store resolution results into Run Bundles list.");
}
}
reallySave(monitor);
return Status.OK_STATUS;
}
};
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
completionJob.schedule();
}
});
// Start job
job.setUser(true);
job.schedule();
}
use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.
the class ExportAction method run.
@Override
public void run() {
if (configElems == null || configElems.length == 0)
return;
if (editor.isDirty()) {
if (MessageDialog.openConfirm(parentShell, "Export", "The editor content must be saved before exporting. Save now?")) {
try {
editor.getSite().getWorkbenchWindow().run(false, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
editor.doSave(monitor);
}
});
} catch (Exception e) {
ErrorDialog.openError(parentShell, "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error during save.", e));
return;
}
} else {
return;
}
}
IFile targetResource = ResourceUtil.getFile(editor.getEditorInput());
try {
Run run = LaunchUtils.createRun(targetResource);
RunExportSelectionWizard wizard = new RunExportSelectionWizard(configElems, model, run);
WizardDialog dialog = new WizardDialog(parentShell, wizard);
dialog.open();
LaunchUtils.endRun(run);
} catch (Exception e) {
ErrorDialog.openError(parentShell, "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error deriving Bnd project.", e));
}
}
Aggregations