Search in sources :

Example 11 with TopLevelFrame

use of com.haulmont.cuba.desktop.TopLevelFrame in project cuba by cuba-platform.

the class DesktopComponentsHelper method canRequestFocus.

public static boolean canRequestFocus(java.awt.Component impl) {
    boolean canRequestFocus = true;
    java.awt.Component root = SwingUtilities.getRoot(impl);
    if (root instanceof TopLevelFrame) {
        TopLevelFrame topLevelFrame = (TopLevelFrame) root;
        canRequestFocus = !topLevelFrame.getGlassPane().isVisible();
    } else if (root instanceof DialogWindow) {
        DialogWindow dialogWindow = (DialogWindow) root;
        canRequestFocus = !dialogWindow.getGlassPane().isVisible();
    }
    return canRequestFocus;
}
Also used : TopLevelFrame(com.haulmont.cuba.desktop.TopLevelFrame) DialogWindow(com.haulmont.cuba.desktop.sys.DialogWindow) java.awt(java.awt)

Aggregations

TopLevelFrame (com.haulmont.cuba.desktop.TopLevelFrame)11 DialogWindow (com.haulmont.cuba.desktop.sys.DialogWindow)3 DesktopWindow (com.haulmont.cuba.desktop.gui.components.DesktopWindow)2 Window (com.haulmont.cuba.gui.components.Window)2 File (java.io.File)2 ParamsMap (com.haulmont.bali.util.ParamsMap)1 ClientConfig (com.haulmont.cuba.client.ClientConfig)1 ExceptionReportService (com.haulmont.cuba.core.app.ExceptionReportService)1 Messages (com.haulmont.cuba.core.global.Messages)1 FileInfo (com.haulmont.cuba.gui.upload.FileUploadingAPI.FileInfo)1 User (com.haulmont.cuba.security.entity.User)1 java.awt (java.awt)1 SimpleDateFormat (java.text.SimpleDateFormat)1 HashMap (java.util.HashMap)1 Locale (java.util.Locale)1 JXErrorPane (org.jdesktop.swingx.JXErrorPane)1