本文整理匯總了Java中org.openide.NotifyDescriptor.ERROR_MESSAGE屬性的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.ERROR_MESSAGE屬性的具體用法?Java NotifyDescriptor.ERROR_MESSAGE怎麽用?Java NotifyDescriptor.ERROR_MESSAGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openide.NotifyDescriptor
的用法示例。
在下文中一共展示了NotifyDescriptor.ERROR_MESSAGE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
String id = getIdentifierFromDialog("Name of new AP");
if (id == null) {
return;
}
try {
ActionPattern ap = new ActionPattern(id);
ap.addTriggeredAction(new TriggeredAction("doNothing"));
dataNode.addActionPattern(ap);
} catch (ParseException ex) {
NotifyDescriptor.Message error = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(error);
}
}
示例2: handleDLLException
/**
* If DDL exception was caused by a closed connection, log info and display
* a simple error dialog. Otherwise let users report the exception.
*/
private void handleDLLException(DatabaseConnection dbConn,
DDLException e) throws SQLException, MissingResourceException {
Connection conn = dbConn == null ? null : dbConn.getJDBCConnection();
if (conn != null && !conn.isValid(1000)) {
LOGGER.log(Level.INFO, e.getMessage(), e);
NotifyDescriptor nd = new NotifyDescriptor.Message(
NbBundle.getMessage(
MakeDefaultCatalogAction.class,
"ERR_ConnectionToServerClosed"), //NOI18N
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
} else {
Exceptions.printStackTrace(e);
}
}
示例3: implement
public void implement() throws Exception {
final FileObject file = err.getFile();
if (!file.canWrite()) {
NotifyDescriptor d = new NotifyDescriptor.Message(
NbBundle.getMessage(FixDescription.class, "CTL_File_Not_Writable", file.getNameExt()), //NOI18N
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(d);
return ;
}
fix.implement();
fixed.set(true);
cs.fireChange();
}
示例4: performAction
@Override
protected void performAction(Node[] activatedNodes) {
Node node = activatedNodes[0];
FileObject fo = node.getLookup().lookup(FileObject.class);
if (fo != null) {
FileChooserBuilder builder = new FileChooserBuilder(SaveAsAction.class);
builder.setDirectoriesOnly(false);
builder.setApproveText("Save");
builder.setControlButtonsAreShown(true);
builder.setTitle("Save As...");
builder.setFilesOnly(true);
builder.setFileFilter(new FileNameExtensionFilter(fo.getExt(), fo.getExt()));
JFileChooser chooser = builder.createFileChooser();
chooser.setSelectedFile(new File(fo.getNameExt()));
int resp = chooser.showSaveDialog(findDialogParent());
if (JFileChooser.APPROVE_OPTION == resp) {
File saveFile = chooser.getSelectedFile();
if (saveFile != null) {
try {
saveFile.getParentFile().mkdirs();
FileObject dfo = FileUtil.toFileObject(saveFile.getParentFile());
if (dfo == null) {
NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to Save file!", NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
return;
}
if (saveFile.exists()) {
saveFile.delete();
}
fo.copy(dfo, saveFile.getName(), "");
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
}
}
}
示例5: setPort
/** setter for port */
public void setPort(int p) {
if (p <= 0 || p >65535) {
NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
NbBundle.getMessage(HttpServerSettings.class, "ERR_PortNumberOutOfRange", new Integer(p)), NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(msg);
return;
}
synchronized (httpLock ()) {
getPreferences().putInt(PROP_PORT,p);
restartIfNecessary(true);
}
}
示例6: performAction
public void performAction() {
if (!Util.checkInstallLocation()) {
return;
}
if (!Util.ensureSystemHome()) {
return;
}
String derbySystemHome = DerbyOptions.getDefault().getSystemHome();
CreateSampleDatabasePanel panel = new CreateSampleDatabasePanel(derbySystemHome);
DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(CreateSampleDBAction.class, "LBL_CreateSampleDatabaseTitle"), true, null);
desc.createNotificationLineSupport();
panel.setDialogDescriptor(desc);
Dialog dialog = DialogDisplayer.getDefault().createDialog(desc);
panel.setIntroduction();
String acsd = NbBundle.getMessage(CreateSampleDBAction.class, "ACSD_CreateDatabaseAction");
dialog.getAccessibleContext().setAccessibleDescription(acsd);
dialog.setVisible(true);
dialog.dispose();
if (!DialogDescriptor.OK_OPTION.equals(desc.getValue())) {
return;
}
String databaseName = panel.getDatabaseName();
try {
DerbyDatabasesImpl.getDefault().createSampleDatabase(databaseName, true);
} catch (Exception e) {
LOG.log(Level.INFO, null, e);
LOG.log(Level.INFO, "", e);
NotifyDescriptor nd = new NotifyDescriptor.Message(
"Failed to ceate sample database:\n"
+ e.getLocalizedMessage(),
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
}
}
示例7: performAction
/** Performs action. Overrides superclass method. */
protected void performAction (Node[] activatedNodes) {
Node n = activatedNodes[0]; // we supposed that one node is activated
Node.Cookie cake = n.getCookie(PropertiesLocaleNode.class);
PropertiesLocaleNode pln = (PropertiesLocaleNode)cake;
String lang = Util.getLocaleSuffix(pln.getFileEntry());
if (lang.length() > 0)
if (lang.charAt(0) == PropertiesDataLoader.PRB_SEPARATOR_CHAR)
lang = lang.substring(1);
NotifyDescriptor.InputLine dlg = new NotifyDescriptor.InputLine(
NbBundle.getMessage(LangRenameAction.class,
"LBL_RenameLabel"), //NOI18N
NbBundle.getMessage(LangRenameAction.class,
"LBL_RenameTitle")); //NOI18N
dlg.setInputText(lang);
if (NotifyDescriptor.OK_OPTION.equals(DialogDisplayer.getDefault().notify(dlg))) {
try {
pln.setName(Util.assembleName (pln.getFileEntry().getDataObject().getPrimaryFile().getName(), dlg.getInputText()));
}
catch (IllegalArgumentException e) {
// catch & report badly formatted names
NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
MessageFormat.format(
NbBundle.getBundle("org.openide.actions.Bundle").getString("MSG_BadFormat"),
new Object[] {pln.getName()}),
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(msg);
}
}
}
示例8: notifyErrorMessage
static void notifyErrorMessage(String msg) {
if("true".equals(System.getProperty("netbeans.t9y.throwOnClientError", "false"))) { // NOI18N
Bugzilla.LOG.info(msg);
throw new AssertionError(msg);
}
NotifyDescriptor nd =
new NotifyDescriptor(
msg,
NbBundle.getMessage(BugzillaExecutor.class, "LBLError"), // NOI18N
NotifyDescriptor.DEFAULT_OPTION,
NotifyDescriptor.ERROR_MESSAGE,
new Object[] {NotifyDescriptor.OK_OPTION},
NotifyDescriptor.OK_OPTION);
DialogDisplayer.getDefault().notify(nd);
}
示例9: noTemplateMessage
/**
*
*/
@Messages({"# {0} - template file","MSG_template_not_found=Template file {0} was not found. Check the TestNG templates in the Template manager."})
private static void noTemplateMessage(String temp) {
String msg = Bundle.MSG_template_not_found(temp); //NOI18N
NotifyDescriptor descr = new NotifyDescriptor.Message(
msg,
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(descr);
}
示例10: perform
protected void perform(JavaSource js, JTextComponent pane, int[] selection) {
String error = doPerformAction(js, pane, selection);
if (error != null) {
String errorText = NbBundle.getMessage(IntroduceAction.class, error);
NotifyDescriptor nd = new NotifyDescriptor.Message(errorText, NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
}
}
示例11: replace
/** Replaces current found hard coded string and continue the search for next one. */
private void replace() {
I18nString i18nString = null;
try {
// To call weak without check have to be save here cause strong reference in the top component have to exist.
i18nString = i18nPanelWRef.get().getI18nString();
} catch (IllegalStateException e) {
NotifyDescriptor.Message nd = new NotifyDescriptor.Message(
I18nUtil.getBundle().getString("EXC_BadKey"), //NOI18N
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
return;
}
// Try to add key to bundle.
support.getResourceHolder().addProperty(i18nString.getKey(), i18nString.getValue(), i18nString.getComment());
replaceCount++;
// Provide additional changes if they are available.
if (support.hasAdditionalCustomizer()) {
support.performAdditionalChanges();
}
// Replace hardcoded string.
support.getReplacer().replace(hcString, i18nString);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
skip();
}
});
}
示例12: annotate
public static void annotate (String msg) {
CommandReport report = new CommandReport(NbBundle.getMessage(GitClientExceptionHandler.class, "MSG_SubversionCommandError"), msg); //NOI18N
JButton ok = new JButton(NbBundle.getMessage(GitClientExceptionHandler.class, "CTL_CommandReport_OK")); //NOI18N
NotifyDescriptor descriptor = new NotifyDescriptor(
report,
NbBundle.getMessage(GitClientExceptionHandler.class, "MSG_CommandFailed_Title"), //NOI18N
NotifyDescriptor.DEFAULT_OPTION,
NotifyDescriptor.ERROR_MESSAGE,
new Object [] { ok },
ok);
DialogDisplayer.getDefault().notify(descriptor);
}
示例13: notifyParsingError
/**
* Notifies user of parsing error.
*/
public static void notifyParsingError() {
NotifyDescriptor nd = new NotifyDescriptor(
NbBundle.getMessage(HgModuleConfig.class, "MSG_ParsingError"), // NOI18N
NbBundle.getMessage(HgModuleConfig.class, "LBL_ParsingError"), // NOI18N
NotifyDescriptor.DEFAULT_OPTION,
NotifyDescriptor.ERROR_MESSAGE,
new Object[]{NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION},
NotifyDescriptor.OK_OPTION);
if (EventQueue.isDispatchThread()) {
DialogDisplayer.getDefault().notify(nd);
} else {
DialogDisplayer.getDefault().notifyLater(nd);
}
}
示例14: performAction
@Override
protected void performAction(Node[] activatedNodes) {
if (activatedNodes.length == 1) {
String ipport = activatedNodes[0].getLookup().lookup(String.class);
if (ipport != null) {
if (!NbAndroidAdbHelper.connectEthernet(ipport)) {
NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to connect to " + ipport, NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
}
}
}
}
示例15: changeAliasActionPerformed
private void changeAliasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeAliasActionPerformed
// TODO add your handling code here:
try {
File f = new File(path.getText());
if (f.exists()) {
KeyStore ks = KeyStore.getInstance("jks");
ks.load(new FileInputStream(f), keystorePassword.getPassword());
EditKeyStore editKeyStore = new EditKeyStore(ks, alias.getText());
DialogDescriptor dd = new DialogDescriptor(editKeyStore, "Choose Key", true, null);
editKeyStore.setDescriptor(dd);
Object notify = DialogDisplayer.getDefault().notify(dd);
if (DialogDescriptor.OK_OPTION.equals(notify)) {
if (editKeyStore.isNewKey()) {
ApkUtils.DN dn = editKeyStore.getNewDN();
boolean addNewKey = ApkUtils.addNewKey(ks, f, keystorePassword.getPassword(), dn);
if (!addNewKey) {
NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to save new alias to key store!", NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
} else {
alias.setText(dn.getAlias());
keyPassword.setText(new String(dn.getPassword()));
}
keyPressed(null);
} else {
alias.setText(editKeyStore.getAliasName());
keyPassword.setText("");
}
keyReleased(null);
}
}
} catch (Exception ex) {
}
}