@Override public boolean cancel() { dd.setValue(DialogDescriptor.CANCEL_OPTION); d.setVisible(false); pkgTreeView.setCancelHandler(null); return true; } };
@Override public boolean cancel() { dd.setValue(DialogDescriptor.CANCEL_OPTION); d.setVisible(false); fileTreeView.setCancelHandler(null); return true; } };
DialogDescriptor descriptor = descriptorRef.get(); descriptor.setValue(DialogDescriptor.CANCEL_OPTION); //change default initial selected butten from "OK" to "CANCEL"
/** * Handle user input... */ public void evaluateInput() { if (editDialog.getValue().equals(NotifyDescriptor.CANCEL_OPTION)) { dialog.dispose(); dialogOK = false; return; } if (editable == Editable.NEITHER) { // Not editable dialog.dispose(); dialogOK = false; return; } errorMessage = null; if (name.equals("")) { errorMessage = NbBundle.getMessage(TableRowDialog.class, "MSG_no_name"); } else if (condition == Condition.VALUE && value.equals("")) { errorMessage = NbBundle.getMessage(TableRowDialog.class, "MSG_no_value"); } if (errorMessage == null) { dialog.dispose(); dialogOK = true; } else { editDialog.setValue(NotifyDescriptor.CLOSED_OPTION); NotifyDescriptor nd = new NotifyDescriptor.Message(errorMessage, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(nd); } }
throw new RuntimeException(th); descriptor.setValue(DialogDescriptor.CLOSED_OPTION); } finally { dialog.dispose();
BatchConfigurationSelector(MakeProject project, Configuration[] confs) { confSelectorPanel = new ConfSelectorPanel(getString("CheckLabel"), getString("CheckLabelMn").charAt(0), confs, new JButton[]{buildButton, rebuildButton, cleanButton}); String dialogTitle = MessageFormat.format(getString("BatchBuildTitle"), // NOI18N new Object[]{ProjectUtils.getInformation(project).getDisplayName()}); buildButton.setMnemonic(getString("BuildButtonMn").charAt(0)); buildButton.getAccessibleContext().setAccessibleDescription(getString("BuildButtonAD")); buildButton.addActionListener(BatchConfigurationSelector.this); rebuildButton.setMnemonic(getString("CleanBuildButtonMn").charAt(0)); rebuildButton.addActionListener(BatchConfigurationSelector.this); rebuildButton.getAccessibleContext().setAccessibleDescription(getString("CleanBuildButtonAD")); cleanButton.setMnemonic(getString("CleanButtonMn").charAt(0)); cleanButton.addActionListener(BatchConfigurationSelector.this); cleanButton.getAccessibleContext().setAccessibleDescription(getString("CleanButtonAD")); closeButton.getAccessibleContext().setAccessibleDescription(getString("CloseButtonAD")); // Show the dialog DialogDescriptor dd = new DialogDescriptor(confSelectorPanel, dialogTitle, true, new Object[]{closeButton}, closeButton, 0, null, null); //DialogDisplayer.getDefault().notify(dd); dialog = DialogDisplayer.getDefault().createDialog(dd); dialog.getAccessibleContext().setAccessibleDescription(getString("BatchBuildDialogAD")); try { dialog.setVisible(true); } catch (Throwable th){ if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dd.setValue(closeButton); } finally { dialog.setVisible(false); } }
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose();
@Override public void invoke() { UIGesturesSupport.submit(CsmRefactoringUtils.USG_CND_REFACTORING, CsmRefactoringUtils.GENERATE_TRACKING, "CONSTRUCTOR"); // NOI18N if (operators != null) { final OperatorsPanel panel = new OperatorsPanel(operators); DialogDescriptor dialogDescriptor = GeneratorUtils.createDialogDescriptor(panel, NbBundle.getMessage(ConstructorGenerator.class, "LBL_generate_operator")); //NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); try { dialog.setVisible(true); } catch (Throwable th) { if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dialogDescriptor.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose(); } if (dialogDescriptor.getValue() != dialogDescriptor.getDefaultValue()) { return; } GeneratorUtils.generateOperators(contextPath, type, panel.getOperatorsToGenerate()); } }
@Override public void actionPerformed(ActionEvent e) { String state = e.getActionCommand(); if (state.equals(JFileChooser.APPROVE_SELECTION)) { VCSFileProxy destination = VCSFileProxySupport.getSelectedFile(chooser); destination = getTargetFile(destination); if (destination.exists()) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation(NbBundle.getMessage(ExportDiffSupport.class, "BK3005", destination.getPath())); nd.setOptionType(NotifyDescriptor.YES_NO_OPTION); DialogDisplayer.getDefault().notify(nd); if (nd.getValue().equals(NotifyDescriptor.OK_OPTION) == false) { return; } } preferences.put("ExportDiff.saveFolder", destination.getParentFile().getPath()); // NOI18N panel.setOutputFileText(destination.getPath()); } else { dd.setValue(null); } if(dialog != null) { dialog.dispose(); } } });
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose();
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose();
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose();
@Override public void actionPerformed(ActionEvent e) { dd.setClosingOptions(new Object[] {commitButton, cancelButton}); SaveCookie[] saveCookies = diffProvider.getSaveCookies(); if (cancelButton == e.getSource()) { if (saveCookies.length > 0) { if (SaveBeforeClosingDiffConfirmation.allSaved(saveCookies) || !isShowing()) { EditorCookie[] editorCookies = diffProvider.getEditorCookies(); for (EditorCookie cookie : editorCookies) { cookie.open(); } } else { dd.setClosingOptions(new Object[0]); } } dd.setValue(cancelButton); } else if (commitButton == e.getSource()) { if (saveCookies.length > 0 && !SaveBeforeCommitConfirmation.allSaved(saveCookies)) { dd.setClosingOptions(new Object[0]); } else if (!canCommit()) { dd.setClosingOptions(new Object[0]); } dd.setValue(commitButton); } } });
@Override public void actionPerformed(ActionEvent e) { dd.setClosingOptions(new Object[] {commitButton, cancelButton}); SaveCookie[] saveCookies = panel.getSaveCookies(); if (cancelButton == e.getSource()) { if (saveCookies.length > 0) { if (SaveBeforeClosingDiffConfirmation.allSaved(saveCookies) || !panel.isShowing()) { EditorCookie[] editorCookies = panel.getEditorCookies(); for (EditorCookie cookie : editorCookies) { cookie.open(); } } else { dd.setClosingOptions(new Object[0]); } } dd.setValue(cancelButton); } else if (commitButton == e.getSource()) { if (saveCookies.length > 0 && !SaveBeforeCommitConfirmation.allSaved(saveCookies)) { dd.setClosingOptions(new Object[0]); } else if (!panel.canCommit()) { dd.setClosingOptions(new Object[0]); } dd.setValue(commitButton); } } });
throw new RuntimeException(th); dialogDescriptor.setValue(DialogDescriptor.CLOSED_OPTION); } finally { progressDialog.dispose();
@Override public void invoke() { UIGesturesSupport.submit(CsmRefactoringUtils.USG_CND_REFACTORING, CsmRefactoringUtils.GENERATE_TRACKING, "CONSTRUCTOR"); // NOI18N if (constructorDescription != null || fieldsDescription != null) { final ConstructorPanel panel = new ConstructorPanel(constructorDescription, fieldsDescription); DialogDescriptor dialogDescriptor = GeneratorUtils.createDialogDescriptor(panel, NbBundle.getMessage(ConstructorGenerator.class, "LBL_generate_constructor")); //NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); try { dialog.setVisible(true); } catch (Throwable th) { if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dialogDescriptor.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose(); } if (dialogDescriptor.getValue() != dialogDescriptor.getDefaultValue()) { return; } GeneratorUtils.generateConstructor(contextPath, type, panel.getInheritedConstructors(), panel.getVariablesToInitialize()); } } }
@Override public boolean askPassword(ExecutionEnvironment execEnv, String prompt) { tfUser.setText(execEnv.getUser()); String hostName = execEnv.getHost(); if (execEnv.getSSHPort() != 22) { hostName += ":" + execEnv.getSSHPort(); //NOI18N } tfHost.setText(hostName); // NOI18N cbRememberPwd.setSelected(PasswordManager.getInstance().isRememberPassword(execEnv)); DialogDescriptor dd = new DialogDescriptor(this, loc("TITLE_Password"), true, // NOI18N new Object[]{ DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION}, DialogDescriptor.OK_OPTION, DialogDescriptor.DEFAULT_ALIGN, null, null); Dialog dialog = DialogDisplayer.getDefault().createDialog(dd); dialog.setResizable(false); try { dialog.setVisible(true); } catch (Throwable th) { if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dd.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose(); } return dd.getValue() == DialogDescriptor.OK_OPTION; }
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CLOSED_OPTION); } finally { dialog.dispose();
throw new RuntimeException(th); dd.setValue(DialogDescriptor.CLOSED_OPTION); } finally { dialog.dispose();
@Override public void invoke() { UIGesturesSupport.submit(CsmRefactoringUtils.USG_CND_REFACTORING, CsmRefactoringUtils.GENERATE_TRACKING, "GETTER_SETTER"); // NOI18N final GetterSetterPanel panel = new GetterSetterPanel(description, type); String title = GeneratorUtils.getGetterSetterDisplayName(type); DialogDescriptor dialogDescriptor = GeneratorUtils.createDialogDescriptor(panel, title); Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); try { dialog.setVisible(true); } catch (Throwable th) { if (!(th.getCause() instanceof InterruptedException)) { throw new RuntimeException(th); } dialogDescriptor.setValue(DialogDescriptor.CANCEL_OPTION); } finally { dialog.dispose(); } if (dialogDescriptor.getValue() == dialogDescriptor.getDefaultValue()) { GeneratorUtils.generateGettersAndSetters(contextPath, panel.getVariables(), panel.isMethodInline(), type, isUpperCase); } } }