Java Code Examples for org.openide.NotifyDescriptor#QUESTION_MESSAGE
The following examples show how to use
org.openide.NotifyDescriptor#QUESTION_MESSAGE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IncomingCallAction.java From NBANDROID-V2 with Apache License 2.0 | 6 votes |
@Override protected void performAction(Node[] activatedNodes) { EmulatorControlSupport emulatorControl = activatedNodes[0].getLookup().lookup(EmulatorControlSupport.class); if (emulatorControl != null) { NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine("Phone number:", "Incoming call", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE); Object notify = DialogDisplayer.getDefault().notify(inputLine); if (NotifyDescriptor.OK_OPTION.equals(notify)) { String phoneNo = inputLine.getInputText(); String ok = emulatorControl.getConsole().call(phoneNo); if (ok == null) { CancelIncomingCallAction.addCalledNumber(emulatorControl.getDevice().getSerialNumber(), phoneNo); } else { NotifyDescriptor nd = new NotifyDescriptor.Message(ok, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notifyLater(nd); } } } }
Example 2
Source File: SetLocationAction.java From NBANDROID-V2 with Apache License 2.0 | 6 votes |
@Override protected void performAction(Node[] activatedNodes) { EmulatorControlSupport emulatorControl = activatedNodes[0].getLookup().lookup(EmulatorControlSupport.class); if (emulatorControl != null) { GpsPanel gpsPanel = new GpsPanel(); NotifyDescriptor nd = new NotifyDescriptor.Confirmation(gpsPanel, "Set GPS Location", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE); Object notify = DialogDisplayer.getDefault().notify(nd); if (NotifyDescriptor.OK_OPTION.equals(notify)) { String ok = emulatorControl.getConsole().sendLocation(gpsPanel.getLo(), gpsPanel.getLa(), gpsPanel.getAl()); if (ok != null) { NotifyDescriptor nd1 = new NotifyDescriptor.Message(ok, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notifyLater(nd1); } } } }
Example 3
Source File: AdbConnectionsNode.java From NBANDROID-V2 with Apache License 2.0 | 6 votes |
@Override protected void performAction(Node[] activatedNodes) { List<String> connections = getConnections(); do { NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine("Please enter IP:Port", "Add ADB connection", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE); Object notify = DialogDisplayer.getDefault().notify(inputLine); if (NotifyDescriptor.OK_OPTION.equals(notify)) { String inputText = inputLine.getInputText(); if (DevicesNode.validate(inputText)) { connections.add(inputText); saveConnections(connections); return; } } else { return; } } while (true); }
Example 4
Source File: CordovaPerformer.java From netbeans with Apache License 2.0 | 6 votes |
private boolean hasOtherBuildTool(Project project, String toolfile, String toolName, Runnable r) { if(project.getProjectDirectory().getFileObject(toolfile) != null) { ProjectInformation info = ProjectUtils.getInformation(project); String name = info != null ? info.getDisplayName() : project.getProjectDirectory().getNameExt(); JButton tool = new JButton(toolName); NotifyDescriptor desc = new NotifyDescriptor( Bundle.MSG_SelectBuildTool(name, toolfile, toolName), Bundle.CTL_SelectBuildTool(), NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] {tool, new JButton("Ant"), NotifyDescriptor.CANCEL_OPTION}, NotifyDescriptor.OK_OPTION); DialogDisplayer.getDefault().notify(desc); if(desc.getValue() == tool) { r.run(); return true; } else if (desc.getValue() == NotifyDescriptor.CANCEL_OPTION) { return true; } } return false; }
Example 5
Source File: DashboardViewer.java From netbeans with Apache License 2.0 | 6 votes |
public void clearCategories() { NotifyDescriptor nd = new NotifyDescriptor( NbBundle.getMessage(DashboardViewer.class, "LBL_ClearCatQuestion"), //NOI18N NbBundle.getMessage(DashboardViewer.class, "LBL_ClearCatTitle"), //NOI18N NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION); if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION) { List<TaskNode> finished = new ArrayList<TaskNode>(); for (CategoryNode categoryNode : categoryNodes) { if (!categoryNode.isOpened() || !categoryNode.getCategory().persist()) { continue; } for (TaskNode taskNode : categoryNode.getTaskNodes()) { if (taskNode.getTask().isFinished()) { finished.add(taskNode); } } } removeTask(finished.toArray(new TaskNode[finished.size()])); } }
Example 6
Source File: BrokenPlatformCustomizer.java From NBANDROID-V2 with Apache License 2.0 | 5 votes |
private void downloadSdkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadSdkActionPerformed PanelDownloadToBrokenSDK panelDownloadToBrokenSDK = new PanelDownloadToBrokenSDK(platform); NotifyDescriptor nd = new NotifyDescriptor.Confirmation(panelDownloadToBrokenSDK, "Install Android SDK to broken folder", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE); Object notify = DialogDisplayer.getDefault().notify(nd); if (NotifyDescriptor.OK_OPTION.equals(notify)) { platform.setSdkRootFolder(platform.getSdkPath()); listener.sdkValid(); } }
Example 7
Source File: SimpleIO.java From netbeans with Apache License 2.0 | 5 votes |
public void actionPerformed(ActionEvent e) { if(process.get() != null) { String message = NbBundle.getMessage(SimpleIO.class, "MSG_QueryCancel", name); // NOI18N NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE); if(DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION) { Process p = process.getAndSet(null); if(p != null) { p.destroy(); } else { Logger.getLogger("glassfish").log(Level.FINEST, "Process handle unexpectedly null, cancel aborted."); // NOI18N } } } }
Example 8
Source File: VersioningMainMenu.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void actionPerformed (ActionEvent e) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation( NbBundle.getMessage(VersioningMainMenu.class, "MSG_ConnectAction.confirmation.text", new Object[] { root.getName(), vs.getDisplayName() }), //NOI18N NbBundle.getMessage(VersioningMainMenu.class, "LBL_ConnectAction.confirmation.title"), //NOI18N NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE); if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) { VersioningConfig.getDefault().disconnectRepository(vs, root); VersioningManager.getInstance().versionedRootsChanged(); } }
Example 9
Source File: ManageGroupsPanel.java From netbeans with Apache License 2.0 | 5 votes |
@Messages({"ManageGroupsPanel.wrn_remove_selected_groups_msg=Are you sure to remove selected groups?", "ManageGroupsPanel.wrn_remove_selected_groups_title=Confirm remove groups"}) private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed NotifyDescriptor d = new NotifyDescriptor.Confirmation(Bundle.ManageGroupsPanel_wrn_remove_selected_groups_msg(), Bundle.ManageGroupsPanel_wrn_remove_selected_groups_title(), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE); if (DialogDisplayer.getDefault().notify(d) == NotifyDescriptor.YES_OPTION) { removeGroups(Arrays.asList(getSelectedGroups())); } }
Example 10
Source File: FeedbackSurvey.java From netbeans with Apache License 2.0 | 5 votes |
private static boolean showDialog(URL whereTo) { String msg = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Message"); String tit = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Title"); String yes = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Yes"); String later = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Later"); String never = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Never"); NotifyDescriptor nd = new NotifyDescriptor.Message(msg, NotifyDescriptor.QUESTION_MESSAGE); nd.setTitle(tit); //Object[] buttons = { yes, later, never }; JButton yesButton = new JButton(); yesButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Yes")); Mnemonics.setLocalizedText(yesButton, yes); JButton laterButton = new JButton(); laterButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Later")); Mnemonics.setLocalizedText(laterButton, later); JButton neverButton = new JButton(); neverButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Never")); Mnemonics.setLocalizedText(neverButton, never); Object[] buttons = { yesButton, laterButton, neverButton }; nd.setOptions(buttons); Object res = DialogDisplayer.getDefault().notify(nd); if (res == yesButton) { HtmlBrowser.URLDisplayer.getDefault().showURL(whereTo); return true; } else { if( res == neverButton ) { Preferences prefs = NbPreferences.forModule(FeedbackSurvey.class); prefs.putInt("feedback.survey.show.count", (int)bundledInt("MSG_FeedbackSurvey_AskTimes")); // NOI18N } return false; } }
Example 11
Source File: LocalTask.java From netbeans with Apache License 2.0 | 5 votes |
@NbBundle.Messages({ "LBL_LocalTask.copyAttToCentralStorage.title=Copy Attachment", "# {0} - number of attachments", "MSG_LocalTask.copyAttToCentralStorage.text=You are trying to add {0} attachments to the local task.\n" + "The attachments will be kept in their original locations and linked from the task\n\n" + "Do you want to copy the files to a central storage to make sure they will be accessible " + "even after their original location is deleted?" }) private boolean askCopyToCentralStorage (int attachmentCount) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation( Bundle.MSG_LocalTask_copyAttToCentralStorage_text(attachmentCount), Bundle.LBL_LocalTask_copyAttToCentralStorage_title(), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE); return DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION; }
Example 12
Source File: StopManager.java From netbeans with Apache License 2.0 | 5 votes |
private boolean displayServerRunning() { JButton cancelButton = new JButton(); Mnemonics.setLocalizedText(cancelButton, NbBundle.getMessage(StopManager.class, "StopManager.CancelButton")); // NOI18N cancelButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(StopManager.class, "StopManager.CancelButtonA11yDesc")); //NOI18N JButton keepWaitingButton = new JButton(); Mnemonics.setLocalizedText(keepWaitingButton, NbBundle.getMessage(StopManager.class, "StopManager.KeepWaitingButton")); // NOI18N keepWaitingButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(StopManager.class, "StopManager.KeepWaitingButtonA11yDesc")); //NOI18N JButton propsButton = new JButton(); Mnemonics.setLocalizedText(propsButton, NbBundle.getMessage(StopManager.class, "StopManager.PropsButton")); // NOI18N propsButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(StopManager.class, "StopManager.PropsButtonA11yDesc")); //NOI18N String message = NbBundle.getMessage(StopManager.class, "MSG_ServerStillRunning"); final NotifyDescriptor ndesc = new NotifyDescriptor(message, NbBundle.getMessage(StopManager.class, "StopManager.ServerStillRunningTitle"), NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] {keepWaitingButton, propsButton, cancelButton}, NotifyDescriptor.CANCEL_OPTION); //NOI18N Object ret = Mutex.EVENT.readAccess(new Action<Object>() { @Override public Object run() { return DialogDisplayer.getDefault().notify(ndesc); } }); if (cancelButton.equals(ret)) { stopRequested.set(false); return false; } else if (keepWaitingButton.equals(ret)) { return true; } else { displayAdminProperties(server); return false; } }
Example 13
Source File: PanelSourceFolders.java From netbeans with Apache License 2.0 | 5 votes |
private void searchClassFiles(File[] folders) throws WizardValidationException { List<File> classFiles = new ArrayList<File>(); for (File folder : folders) { findClassFiles(folder, classFiles); } if (!classFiles.isEmpty()) { JButton DELETE_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_DeleteOption")); // NOI18N JButton KEEP_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_KeepOption")); // NOI18N JButton CANCEL_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_CancelOption")); // NOI18N KEEP_OPTION.setMnemonic(NbBundle.getMessage(PanelSourceFolders.class, "MNE_KeepOption").charAt(0)); // NOI18N DELETE_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_DeleteOption")); // NOI18N KEEP_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_KeepOption")); // NOI18N CANCEL_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_CancelOption")); // NOI18N NotifyDescriptor desc = new NotifyDescriptor( NbBundle.getMessage(PanelSourceFolders.class, "MSG_FoundClassFiles"), // NOI18N NbBundle.getMessage(PanelSourceFolders.class, "MSG_FoundClassFiles_Title"), // NOI18N NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[]{DELETE_OPTION, KEEP_OPTION, CANCEL_OPTION}, DELETE_OPTION); Object result = DialogDisplayer.getDefault().notify(desc); if (DELETE_OPTION.equals(result)) { for (File f : classFiles) { f.delete(); // ignore if fails } } else if (!KEEP_OPTION.equals(result)) { // cancel, back to wizard throw new WizardValidationException(this.sourcePanel, "", ""); // NOI18N } } }
Example 14
Source File: StatusLineComponent.java From netbeans with Apache License 2.0 | 5 votes |
public @Override void actionPerformed(ActionEvent actionEvent) { InternalHandle hndl = handle; if (hndl !=null && hndl.getState() == InternalHandle.STATE_RUNNING) { String message = NbBundle.getMessage(StatusLineComponent.class, "Cancel_Question", handle.getDisplayName()); String title = NbBundle.getMessage(StatusLineComponent.class, "Cancel_Question_Title"); NotifyDescriptor dd = new NotifyDescriptor(message, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, null); Object retType = DialogDisplayer.getDefault().notify(dd); if (retType == NotifyDescriptor.YES_OPTION && hndl.getState() == InternalHandle.STATE_RUNNING) { hndl.requestCancel(); } } }
Example 15
Source File: PropertyPanelInDialogTest.java From netbeans with Apache License 2.0 | 5 votes |
private void invokeDlg() { NotifyDescriptor not = new NotifyDescriptor(currRen, "Boo!", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION}, null); notifyResult = DialogDisplayer.getDefault().notify(not); try { Thread.currentThread().sleep(300); } catch (Exception e){} ExtTestCase.waitForDialog(); }
Example 16
Source File: Manager.java From netbeans with Apache License 2.0 | 5 votes |
/** */ private void offerRescanAfterIssuesFound(final ReplaceTask task) { String msg = NbBundle.getMessage(getClass(), "MSG_IssuesFound_Rescan_"); //NOI18N NotifyDescriptor nd = new NotifyDescriptor.Message( msg, NotifyDescriptor.QUESTION_MESSAGE); String rerunOption = NbBundle.getMessage(getClass(), "LBL_Rerun"); //NOI18N nd.setOptions(new Object[] {rerunOption, NotifyDescriptor.CANCEL_OPTION}); Object dlgResult = DialogDisplayer.getDefault().notify(nd); if (rerunOption.equals(dlgResult)) { /* * The rescan method calls 'scheduleSearchTaskRerun()' on this. * But it will wait until 'taskFinished()' returns, which is * exactly what we need to keep consistency of the manager's fields * like 'currentReplaceTask', 'replaceTask' and 'state'. * Using this mechanism also requires that, when sending a method * to the EventQueue thread, we use invokeLater(...) and not * invokeAndWait(...). */ Mutex.EVENT.writeAccess(new Runnable() { @Override public void run() { task.getPanel().rescan(); } }); } }
Example 17
Source File: VCSCommitPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * 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; }
Example 18
Source File: CommitPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * 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; }
Example 19
Source File: TagManager.java From netbeans with Apache License 2.0 | 4 votes |
private void removeTag (final HgTag tagToRemove) { JButton okButton = new JButton(); Mnemonics.setLocalizedText(okButton, NbBundle.getMessage(CreateTag.class, "CTL_TagManagerPanel.removeTag.okButton.text", tagToRemove.getName())); //NOI18N String title = NbBundle.getMessage(CreateTag.class, "LBL_TagManagerPanel.removeTag.title", tagToRemove.getName()); //NOI18N boolean remove = false; final String removeMessage; if (tagToRemove.isLocal()) { NotifyDescriptor nd = new NotifyDescriptor(NbBundle.getMessage(CreateTag.class, "CTL_TagManagerPanel.removeTag.confirmation.message", tagToRemove.getName()), //NOI18N title, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] { okButton, NotifyDescriptor.CANCEL_OPTION }, okButton); remove = okButton == DialogDisplayer.getDefault().notify(nd); removeMessage = null; } else { if (removePanel == null) { removePanel = new RemoveTagPanel(); } removePanel.lblText.setText(NbBundle.getMessage(CreateTag.class, "CTL_TagManagerPanel.removeTagPanel.text", tagToRemove.getName())); //NOI18N DialogDescriptor dd = new DialogDescriptor(removePanel, title, true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, DialogDescriptor.OK_OPTION, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(CreateTagPanel.class), null); Dialog removeDlg = DialogDisplayer.getDefault().createDialog(dd); removeDlg.setVisible(true); remove = dd.getValue() == okButton; removeMessage = removePanel.txtMessage.getText().trim(); } if (remove) { enableControls(false); HgProgressSupport supp = new HgProgressSupport() { @Override protected void perform () { OutputLogger logger = getLogger(); try { logger.outputInRed(NbBundle.getMessage(TagManager.class, "MSG_DELETE_TAG_TITLE")); //NOI18N logger.outputInRed(NbBundle.getMessage(TagManager.class, "MSG_DELETE_TAG_TITLE_SEP")); //NOI18N logger.output(NbBundle.getMessage(TagManager.class, "MSG_DELETE_TAG_INFO_SEP", tagToRemove.getName(), repository.getAbsolutePath())); //NOI18N HgCommand.removeTag(repository, tagToRemove.getName(), tagToRemove.isLocal(), removeMessage, getLogger()); HgTag[] toReorg = tags; List<HgTag> newTags = new ArrayList<HgTag>(toReorg.length); for (HgTag tag : toReorg) { if (isCanceled()) { return; } if (tag != tagToRemove) { newTags.add(tag); } } synchronized (LOCK) { tags = newTags.toArray(new HgTag[newTags.size()]); } } catch (HgException ex) { HgUtils.notifyException(ex); } finally { logger.outputInRed(NbBundle.getMessage(TagManager.class, "MSG_DELETE_TAG_DONE")); //NOI18N logger.output(""); //NOI18N backgroundSupport = null; EventQueue.invokeLater(new Runnable() { @Override public void run () { enableControls(true); applyFilter(); } }); } } }; backgroundSupport = supp; supp.start(Mercurial.getInstance().getRequestProcessor(repository), repository, NbBundle.getMessage(CreateTag.class, "MSG_TagManagerPanel.removing.progressName", tagToRemove.getName())); //NOI18N } }
Example 20
Source File: DataViewActionHandler.java From netbeans with Apache License 2.0 | 4 votes |
private static Object showYesAllDialog(Object msg, String title) { NotifyDescriptor nd = new NotifyDescriptor(msg, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.NO_OPTION); DialogDisplayer.getDefault().notify(nd); return nd.getValue(); }