private void notifyBadInput(String msg) { Object[] options = {NotifyDescriptor.OK_OPTION}; NotifyDescriptor badInputDialog = new NotifyDescriptor(msg, NbBundle.getMessage(TableRowDialog.class, "MSG_invalid_input"), NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE, options, options[0]); DialogDisplayer.getDefault().notify(badInputDialog); } }
private static void warnUser(String title, String message) { DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor( message, title, NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION}, NotifyDescriptor.OK_OPTION)); }
@Override public boolean promptYesNo(String message) { NotifyDescriptor descriptor = new NotifyDescriptor( message, NbBundle.getMessage(SftpClient.class, "LBL_Warning"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] {NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION}, NotifyDescriptor.YES_OPTION); return DialogDisplayer.getDefault().notify(descriptor) == NotifyDescriptor.YES_OPTION; }
public static boolean confirmDelete(String title, String message) { NotifyDescriptor nd = new NotifyDescriptor( message, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); return DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION; }
private void notifyImportImpossible(String msg) { NotifyDescriptor nd = new NotifyDescriptor( msg, NbBundle.getMessage(CreateAction.class, "MSG_ImportNotAllowed"), // NOI18N NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION}, NotifyDescriptor.OK_OPTION); DialogDisplayer.getDefault().notify(nd); } }
@Override public boolean notifyAndIgnore(String title, String msg) { NotifyDescriptor nd = new NotifyDescriptor(msg, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); Object ret = DialogDisplayer.getDefault().notify(nd); return ret == NotifyDescriptor.YES_OPTION; }
private void cancelledAction() { JButton ok = new JButton(NbBundle.getMessage(ExceptionHandler.class, "CTL_Action_OK")); // NOI18N NotifyDescriptor descriptor = new NotifyDescriptor( ACTION_CANCELED_BY_USER, NbBundle.getMessage(ExceptionHandler.class, "CTL_ActionCanceled_Title"), // NOI18N NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object [] { ok }, ok); DialogDisplayer.getDefault().notify(descriptor); return; }
public static void notifyError (final String title, final String message) { NotifyDescriptor nd = new NotifyDescriptor(message, title, NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION}, NotifyDescriptor.OK_OPTION); DialogDisplayer.getDefault().notifyLater(nd); }
private static void notifyError (final String title, final String message) { NotifyDescriptor nd = new NotifyDescriptor(message, title, NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION}, NotifyDescriptor.OK_OPTION); DialogDisplayer.getDefault().notifyLater(nd); }
private boolean showUpdateDialog() { JButton updateOption = new JButton (NbBundle.getMessage(UpdateProjectImpl.class, "CTL_UpdateOption")); updateOption.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateProjectImpl.class, "AD_UpdateOption")); return DialogDisplayer.getDefault().notify( new NotifyDescriptor (NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdate", BUILD_NUMBER), NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdateTitle"), NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] { updateOption, NotifyDescriptor.CANCEL_OPTION }, updateOption)) == updateOption; }
@Override public void run() { NotifyDescriptor nd = new NotifyDescriptor(message, NbBundle.getMessage(ConfigurationXMLReader.class, "CONVERT_DIALOG_TITLE"), NotifyDescriptor.YES_NO_OPTION, // NOI18N NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); Object ret = DialogDisplayer.getDefault().notify(nd); if (ret == NotifyDescriptor.YES_OPTION) { configurationDescriptor.setModified(); } } };
private boolean showUpdateDialog() { JButton updateOption = new JButton (NbBundle.getMessage(UpdateProjectImpl.class, "CTL_UpdateOption")); updateOption.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateProjectImpl.class, "AD_UpdateOption")); return DialogDisplayer.getDefault().notify( new NotifyDescriptor (NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdate", BUILD_NUMBER), NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdateTitle"), NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] { updateOption, NotifyDescriptor.CANCEL_OPTION }, updateOption)) == updateOption; } }
private boolean showUpdateDialog() { JButton updateOption = new JButton (NbBundle.getMessage(UpdateProjectImpl.class, "CTL_UpdateOption")); updateOption.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateHelper.class, "AD_UpdateOption")); return DialogDisplayer.getDefault().notify( new NotifyDescriptor (NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdate", BUILD_NUMBER), NbBundle.getMessage(UpdateProjectImpl.class,"TXT_ProjectUpdateTitle"), NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE, new Object[] { updateOption, NotifyDescriptor.CANCEL_OPTION }, updateOption)) == updateOption; } }
/** * Returns true if trying to commit from the commit tab or the user confirmed his action * @return */ boolean canCommit() { boolean result = true; if (tabbedPane != null && tabbedPane.getSelectedComponent() != basePanel) { NotifyDescriptor nd = new NotifyDescriptor(NbBundle.getMessage(CommitPanel.class, "MSG_CommitDialog_CommitFromDiff"), //NOI18N NbBundle.getMessage(CommitPanel.class, "LBL_CommitDialog_CommitFromDiff"), //NOI18N NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); result = NotifyDescriptor.YES_OPTION == DialogDisplayer.getDefault().notify(nd); } return result; }
public void actionPerformed(ActionEvent e) { Object response = DialogDisplayer.getDefault().notify(new NotifyDescriptor( NbBundle.getMessage(Scene.class, "Scene.RemoveDialog.text", getName()), NbBundle.getMessage(Scene.class, "Scene.RemoveSceneAction.text"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[]{NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION}, NotifyDescriptor.YES_OPTION)); if (response == NotifyDescriptor.YES_OPTION) { gameDesign.removeScene(Scene.this); } } }
@Override public void actionPerformed(ActionEvent e) { SortPanel panel = new SortPanel(); NotifyDescriptor categoryNameDialog = new NotifyDescriptor( panel, NbBundle.getMessage(Actions.class, "MSG_SortDialog"), NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE, null, NotifyDescriptor.OK_OPTION); if (DialogDisplayer.getDefault().notify(categoryNameDialog) == NotifyDescriptor.OK_OPTION) { panel.saveAttributes(); } } }
public void actionPerformed(ActionEvent e) { Object response = DialogDisplayer.getDefault().notify(new NotifyDescriptor( NbBundle.getMessage(AnimatedTile.class, "AnimatedTile.DeleteDialog.text", getName()), NbBundle.getMessage(AnimatedTile.class, "AnimatedTile.DeleteAnimatedTile.text"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] {NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION}, NotifyDescriptor.YES_OPTION)); if (response == NotifyDescriptor.YES_OPTION) { if (DEBUG) System.out.println("said YES to delete AnimatedTile"); // NOI18N getImageResource().removeAnimatedTile(getIndex()); } } }
@Override public void actionPerformed(ActionEvent e) { PaletteGeneratorPanel pgn = new PaletteGeneratorPanel(); pgn.setup(colorsCount); NotifyDescriptor nd = new NotifyDescriptor(pgn, NbBundle.getMessage(PartitionColorTransformerPanel.class, "PartitionColorTransformerPanel.generatePalettePanel.title"), NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.DEFAULT_OPTION, null, null); if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) { Palette pl = pgn.getSelectedPalette(); if (pl != null) { applyPalette(pl); } } } });
/** * Returns true if trying to commit from the commit tab or the user confirmed his action * @return */ boolean canCommit() { boolean result = true; if (tabbedPane != null && tabbedPane.getSelectedComponent() != basePanel) { NotifyDescriptor nd = new NotifyDescriptor(modifier.getMessage(VCSCommitPanelModifier.BundleMessage.MESSAGE_FINISHING_FROM_DIFF), modifier.getMessage(VCSCommitPanelModifier.BundleMessage.MESSAGE_FINISHING_FROM_DIFF_TITLE), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); result = NotifyDescriptor.YES_OPTION == DialogDisplayer.getDefault().notify(nd); } return result; }
private boolean showCategoryNameDialog(CategoryNamePanel panel, String message) { categoryNameDialog = new NotifyDescriptor( panel, message, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE, null, NotifyDescriptor.OK_OPTION); categoryNameDialog.setValid(false); if (categoryNameListener == null) { categoryNameListener = new CategoryNameDocumentListener(); } panel.addDocumentListener(categoryNameListener); boolean confirm = DialogDisplayer.getDefault().notify(categoryNameDialog) == NotifyDescriptor.OK_OPTION; panel.removeDocumentListener(categoryNameListener); return confirm; }