public ExportPDFWizard() { PrintingPlugin plugin = PrintingPlugin.getDefault(); java.util.Map<String, TemplateFactory> templateFactories = plugin.getTemplateFactories(); setWindowTitle(Messages.ExportPDFWizard_Title); String key = Icons.WIZBAN + "exportpdf_wiz.gif"; // $NON-NLS-1$ ImageRegistry imageRegistry = plugin.getImageRegistry(); ImageDescriptor image = imageRegistry.getDescriptor(key); if (image == null) { URL banURL = plugin.getBundle().getResource("icons/" + key); // $NON-NLS-1$ image = ImageDescriptor.createFromURL(banURL); imageRegistry.put(key, image); } setDefaultPageImageDescriptor(image); // get copy of map IEditorInput input = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getActivePage() .getActiveEditor() .getEditorInput(); map = (Map) ((MapEditorInput) input).getProjectElement(); // get configuration for this wizard IBlackboard mapBlackboard = map.getBlackboard(); ExportPDFWizardConfigBean config = (ExportPDFWizardConfigBean) mapBlackboard.get(ExportPDFWizardConfigBean.BLACKBOARD_KEY); page1 = new ExportPDFWizardPage1(templateFactories, config); addPage(page1); }
public void perform() { Layer selectedLayer = getSelectedLayer(); original = selectedLayer.getStyleBlackboard(); EditorPageManager manager = EditorPageManager.loadManager(PrintingPlugin.getDefault(), selectedLayer); Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); StyleEditorDialog dialog = StyleEditorDialog.createDialogOn(parentShell, null, selectedLayer, manager); dialog.setBlockOnOpen(true); int returnCode = dialog.open(); if (returnCode != Window.OK) { selectedLayer.setStyleBlackboard(original); original = null; } }