/** * DOCUMENT ME! * * @param e DOCUMENT ME! */ @Override public void actionPerformed(final ActionEvent e) { final WizardDescriptor wizard = new WizardDescriptor(getPanels()); wizard.setTitleFormat(new MessageFormat("{0}")); // NOI18N wizard.setTitle( NbBundle.getMessage( ImportGeoCPMWizardAction.class, "ImportGeoCPMWizardAction.wizard.title")); // NOI18N final Dialog dialog = DialogDisplayer.getDefault().createDialog(wizard); dialog.pack(); dialog.setLocationRelativeTo(ComponentRegistry.getRegistry().getMainWindow()); dialog.setVisible(true); dialog.toFront(); final boolean cancelled = wizard.getValue() != WizardDescriptor.FINISH_OPTION; if (cancelled) { for (final Object o : getPanels()) { if (o instanceof Cancellable) { ((Cancellable) o).cancel(); } } } // there is no need to do anything, when finished successfully }
public void performAction() { WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle("Skybox Wizard"); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { topComponent.generateSkybox(wizardDescriptor); } }
@Override public void performAction() { WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle("Import peak data from MeltDB"); wizardDescriptor.putProperty( "WizardPanel_image", ImageUtilities.loadImage("maltcms/io/xml/ws/meltdb/meltdb-logo-wizard.png", true)); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { // do something } }
protected synchronized Dialog createGotoDialog() { if (gotoDialog == null) { gotoDialog = DialogSupport.createDialog( NbBundle.getBundle(org.netbeans.editor.BaseKit.class) .getString("goto-title"), // NOI18N gotoPanel, false, // non-modal gotoButtons, false, // sidebuttons, 0, // defaultIndex = 0 => gotoButton 1, // cancelIndex = 1 => cancelButton this // listener ); gotoDialog.pack(); // Position the dialog according to the history Rectangle lastBounds = (Rectangle) EditorState.get(BOUNDS_KEY); if (lastBounds != null) { gotoDialog.setBounds(lastBounds); } else { // no history, center it on the screen Dimension dim = gotoDialog.getPreferredSize(); int x; int y; JTextComponent c = EditorRegistry.lastFocusedComponent(); Window w = c != null ? SwingUtilities.getWindowAncestor(c) : null; if (w != null) { x = Math.max(0, w.getX() + (w.getWidth() - dim.width) / 2); y = Math.max(0, w.getY() + (w.getHeight() - dim.height) / 2); } else { Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); x = Math.max(0, (screen.width - dim.width) / 2); y = Math.max(0, (screen.height - dim.height) / 2); } gotoDialog.setLocation(x, y); } return gotoDialog; } else { gotoDialog.setVisible(true); gotoDialog.toFront(); return null; } }
@SuppressWarnings("unchecked") @Override public void performAction(Node[] nodes) { WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels(nodes[0])); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle("nLV Graph Configuration"); wizardDescriptor.putProperty("node", nodes[0]); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { // do something int maxLevel = (Integer) wizardDescriptor.getProperty("maxLevel"); boolean inner = (Boolean) wizardDescriptor.getProperty("inner"); AbstractDistance ad = (AbstractDistance) wizardDescriptor.getProperty("distance"); if (ad.configurable()) { ad.configure(); } OutputPanel op = new OutputPanel( nodes[0].getParentNode().getDisplayName() + ": nLV Graph (" + ad.toString() + ") Output"); Runnable job = new GraphBuilder(nodes[0], op, ad, 0, maxLevel, inner); op.open(); op.requestActive(); Thread thread = new Thread(job); thread.setDaemon(true); thread.start(); nodes[0].addNodeListener(new LocalNodeListener(op)); } panels = null; }
@Messages("CTL_AddNetbeansPlatformTitle=Add NetBeans Platform") private void addPlatform(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_addPlatform PlatformChooserWizardPanel chooser = new PlatformChooserWizardPanel(null); PlatformInfoWizardPanel info = new PlatformInfoWizardPanel(null); WizardDescriptor wd = new WizardDescriptor(new BasicWizardPanel[] {chooser, info}); initPanel(chooser, wd, 0); initPanel(info, wd, 1); wd.setTitleFormat(new MessageFormat("{0}")); // NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(wd); dialog.setTitle(CTL_AddNetbeansPlatformTitle()); dialog.setVisible(true); dialog.toFront(); if (wd.getValue() == WizardDescriptor.FINISH_OPTION) { String plafDir = (String) wd.getProperty(PLAF_DIR_PROPERTY); String plafLabel = (String) wd.getProperty(PLAF_LABEL_PROPERTY); String id = plafLabel.replace(' ', '_'); NbPlatform plaf = getPlafListModel().addPlatform(id, plafDir, plafLabel); if (plaf != null) { platformsList.setSelectedValue(plaf, true); refreshPlatform(); } } } // GEN-LAST:event_addPlatform