-
Notifications
You must be signed in to change notification settings - Fork 1
/
SBOLExportWizard.java
50 lines (40 loc) · 1.37 KB
/
SBOLExportWizard.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package roadblock.ibw.exports.sbol;
import java.util.List;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IExportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages;
import org.eclipse.ui.wizards.datatransfer.ZipFileExportWizard;
@SuppressWarnings("restriction")
public class SBOLExportWizard extends Wizard implements IExportWizard {
private IStructuredSelection selection;
private SBOLExportWizardPage wizardPage;
@Override
public String getWindowTitle() {
return "SBOL Export";
}
@Override
public void addPages() {
wizardPage = new SBOLExportWizardPage(selection);
addPage(wizardPage);
new ZipFileExportWizard();
}
@Override
public boolean performFinish() {
return wizardPage.finish();
}
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List<?> selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
setWindowTitle(DataTransferMessages.DataTransfer_export);
setNeedsProgressMonitor(true);
}
}