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


Java NotifyDescriptor.setTitle方法代碼示例

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


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

示例1: checkExistingDatabase

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
 * Check to see if a database already exists, and raise a message to
 * the user if it does.
 * 
 * @return true if it's OK to continue or false to cancel
 */
private static boolean checkExistingDatabase(
        DatabaseServer server, String dbname) throws DatabaseException {
    if ( ! server.databaseExists(dbname)) {
        return true;
    }
         
   NotifyDescriptor ndesc = new NotifyDescriptor.Message(
            NbBundle.getMessage(CreateDatabasePanel.class, 
                    "CreateNewDatabasePanel.MSG_DatabaseAlreadyExists",
                dbname));
   ndesc.setTitle(NbBundle.getMessage(CreateDatabasePanel.class,
                "CreateNewDatabasePanel.STR_DatabaseExistsTitle"));

   DialogDisplayer.getDefault().notify(ndesc);

   return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:CreateDatabasePanel.java

示例2: performContextAction

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void performContextAction(final Node[] nodes) {
    NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(DeleteLocalAction.class, "CTL_DeleteLocal_Prompt")); // NOI18N
    descriptor.setTitle(NbBundle.getMessage(DeleteLocalAction.class, "CTL_DeleteLocal_Title")); // NOI18N
    descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
    descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);

    Object res = DialogDisplayer.getDefault().notify(descriptor);
    if (res != NotifyDescriptor.YES_OPTION) {
        return;
    }
    
    final Context ctx = getContext(nodes);
    ProgressSupport support = new ContextAction.ProgressSupport(this, nodes, ctx) {
        public void perform() {
            performDelete(ctx, this);
        }
    };
    support.start(createRequestProcessor(ctx));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:DeleteLocalAction.java

示例3: showDialog

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

示例4: harness

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Messages({
    "ERR_harness_too_old=You are attempting to build a module or suite project which uses a new metadata format with an old version of the module build harness which does not understand this format. You may either choose a newer NetBeans platform, or switch the harness used by the selected platform to use a newer harness (try using the harness supplied with the IDE).",
    "TITLE_harness_too_old=Harness Too Old"
})
static void promptForNewerHarness() {
    // #82388: warn the user that the harness version is too low.
    NotifyDescriptor d = new NotifyDescriptor.Message(ERR_harness_too_old(), NotifyDescriptor.ERROR_MESSAGE);
    d.setTitle(TITLE_harness_too_old());
    DialogDisplayer.getDefault().notify(d);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:ModuleActions.java

示例5: alert

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
 * Display an alert asking the user whether to really generate a target.
 * @param commandDisplayName the display name of the action to be bound
 * @param scriptPath the path that to the script that will be generated or written to
 * @return true if IDE should proceed
 */
private boolean alert(String commandDisplayName, String scriptPath) {
    String projectDisplayName = ProjectUtils.getInformation(project).getDisplayName();
    String title = NbBundle.getMessage(JavaActions.class, "TITLE_generate_target_dialog", commandDisplayName, projectDisplayName);
    String body = NbBundle.getMessage(JavaActions.class, "TEXT_generate_target_dialog", commandDisplayName, scriptPath);
    NotifyDescriptor d = new NotifyDescriptor.Message(body, NotifyDescriptor.QUESTION_MESSAGE);
    d.setTitle(title);
    d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);
    JButton generate = new JButton(NbBundle.getMessage(JavaActions.class, "LBL_generate"));
    generate.setDefaultCapable(true);
    d.setOptions(new Object[] {generate, NotifyDescriptor.CANCEL_OPTION});
    return DialogDisplayer.getDefault().notify(d) == generate;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:JavaActions.java

示例6: removeLocalesActionPerformed

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void removeLocalesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeLocalesActionPerformed
    Object[] selectedValues = localesList.getSelectedValues();

    String basicName = propDataObject.getPrimaryFile().getName();
    basicName = Util.getBaseName(basicName);
    
    NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(BundleNodeCustomizer.class, "CTL_Deletebundle_Prompt"));
    descriptor.setTitle(NbBundle.getMessage(BundleNodeCustomizer.class, "CTL_Deletebundle_Title"));
    descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
    descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);

    Object res = DialogDisplayer.getDefault().notify(descriptor);
    if (res != NotifyDescriptor.YES_OPTION) {
        return;
    }

    for(int i=0; i<selectedValues.length; i++) {
        PropertiesFileEntry entry = propDataObject.getBundleStructure().getEntryByFileName(basicName + PropertiesDataLoader.PRB_SEPARATOR_CHAR + selectedValues[i].toString());
        try {
            entry.delete();
            if (!propDataObject.isValid()) {
                propDataObject = Util.findPrimaryDataObject(propDataObject);
                nameText.setText(propDataObject.getName());
            }
        } catch(IOException ioe) {
            org.openide.ErrorManager.getDefault().notify(org.openide.ErrorManager.INFORMATIONAL, ioe);
        }
    }
    
    localesList.setListData(retrieveLocales(propDataObject));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:32,代碼來源:BundleNodeCustomizer.java

示例7: displayConfirmation

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
public Boolean displayConfirmation(String message, String caption, boolean cancellable) {
    NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message,
            cancellable ? NotifyDescriptor.YES_NO_CANCEL_OPTION : NotifyDescriptor.YES_NO_OPTION);
    if (caption != null) nd.setTitle(caption);
    Object ret = DialogDisplayer.getDefault().notify(nd);
    if (ret == NotifyDescriptor.YES_OPTION) return Boolean.TRUE;
    if (ret == NotifyDescriptor.NO_OPTION) return Boolean.FALSE;
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:ProfilerDialogsProviderImpl.java

示例8: displayMessage

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void displayMessage(String message, String caption, String details, int type) {
    Object msg = message;
    Object det = details;
    if (isHtmlString(message)) msg = new NBHTMLLabel(message);
    if (isHtmlString(details)) det = new NBHTMLLabel(message);
    NotifyDescriptor nd = det == null ? new NotifyDescriptor.Message(msg, type) :
                    new ProfilerDialogs.MessageWithDetails(msg, det, type, false);
    if (caption != null) nd.setTitle(caption);
    ProfilerDialogs.notify(nd);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:ProfilerDialogsProviderImpl.java

示例9: commitAfterMerge

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private static boolean commitAfterMerge (boolean locallyModifiedExcluded, File repository) {
    // XXX consider usage of repository to determine if there are any non-included files which have to be committed, too
    // and thus removing the option HgModuleConfig.getDefault().getConfirmCommitAfterMerge()
    if (locallyModifiedExcluded || HgModuleConfig.getDefault().getConfirmCommitAfterMerge()) { // ask before commit?
        NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_QUERY")); // NOI18N
        descriptor.setTitle(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_TITLE")); // NOI18N
        descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
        descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);

        Object res = DialogDisplayer.getDefault().notify(descriptor);
        return res == NotifyDescriptor.YES_OPTION;
    }
    return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:CommitAction.java

示例10: performAction

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
protected void performAction(Node[] activatedNodes) {
    for (Node activatedNode : activatedNodes) {
        DevicesNode.MobileDeviceHolder holder = activatedNode.getLookup().lookup(DevicesNode.MobileDeviceHolder.class);
        if (holder != null) {
            List<AdbTools.IpRecord> deviceIps = AdbTools.getDeviceIps(holder.getUsb(), true);
            JTable table = new JTable(new DeviceIpListTablemodel(deviceIps));
            JScrollPane pane = new JScrollPane(table);
            NotifyDescriptor nd = new NotifyDescriptor.Message(pane, NotifyDescriptor.INFORMATION_MESSAGE);
            nd.setTitle(holder.getSerialNumber() + " IP list");
            DialogDisplayer.getDefault().notifyLater(nd);
        }
    }
}
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:15,代碼來源:IpListActions.java

示例11: performAction

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void performAction(Node[] nodes) {
    Node node = nodes[ 0 ];
    FileObject fo = node.getLookup().lookup( FileObject.class );
    Project proj = node.getLookup().lookup(Project.class);
    String origLoc = (String) node.getValue(
            JAXBWizModuleConstants.ORIG_LOCATION);
    Boolean origLocIsURL = (Boolean) node.getValue(
            JAXBWizModuleConstants.ORIG_LOCATION_TYPE);
    FileObject locSchemaRoot = (FileObject) node.getValue(
            JAXBWizModuleConstants.LOC_SCHEMA_ROOT);
    
    if ( ( fo != null ) && ( origLoc != null ) ) {
        // XXX TODO run in separate non-awt thread.
         try {
             if (fo.canWrite()){
                 if (origLocIsURL){
                    URL url = new URL(origLoc);
                     ProjectHelper.retrieveResource(locSchemaRoot, 
                             url.toURI());                        
                 } else {
                     File projDir = FileUtil.toFile(
                             proj.getProjectDirectory());
                     //File srcFile = new File(origLoc);
                     File srcFile = FileSysUtil.Relative2AbsolutePath(
                             projDir, origLoc);
                     ProjectHelper.retrieveResource(fo.getParent(), 
                             srcFile.toURI());
                 }
             } else {
                 String msg = NbBundle.getMessage(this.getClass(),
                         "MSG_CanNotRefreshFile"); //NOI18N
                 NotifyDescriptor d = new NotifyDescriptor.Message(
                         msg, NotifyDescriptor.INFORMATION_MESSAGE);
                 d.setTitle(NbBundle.getMessage(this.getClass(), 
                         "LBL_RefreshFile")); //NOI18N
                 DialogDisplayer.getDefault().notify(d);
             }
         } catch (Exception ex){
             log(ex);
         } 
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:43,代碼來源:JAXBRefreshAction.java

示例12: showSaveError

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void showSaveError(String errMsg) {
    NotifyDescriptor errDialog
            = new NotifyDescriptor.Message(errMsg, ERROR_MESSAGE);
    errDialog.setTitle(getMessage("MSG_Title_SavingError"));        //NOI18N
    DialogDisplayer.getDefault().notify(errDialog);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:FilesModifiedConfirmation.java


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