public void windowDeactivated(java.awt.event.WindowEvent we) { dialog.toFront(); } });
static void selectWindow(Window win) { if (win instanceof Frame) ((Frame)win).toFront(); else ((Dialog)win).toFront(); long start = System.currentTimeMillis(); while (true) { wait(10); if (WindowManager.getActiveWindow()==win) return; // specified window is now in front if ((System.currentTimeMillis()-start)>1000) { WindowManager.setWindow(win); return; // 1 second timeout } } }
static void selectWindow(Window win) { if (win instanceof Frame) ((Frame)win).toFront(); else ((Dialog)win).toFront(); long start = System.currentTimeMillis(); while (true) { wait(10); if (WindowManager.getActiveWindow()==win) return; // specified window is now in front if ((System.currentTimeMillis()-start)>1000) { WindowManager.setWindow(win); return; // 1 second timeout } } }
private boolean showWizard(ImporterUI importer, WizardDescriptor wizardDescriptor) { if (wizardDescriptor == null) { return true;//Nothing to show } wizardDescriptor.setTitleFormat(new MessageFormat("{0} ({1})")); wizardDescriptor.setTitle(importer.getDisplayName()); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION; }
@SuppressWarnings("unchecked") public boolean show() { setPanelsAndSettings(wizardIterator, this); updateState(); if (dialog == null) dialog = DialogDisplayer.getDefault().createDialog(this); dialog.setVisible(true); dialog.toFront(); dialog.dispose(); return getValue() == FINISH_OPTION; }
protected synchronized Dialog createGotoDialog() { if (gotoDialog == null) { gotoDialog = DialogSupport.createDialog(LocaleSupport.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(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = Math.max(0, (screen.width - dim.width) / 2); int y = Math.max(0, (screen.height - dim.height) / 2); gotoDialog.setLocation(x, y); } return gotoDialog; } else { gotoDialog.toFront(); return null; } }
Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront();
} else { gotoDialog.setVisible(true); gotoDialog.toFront(); return null;
public void performAction() { /* // fix for #133074. DesignDocument document = ActiveDocumentSupport.getDefault ().getActiveDocument (); if (document == null) { return; } if (! MidpDocumentSupport.PROJECT_TYPE_MIDP.equals (document.getDocumentInterface ().getProjectType ())) return; */ WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N wizardDescriptor.setTitle(NbBundle.getMessage (AddToPaletteWizardAction.class, "TITLE_AddToPaletteWizard")); // NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.getAccessibleContext().setAccessibleName(NbBundle.getMessage (AddToPaletteWizardAction.class, "TITLE_AddToPaletteWizard")); //NOI18N dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (AddToPaletteWizardAction.class, "TITLE_AddToPaletteWizard")); //NOI18N dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { ComponentInstaller.install ( (Map<String, ComponentInstaller.Item>) wizardDescriptor.getProperty (PROPERTY_ITEMS), (List<ComponentInstaller.Item>) wizardDescriptor.getProperty (PROPERTY_TO_INSTALL) ); } }
toFront((Frame)win); else ((Dialog)win).toFront(); ((CheckboxMenuItem)item).setState(false); if (Recorder.record && !IJ.isMacro())
toFront((Frame)win); else ((Dialog)win).toFront(); ((CheckboxMenuItem)item).setState(false); if (Recorder.record && !IJ.isMacro())
public File performClone (boolean waitFinished) throws MissingResourceException { wizardIterator = new PanelsIterator(); wizardDescriptor = new WizardDescriptor(wizardIterator); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(CloneWizardAction.class, "CTL_Clone")); // NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; File cloneFile = null; if (!cancelled) { String targetFolderPath = (String) wizardDescriptor.getProperty("directory"); //NOI18N HgModuleConfig.getDefault().getPreferences().put(CloneDestinationDirectoryWizardPanel.CLONE_TARGET_DIRECTORY, targetFolderPath); final HgURL repository = (HgURL) wizardDescriptor.getProperty("repository"); // NOI18N final File directory = new File(targetFolderPath); final String cloneName = (String) wizardDescriptor.getProperty("cloneName"); // NOI18N final HgURL pullPath = (HgURL) wizardDescriptor.getProperty("defaultPullPath"); // NOI18N final HgURL pushPath = (HgURL) wizardDescriptor.getProperty("defaultPushPath"); // NOI18N cloneFile = new File(directory, cloneName); Task t = CloneAction.performClone(repository, cloneFile, true, null, pullPath, pushPath, HgModuleConfig.getDefault().getShowCloneCompleted()); if (waitFinished) { t.waitFinished(); } } return cloneFile; }
/** * Fired when the action is performed. Shows the dialog. * @param e */ @Override public void actionPerformed(ActionEvent e) { // {0} will be replaced by WizardDescriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle(TITLE); // Disable Finish-button for Action-selection panel. // FIX: Doesn't work if dialog is already visible. // A better place would probably be in getWizardContent() ((JComponent) wizardDescriptor.getOptions()[2]).setEnabled(false); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { getSelectedWizard().save(wizardDescriptor); } if(getSelectedWizard() != null){ getSelectedWizard().clear(wizardDescriptor); } // TODO: [Merijn] Add panels = null to documentation }
private void showFindDialogImpl( boolean isReplace, KeyEventBlocker blocker) { synchronized( dialogLock ) { if (findDialog != null) { // we have a dialog, change and raise if( isReplaceDialog != isReplace ) { isReplaceDialog = isReplace; findButtons[1].setVisible( isReplace ); findButtons[2].setVisible( isReplace ); findPanel.changeVisibility(isReplace); findDialog.setTitle (isReplace ? LocaleSupport.getString ("replace-title") : LocaleSupport.getString ("find-title")); // NOI18N } findDialog.toFront(); } else { // create and show new dialog of required type isReplaceDialog = isReplace; createFindButtons(); findButtons[1].setVisible( isReplace ); findButtons[2].setVisible( isReplace ); createFindPanel(); findPanel.changeVisibility(isReplace); findDialog = createFindDialog( findPanel, findButtons, this ); findDialog.addWindowListener( this ); ((JDialog)findDialog).getRootPane().setFocusable(false); } } // end of synchronized section findDialog.pack(); findPanel.init(isReplace, blocker); findDialog.setVisible(true); findPanel.showNotify(); updateCaretPosition(); }
/** * Show a multistep wizard for converting a non-sharable project to a sharable, self-contained one. * @param helper * @param ref * @param libraryNames * @param jarReferences * @return true is migration was performed, false when aborted. */ @Messages({ "TIT_MakeSharableWizard=New Libraries Folder", "ACSD_MakeSharableWizard=Wizard dialog that guides you through the process of making the project self-contained and sharable in respect to binary dependencies." }) public static boolean showMakeSharableWizard(final AntProjectHelper helper, ReferenceHelper ref, List<String> libraryNames, List<String> jarReferences) { final CopyIterator cpIt = new CopyIterator(helper); final WizardDescriptor wizardDescriptor = new WizardDescriptor(cpIt); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle(TIT_MakeSharableWizard()); wizardDescriptor.putProperty(PROP_HELPER, helper); wizardDescriptor.putProperty(PROP_REFERENCE_HELPER, ref); wizardDescriptor.putProperty(PROP_LIBRARIES, libraryNames); wizardDescriptor.putProperty(PROP_JAR_REFS, jarReferences); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.getAccessibleContext().setAccessibleDescription(ACSD_MakeSharableWizard()); dialog.setVisible(true); dialog.toFront(); return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION && cpIt.isSuccess(); }
if (findDialog != null) { // we have a dialog, change or raise if (isReplaceDialog == isReplace) { // raise only findDialog.toFront();
dialog.setLocation(initialX,initialY); dialog.setVisible(true); dialog.toFront();