本文整理匯總了Java中org.openide.NotifyDescriptor.CLOSED_OPTION屬性的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.CLOSED_OPTION屬性的具體用法?Java NotifyDescriptor.CLOSED_OPTION怎麽用?Java NotifyDescriptor.CLOSED_OPTION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openide.NotifyDescriptor
的用法示例。
在下文中一共展示了NotifyDescriptor.CLOSED_OPTION屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: showDialog
public static boolean showDialog(String displayName, List<ParameterInfo> allParams,
Document targetDoc) {
if (!allParams.isEmpty()) {
boolean showParamTypes = Util.isJava(targetDoc) || Util.isJsp(targetDoc);
CodeSetupPanel panel = new CodeSetupPanel(allParams, showParamTypes);
DialogDescriptor desc = new DialogDescriptor(panel,
NbBundle.getMessage(CodeSetupPanel.class,
"LBL_CustomizeSaasService", displayName));
Dialog d = DialogDisplayer.getDefault().createDialog(desc);
panel.setDialog(d);
d.setVisible(true);
Object response = (desc.getValue() != null) ? desc.getValue() : NotifyDescriptor.CLOSED_OPTION;
if (response.equals(NotifyDescriptor.CANCEL_OPTION) ||
response.equals(NotifyDescriptor.CLOSED_OPTION)) {
return false;
}
}
return true;
}
示例2: stringToNDOption
private static Object stringToNDOption(String string) {
if (string == null) {
return null;
}
if (string.equals("CANCEL_OPTION")) { //NOI18N
return NotifyDescriptor.CANCEL_OPTION;
} else if (string.equals("CLOSED_OPTION")) { //NOI18N
return NotifyDescriptor.CLOSED_OPTION;
} else if (string.equals("NO_OPTION")) { //NOI18N
return NotifyDescriptor.NO_OPTION;
} else if (string.equals("OK_OPTION")) { //NOI18N
return NotifyDescriptor.OK_OPTION;
} else if (string.equals("YES_OPTION")) { //NOI18N
return NotifyDescriptor.YES_OPTION;
}
return null;
}
示例3: storeSettings
@Override
public void storeSettings(WizardDescriptor wd) {
Object value = wd.getValue();
if ( NotifyDescriptor.CANCEL_OPTION != value &&
NotifyDescriptor.CLOSED_OPTION != value ) {
try {
Project newProject = gui.getProject ();
project = newProject;
wd.putProperty(ProjectChooserFactory.WIZARD_KEY_PROJECT, newProject);
if (gui.getTemplate () == null) {
return ;
}
if (wd instanceof TemplateWizard) {
((TemplateWizard)wd).setTemplate( DataObject.find( gui.getTemplate() ) );
} else {
wd.putProperty( ProjectChooserFactory.WIZARD_KEY_TEMPLATE, gui.getTemplate () );
}
}
catch( DataObjectNotFoundException e ) {
ErrorManager.getDefault().notify (e);
}
}
}
示例4: testUserQuestionExceptionDisplayedCancel
public void testUserQuestionExceptionDisplayedCancel() throws Exception {
class UQE extends UserQuestionException {
UQE() {
super("HelloTest");
}
boolean confirm;
@Override
public void confirmed() throws IOException {
confirm = true;
}
@Override
public String getLocalizedMessage() {
return "Reboot?";
}
}
MockDD.reply = NotifyDescriptor.CLOSED_OPTION;
UQE ex = new UQE();
Exceptions.printStackTrace(ex);
waitEDT();
assertNotNull("Dialog created", MockDD.lastDescriptor);
assertEquals("Message is localized text", "Reboot?", MockDD.lastDescriptor.getMessage());
assertFalse("The message has not been confirmed", ex.confirm);
}
示例5: notify
public Object notify(org.openide.NotifyDescriptor descriptor) {
try {
// we need to get into EQ - as the regular DialogDescriptor does
waitEQ();
} catch (Exception ex) {
ex.printStackTrace();
}
return NotifyDescriptor.CLOSED_OPTION;
}
示例6: ndOptionToString
private static String ndOptionToString(Object option) {
if (option == NotifyDescriptor.CANCEL_OPTION) {
return "CANCEL_OPTION"; // NOI18N
} else if (option == NotifyDescriptor.CLOSED_OPTION) {
return "CLOSED_OPTION"; // NOI18N
} else if (option == NotifyDescriptor.NO_OPTION) {
return "NO_OPTION"; // NOI18N
} else if (option == NotifyDescriptor.OK_OPTION) {
return "OK_OPTION"; // NOI18N
} else if (option == NotifyDescriptor.YES_OPTION) {
return "YES_OPTION"; // NOI18N
}
return null;
}
示例7: notify
public Object notify(NotifyDescriptor descriptor) {
return NotifyDescriptor.CLOSED_OPTION;
}
示例8: notify
public Object notify(NotifyDescriptor descriptor) {
notifyCalled = true;
return NotifyDescriptor.CLOSED_OPTION;
}
示例9: notify
public Object notify(NotifyDescriptor descriptor) {
assertNull(d);
d = descriptor;
return NotifyDescriptor.CLOSED_OPTION;
}
示例10: notify
@Override
public Object notify(NotifyDescriptor descriptor) {
assertNull(d);
d = descriptor;
return NotifyDescriptor.CLOSED_OPTION;
}