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


Java DialogWaiter.getDialog方法代碼示例

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


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

示例1: closeAllModal

import org.netbeans.jemmy.DialogWaiter; //導入方法依賴的package包/類
/** Closes all opened modal dialogs. Non-modal stay opened. */
public static void closeAllModal() {
    JDialog dialog;
    ComponentChooser chooser = new ComponentChooser() {

        @Override
        public boolean checkComponent(Component comp) {
            return (comp instanceof JDialog
                    && comp.isShowing()
                    && ((JDialog) comp).isModal());
        }

        @Override
        public String getDescription() {
            return ("Modal dialog");
        }
    };
    while ((dialog = (JDialog) DialogWaiter.getDialog(chooser)) != null) {
        closeDialogs(findBottomDialog(dialog, chooser), chooser);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:JellyTestCase.java

示例2: getTopModalDialog

import org.netbeans.jemmy.DialogWaiter; //導入方法依賴的package包/類
/**
 * Searhs for modal dialog currently staying on top.
 *
 * @return dialog or null if no modal dialog is currently displayed.
 */
public static Dialog getTopModalDialog() {
    return (DialogWaiter.getDialog(new ComponentChooser() {
        @Override
        public boolean checkComponent(Component comp) {
            if (comp instanceof Dialog) {
                Dialog dialog = (Dialog) comp;
                if (dialog.isModal()) {
                    Window[] ow = dialog.getOwnedWindows();
                    for (Window anOw : ow) {
                        if (anOw.isVisible()) {
                            return false;
                        }
                    }
                    return true;
                }
            }
            return false;
        }

        @Override
        public String getDescription() {
            return "Upper modal dialog";
        }

        @Override
        public String toString() {
            return "JDialogOperator.getTopModalDialog.ComponentChooser{description = " + getDescription() + '}';
        }
    }));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:36,代碼來源:JDialogOperator.java

示例3: findJDialog

import org.netbeans.jemmy.DialogWaiter; //導入方法依賴的package包/類
/**
 * Searches an index'th dialog by title.
 *
 * @param title Dialog title
 * @param ce Compare exactly. If true, text can be a substring of caption.
 * @param cc Compare case sensitively. If true, both text and caption are
 * @param index an index between appropriate ones.
 * @return JDialog instance or null if component was not found.
 */
public static JDialog findJDialog(String title, boolean ce, boolean cc, int index) {
    return ((JDialog) DialogWaiter.
            getDialog(new JDialogFinder(new DialogByTitleFinder(title,
                    new DefaultStringComparator(ce, cc))),
                    index));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:16,代碼來源:JDialogOperator.java


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