本文整理匯總了Java中org.openide.NotifyDescriptor.QUESTION_MESSAGE屬性的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.QUESTION_MESSAGE屬性的具體用法?Java NotifyDescriptor.QUESTION_MESSAGE怎麽用?Java NotifyDescriptor.QUESTION_MESSAGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openide.NotifyDescriptor
的用法示例。
在下文中一共展示了NotifyDescriptor.QUESTION_MESSAGE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: performAction
@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);
}
}
}
}
示例2: clearCategories
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()]));
}
}
示例3: cloudCheckBoxActionPerformed
private boolean cloudCheckBoxActionPerformed(JCheckBox cloudCheckBox, JButton cloudButton){
boolean openSetting = false;
if (cloudCheckBox.isSelected()) {
if (dockerConfigPanel.isDockerActivated()) {
openSetting = true;
} else {
NotifyDescriptor.Confirmation msg = new NotifyDescriptor.Confirmation(
"Would you like to enable the Docker ?",
"Docker not activated", NotifyDescriptor.QUESTION_MESSAGE);
if (NotifyDescriptor.YES_OPTION.equals(DialogDisplayer.getDefault().notify(msg))) {
dockerConfigPanel.activateDocker();
openSetting = true;
}
}
}
loadUI(openSetting, cloudCheckBox, cloudButton);
return openSetting;
}
示例4: searchClassFiles
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
}
}
}
示例5: invokeDlg
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();
}
示例6: canCloseImpl
/** @return 0 => cannot close, -1 can close and do not save, 1 can close and save */
private int canCloseImpl() {
String msg = messageSave();
ResourceBundle bundle = NbBundle.getBundle(CloneableEditorSupport.class);
JButton saveOption = new JButton(bundle.getString("CTL_Save")); // NOI18N
saveOption.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_CTL_Save")); // NOI18N
saveOption.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_CTL_Save")); // NOI18N
JButton discardOption = new JButton(bundle.getString("CTL_Discard")); // NOI18N
discardOption.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_CTL_Discard")); // NOI18N
discardOption.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_CTL_Discard")); // NOI18N
discardOption.setMnemonic(bundle.getString("CTL_Discard_Mnemonic").charAt(0)); // NOI18N
NotifyDescriptor nd = new NotifyDescriptor(
msg, bundle.getString("LBL_SaveFile_Title"), NotifyDescriptor.YES_NO_CANCEL_OPTION,
NotifyDescriptor.QUESTION_MESSAGE,
new Object[] { saveOption, discardOption, NotifyDescriptor.CANCEL_OPTION }, saveOption
);
Object ret = DialogDisplayer.getDefault().notify(nd);
if (NotifyDescriptor.CANCEL_OPTION.equals(ret) || NotifyDescriptor.CLOSED_OPTION.equals(ret)) {
return 0;
}
if (saveOption.equals(ret)) {
return 1;
} else {
return -1;
}
}
示例7: actionPerformed
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();
}
}
}
示例8: actionPerformed
public void actionPerformed(ActionEvent actionEvent) {
if (handle.getState() == InternalHandle.STATE_RUNNING) {
String message = NbBundle.getMessage(ListComponent.class, "Cancel_Question", handle.getDisplayName());
String title = NbBundle.getMessage(ListComponent.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) {
handle.requestCancel();
}
}
}
示例9: removeAllButtonActionPerformed
@Messages({"ManageGroupsPanel.wrn_remove_all_groups_msg=Are you sure to remove all groups?",
"ManageGroupsPanel.wrn_remove_all_groups_title=Confirm remove all groups"})
private void removeAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeAllButtonActionPerformed
NotifyDescriptor d = new NotifyDescriptor.Confirmation(Bundle.ManageGroupsPanel_wrn_remove_all_groups_msg(), Bundle.ManageGroupsPanel_wrn_remove_all_groups_title(), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
if (DialogDisplayer.getDefault().notify(d) == NotifyDescriptor.YES_OPTION) {
removeGroups(Group.allGroups());
}
}
示例10: downloadSdkActionPerformed
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();
}
}
示例11: changeFolderActionPerformed
private void changeFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeFolderActionPerformed
SDKVisualPanelSelect visualPanelSelect = new SDKVisualPanelSelect();
visualPanelSelect.setSdkName(platform.getDisplayName());
NotifyDescriptor nd = new NotifyDescriptor.Confirmation(visualPanelSelect, "Select New Android SDK location", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
Object notify = DialogDisplayer.getDefault().notify(nd);
if (NotifyDescriptor.OK_OPTION.equals(notify)) {
String sdkPath = visualPanelSelect.getSdkPath();
platform.setSdkRootFolder(sdkPath);
listener.sdkValid();
}
}
示例12: canCommit
/**
* 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;
}
示例13: confirm
private boolean confirm (String title, String message) {
NotifyHtmlPanel p = new NotifyHtmlPanel();
p.setText(message);
NotifyDescriptor descriptor = new NotifyDescriptor(
p,
title,
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.QUESTION_MESSAGE,
new Object [] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION },
NotifyDescriptor.YES_OPTION);
return NotifyDescriptor.YES_OPTION == DialogDisplayer.getDefault().notify(descriptor);
}
示例14: run
@NbBundle.Messages({ "TTL_AfterRestartReport=Unexpected Exception on Last Run",
"MSG_AfterRestartReportQuestion=There was an error during the last run of NetBeans IDE.\nCan you please report the problem?",
"BTN_ReviewAndReport=&Review and Report Problem" })
@Override
public void run() {
final Set<LogRecord> records = afterRestartRecords;
String msg = Bundle.MSG_AfterRestartReportQuestion();
String title = Bundle.TTL_AfterRestartReport();
int optionType = NotifyDescriptor.QUESTION_MESSAGE;
JButton reportOption = new JButton();
Mnemonics.setLocalizedText(reportOption, Bundle.BTN_ReviewAndReport());
NotifyDescriptor confMessage = new NotifyDescriptor(msg, title, optionType,
NotifyDescriptor.QUESTION_MESSAGE,
new Object[] { reportOption, NotifyDescriptor.CANCEL_OPTION },
reportOption);
Object ret = DialogDisplayer.getDefault().notify(confMessage);
if (ret == reportOption) {
Installer.RP.post(new Runnable() {
@Override
public void run() {
Installer.displaySummary("ERROR_URL", true, false, true,
Installer.DataType.DATA_UIGESTURE,
new ArrayList<>(records), null, true);
Installer.setSelectedExcParams(null);
afterRestartRecords = null;
}
});
}
}
示例15: confirmDelete
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;
}