當前位置: 首頁>>代碼示例>>Java>>正文


Java NotifyDescriptor.Message方法代碼示例

本文整理匯總了Java中org.openide.NotifyDescriptor.Message方法的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.Message方法的具體用法?Java NotifyDescriptor.Message怎麽用?Java NotifyDescriptor.Message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.NotifyDescriptor的用法示例。


在下文中一共展示了NotifyDescriptor.Message方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setValue

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    try {
        getDataObject().getPrimaryFile().setAttribute(PROPERTY_ENCODING, val);
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }
    PropertiesEditorSupport propertiesEditor = getPropertiesFileEntry().getPropertiesEditor();
    propertiesEditor.resetCharset();
    if (propertiesEditor.hasOpenedEditorComponent()) {
        NotifyDescriptor.Message message = new NotifyDescriptor.Message(
                NbBundle.getMessage(PropertiesDataNode.class, "PROP_ENCODING_Warning", PropertiesDataNode.this.getDisplayName()),
                NotifyDescriptor.WARNING_MESSAGE);

        DialogDisplayer.getDefault().notify(message);
        propertiesEditor.close();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:PropertiesDataNode.java

示例2: commitOrRollback

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void commitOrRollback(String cmdName) {
    if (!error && commit(conn)) {
        long executionTime = System.currentTimeMillis() - startTime;
        String execTimeStr = SQLExecutionHelper.millisecondsToSeconds(executionTime);
        String infoMsg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_execution_success", execTimeStr);
        dataView.setInfoStatusText(infoMsg);
        executeOnSucess(); // delegate 
    } else {
        rollback(conn);
        reinstateToolbar();

        String msg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_failed");
        if (ex == null) {
            errorMsg = msg + " " + errorMsg;
        } else {
            errorMsg = msg;
        }

        ex = new DBException(errorMsg, ex);
        dataView.setErrorStatusText(conn, null, ex);

        NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notify(nd);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:SQLStatementExecutor.java

示例3: createNewActionPerformed

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void createNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createNewActionPerformed
    // TODO add your handling code here:
    NewKeyStore newKeyStore = new NewKeyStore();
    DialogDescriptor dd = new DialogDescriptor(newKeyStore, "New Key Store", true, null);
    newKeyStore.setDescriptor(dd);
    Object notify = DialogDisplayer.getDefault().notify(dd);
    if (DialogDescriptor.OK_OPTION.equals(notify)) {
        String newPath = newKeyStore.getPath();
        char[] password = newKeyStore.getPassword();
        ApkUtils.DN dn = newKeyStore.getDN();
        boolean createNewStore = ApkUtils.createNewStore(null, new File(newPath), password, dn);
        if (!createNewStore) {
            NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to create new key store!", NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notifyLater(nd);
        } else {
            path.setText(newPath);
            keystorePassword.setText(new String(password));
            alias.setText(dn.getAlias());
            keyPassword.setText(new String(dn.getPassword()));
        }
        keyPressed(null);
    }

}
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:25,代碼來源:KeystoreSelector.java

示例4: renameEntry

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/** Renames underlying fileobject. This implementation returns the same file.
 * Overrides superclass method.
 * 
 * @param name full name of the file represented by this entry
 * @return file object with renamed file
 */
@Override
public FileObject renameEntry (String name) throws IOException {

    if (!getFile().getName().startsWith(basicName))
        throw new IllegalStateException("Resource Bundles: error in Properties loader / rename"); // NOI18N

    if (basicName.equals(getFile().getName())) {
        // primary entry - can not rename
        NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
            NbBundle.getBundle(PropertiesDataLoader.class).getString("MSG_AttemptToRenamePrimaryFile"),
            NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notify(msg);
        return getFile();
    }

    FileObject fo = super.rename(name);

    // to notify the bundle structure that name of one file was changed
    ((PropertiesDataObject)getDataObject()).getBundleStructure().notifyOneFileChanged(getHandler());
    
    return fo;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:PropertiesFileEntry.java

示例5: performAction

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
protected void performAction(Node[] activatedNodes) {
    EmulatorControlSupport emulatorControl = activatedNodes[0].getLookup().lookup(EmulatorControlSupport.class);
    if (emulatorControl != null) {
        SmsPanel smsPanel = new SmsPanel();
        NotifyDescriptor nd = new NotifyDescriptor.Confirmation(smsPanel, "Incoming SMS", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE);
        Object notify = DialogDisplayer.getDefault().notify(nd);
        if (NotifyDescriptor.OK_OPTION.equals(notify)) {
            String ok = emulatorControl.getConsole().sendSms(smsPanel.getPhoneNumber(), smsPanel.getText().replace("\\", "\\\\").replace("\n", "\n"));
            if (ok != null) {
                NotifyDescriptor nd1 = new NotifyDescriptor.Message(ok, NotifyDescriptor.ERROR_MESSAGE);
                DialogDisplayer.getDefault().notifyLater(nd1);
            }
        }
    }
}
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:17,代碼來源:IncomingSmsAction.java

示例6: analyzePatternsImpl

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void analyzePatternsImpl(CompilationInfo javac) {
    checkState(1);
    String clsname = javaFile.getName();
    TypeElement clselm = null;
    for (TypeElement top : javac.getTopLevelElements()) {
        if (clsname.contentEquals(top.getSimpleName())) {
            clselm = top;
        }
    }
    
    if (clselm == null) {
        isCancelled = true;
        error = new NotifyDescriptor.Message(
                NbBundle.getMessage(
                        GenerateBeanInfoAction.class,
                        "MSG_FileWitoutTopLevelClass",
                        clsname, FileUtil.getFileDisplayName(javaFile)
                        ),
                NotifyDescriptor.ERROR_MESSAGE);
        return;
    }
    
    PatternAnalyser pa = new PatternAnalyser(javaFile, null, true);
    pa.analyzeAll(javac, clselm);
    // XXX analyze also superclasses here
    try {
        bia = new BiAnalyser(pa, javac);
    } catch (Exception ex) {
        isCancelled = true;
        Exceptions.printStackTrace(ex);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:33,代碼來源:GenerateBeanInfoAction.java

示例7: showTableColumnNameError

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
 * Report an unrecognized table/column name
 */
private void showTableColumnNameError( String error ) {
    String msg = NbBundle.getMessage(QueryBuilder.class, "TABLE_COLUMN_NAME_ERROR");
    NotifyDescriptor d =
        new NotifyDescriptor.Message( error + " : " + msg + "\n\n", NotifyDescriptor.ERROR_MESSAGE);
    DialogDisplayer.getDefault().notify(d);
    _parseErrorMessage = error + " : " + msg + "\n\n" ;
    String query = getSqlText();
    disableVisualEditing(query);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:QueryBuilder.java

示例8: openSearch

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
public void openSearch(final File repository, final File[] roots, final String contextName) {
    String branchName = getActiveBranchName(repository);
    if (branchName.equals(GitBranch.NO_BRANCH)) {
        NotifyDescriptor nd = new NotifyDescriptor.Message(Bundle.MSG_SearchIncomingTopComponent_err_noBranch(),
            NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notify(nd);
        return;
    }
    openSearch(repository, roots, branchName, contextName);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:SearchIncoming.java

示例9: reportInvalidUrl

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void reportInvalidUrl( String location, Throwable ex ) {
    if( null != ex ) {
        Logger.getLogger( WebBrowserImpl.class.getName() ).log( Level.INFO, null, ex );
    }
    NotifyDescriptor nd = new NotifyDescriptor.Message(
            NbBundle.getMessage( WebBrowserImpl.class, "Err_InvalidURL", location),
            NotifyDescriptor.PLAIN_MESSAGE );
    DialogDisplayer.getDefault().notifyLater( nd );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:WebBrowserImpl.java

示例10: taskFinished

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
public void taskFinished(Task task) {
    FileObject modeDir = userDir.get().getFileObject("config/Windows2Local/Modes");
    OutputStream os;
    if (modeDir != null) {
        StringBuilder sb = new StringBuilder();
        try {
            
            FileSystem layer = findLayer(project);
            if (layer == null) {
                throw new IOException("Cannot find layer in " + project); // NOI18N
            }
            for (FileObject m : modeDir.getChildren()) {
                if (m.isData() && "wsmode".equals(m.getExt())) { 
                    final String name = "Windows2/Modes/" + m.getNameExt(); // NOI18N
                    FileObject mode = FileUtil.createData(layer.getRoot(), name); // NOI18N
                    os = mode.getOutputStream();
                    os.write(DesignSupport.readMode(m).getBytes("UTF-8")); // NOI18N
                    os.close();
                    sb.append(name).append("\n");
                }
            }
            NotifyDescriptor nd = new NotifyDescriptor.Message(
                NbBundle.getMessage(DesignSupport.class, "MSG_ModesGenerated", new Object[] {sb}), 
                NotifyDescriptor.INFORMATION_MESSAGE
            );
            DialogDisplayer.getDefault().notifyLater(nd);
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
    EventQueue.invokeLater(this);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:DesignSupport.java

示例11: handleException

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
public final void handleException(Exception ex) {
    LOGGER.log(Level.INFO, null, ex);
    String msg = ex.getLocalizedMessage();
    NotifyDescriptor desc = new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE);
    DialogDisplayer.getDefault().notify(desc);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:AbstractContainerAction.java

示例12: performAction

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/** 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);
          }
      }
  }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:35,代碼來源:LangRenameAction.java

示例13: unregister

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
public void unregister() {
    registerBranch(lapTree, false);
    if (balance != 0) {
        String message = MessageFormat.format("Balance of register/unregister pairs for global listener is {0}, should be 0. If you can reproduce, report.", balance);
        NotifyDescriptor.Message desc = new NotifyDescriptor.Message(message);
        DialogDisplayer.getDefault().notify(desc);
    }
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:9,代碼來源:LapTreeMVElement.java

示例14: noTemplateMessage

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
 *
 */
@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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:DefaultPlugin.java

示例15: createDescriptor

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected NotifyDescriptor createDescriptor(Object msg) {
    return new NotifyDescriptor.Message(msg);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:NotifyLaterTest.java


注:本文中的org.openide.NotifyDescriptor.Message方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。