setWindowTitle("Save As...");
}
@Override
public void addPages() {
IWizardPage page = new WizardGraphTypePage(selection);
page.setDescription("Save the graph with the chosen type.");
addPage(page);
addPage(new WizardConvertPage(selection));
// To improve user experience, the selection is the editor's input file.
IStructuredSelection selection = this.selection;
Object obj = selection.getFirstElement();
if (obj instanceof GraphEditor) {
GraphEditor editor = (GraphEditor) obj;
IEditorInput input = editor.getEditorInput();
if (input instanceof IFileEditorInput) {
IFile file = ((IFileEditorInput) input).getFile();
selection = new StructuredSelection(file);
}
}
page = new WizardSaveGraphPage(selection);
page.setDescription("Save graph as.");
addPage(page);
}