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


Java NotifyDescriptor.getValue方法代碼示例

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


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

示例1: checkCharsetConversion

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private boolean checkCharsetConversion(final String encoding) {
    boolean value = true;
    try {
        CharsetEncoder coder = Charset.forName(encoding).newEncoder();
        if (!coder.canEncode(getDocument().getText(0, getDocument().getLength()))){
            NotifyDescriptor nd = new NotifyDescriptor.Confirmation(
                    NbBundle.getMessage(XmlMultiViewEditorSupport.class, "MSG_BadCharConversion",
                    new Object [] { getDataObject().getPrimaryFile().getNameExt(),
                    encoding}),
                    NotifyDescriptor.YES_NO_OPTION,
                    NotifyDescriptor.WARNING_MESSAGE);
            nd.setValue(NotifyDescriptor.NO_OPTION);
            DialogDisplayer.getDefault().notify(nd);
            if(nd.getValue() != NotifyDescriptor.YES_OPTION) {
                value = false;
            }
        }
    } catch (BadLocationException e){
        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
    }
    return value;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:XmlMultiViewEditorSupport.java

示例2: big

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@NbBundle.Messages({
    "TTL_ContextView_showBigFile=Show Big File?",
    "# {0} - file name",
    "# {1} - file size in kilobytes",
    "MSG_ContextView_showBigFile=File {0} is quite big ({1} kB).\n"
    + "Showing it can cause memory and performance problems.\n"
    + "Do you want to show content of this file?",
    "LBL_ContextView_Show=Show",
    "LBL_ContextView_Skip=Do Not Show",
    "LBL_ContextView_ApplyAll=Apply to all big files"
})
private void approveFetchingOfBigFile(final MatchingObject mo,
        final int partIndex) {
    FileObject fo = mo.getFileObject();
    long fileSize = fo.getSize() / 1024;
    JButton showButton = new JButton(Bundle.LBL_ContextView_Show());
    JButton skipButton = new JButton(Bundle.LBL_ContextView_Skip());
    JCheckBox all = new JCheckBox(Bundle.LBL_ContextView_ApplyAll());
    all.setSelected(approveApplyToAllSelected);
    JPanel allPanel = new JPanel();
    allPanel.add(all); //Add to panel not to be handled as standard button.
    NotifyDescriptor nd = new NotifyDescriptor(
            Bundle.MSG_ContextView_showBigFile(
            fo.getNameExt(), fileSize),
            Bundle.TTL_ContextView_showBigFile(),
            NotifyDescriptor.YES_NO_OPTION,
            NotifyDescriptor.WARNING_MESSAGE,
            new Object[]{skipButton, showButton},
            lastApproveOption ? showButton : skipButton);
    nd.setAdditionalOptions(new Object[]{allPanel});
    DialogDisplayer.getDefault().notify(nd);
    boolean app = nd.getValue() == showButton;
    APPROVED_FILES.put(fo, app);
    if (all.isSelected()) {
        allApproved = app;
    }
    approveApplyToAllSelected = all.isSelected();
    lastApproveOption = app;
    displayFile(mo, partIndex);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:41,代碼來源:ContextView.java

示例3: printWarning

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
public static boolean printWarning(String message) {
    NotifyDescriptor confirm = new NotifyDescriptor.Confirmation(message, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE);
    DialogDisplayer.getDefault().notify(confirm);
    return confirm.getValue() == NotifyDescriptor.YES_OPTION;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:UI.java

示例4: requestUpdate

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private boolean requestUpdate(String id) {
    NotifyDescriptor desc = new NotifyDescriptor.Confirmation(
            NbBundle.getMessage(UserXMLCatalog.class,"TXT_updateEntry",id),NotifyDescriptor.YES_NO_OPTION);
    DialogDisplayer.getDefault().notify(desc);
    return (NotifyDescriptor.YES_OPTION==desc.getValue());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:UserXMLCatalog.java

示例5: showYesAllDialog

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private static Object showYesAllDialog(Object msg, String title) {
    NotifyDescriptor nd = new NotifyDescriptor(msg, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.NO_OPTION);
    DialogDisplayer.getDefault().notify(nd);
    return nd.getValue();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:DataViewActionHandler.java


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