use of bndtools.wizards.bndfile.RunExportSelectionWizard 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, Mode.EXPORT);
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