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


Java NotifyDescriptor.setValid方法代碼示例

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


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

示例1: showCategoryNameDialog

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private boolean showCategoryNameDialog(CategoryNamePanel panel, String message) {
    categoryNameDialog = new NotifyDescriptor(
            panel,
            message,
            NotifyDescriptor.OK_CANCEL_OPTION,
            NotifyDescriptor.PLAIN_MESSAGE,
            null,
            NotifyDescriptor.OK_OPTION);
    categoryNameDialog.setValid(false);
    if (categoryNameListener == null) {
        categoryNameListener = new CategoryNameDocumentListener();
    }
    panel.addDocumentListener(categoryNameListener);
    boolean confirm = DialogDisplayer.getDefault().notify(categoryNameDialog) == NotifyDescriptor.OK_OPTION;
    panel.removeDocumentListener(categoryNameListener);
    return confirm;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:DashboardTopComponent.java

示例2: addTask

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
public void addTask(TaskNode... taskNodes) {
    final CategoryPicker picker = new CategoryPicker(taskNodes);
    final NotifyDescriptor nd = new NotifyDescriptor(
            picker,
            NbBundle.getMessage(DashboardTopComponent.class, "LBL_AddTaskToCat"), //NOI18N
            NotifyDescriptor.OK_CANCEL_OPTION,
            NotifyDescriptor.PLAIN_MESSAGE,
            null,
            NotifyDescriptor.OK_OPTION);

    picker.setCategoryListener(new CategoryPicker.CategoryComboListener() {
        @Override
        public void comboItemsChanged(boolean categoryAvailable) {
            nd.setValid(categoryAvailable);
        }
    });
    nd.setValid(false);
    if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) {
        Category category = picker.getChosenCategory();
        dashboard.addTaskToCategory(category, taskNodes);
        
        if(!openedByUserAction && !isOpened()) {
            openedByUserAction = true;
            activate();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:DashboardTopComponent.java

示例3: quickSearchTask

import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
public static void quickSearchTask(RepositoryImpl repositoryImpl) {
    JButton open = new JButton(NbBundle.getMessage(DashboardTopComponent.class, "OPTION_Open"));
    open.setEnabled(false);
    JButton cancel = new JButton(NbBundle.getMessage(DashboardTopComponent.class, "OPTION_Cancel"));

    QuickSearchPanel quickSearchPanel = new QuickSearchPanel(repositoryImpl);
    NotifyDescriptor quickSearchDialog = new NotifyDescriptor(
            quickSearchPanel,
            NbBundle.getMessage(DashboardTopComponent.class, "LBL_QuickTitle", repositoryImpl.getDisplayName()), //NOI18N
            NotifyDescriptor.OK_CANCEL_OPTION,
            NotifyDescriptor.PLAIN_MESSAGE,
            new Object[]{open, cancel},
            open);
    quickSearchDialog.setValid(false);
    QuickSearchListener quickSearchListener = new QuickSearchListener(quickSearchPanel, open);
    quickSearchPanel.addQuickSearchListener(quickSearchListener);
    Object result = DialogDisplayer.getDefault().notify(quickSearchDialog);
    if (result == open) {
        IssueImpl issueImpl = quickSearchPanel.getSelectedTask();
        IssueAction.openIssue(issueImpl.getRepositoryImpl(), issueImpl.getID());
        Category selectedCategory = quickSearchPanel.getSelectedCategory();
        if (selectedCategory != null) {
            DashboardViewer.getInstance().addTaskToCategory(selectedCategory, new TaskNode(issueImpl, null));
        }
    }
    quickSearchPanel.removeQuickSearchListener(quickSearchListener);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:DashboardUtils.java


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