Example usage for com.vaadin.server WebBrowser isIE

List of usage examples for com.vaadin.server WebBrowser isIE

Introduction

In this page you can find the example usage for com.vaadin.server WebBrowser isIE.

Prototype

public boolean isIE() 

Source Link

Document

Tests whether the user is using Internet Explorer.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.CubaPickerField.java

License:Apache License

protected void initLayout() {
    container = new CubaCssActionsLayout();
    container.setPrimaryStyleName("c-pickerfield-layout");

    field.setWidth(100, Unit.PERCENTAGE);

    Page current = Page.getCurrent();// w  w  w .  j av  a2  s. c o m
    if (current != null) {
        WebBrowser browser = current.getWebBrowser();
        if (browser != null
                && (browser.isIE() && browser.getBrowserMajorVersion() <= 10 || browser.isSafari())) {
            ie9InputWrapper = new CssLayout();
            ie9InputWrapper.setWidth(100, Unit.PERCENTAGE);
            ie9InputWrapper.setPrimaryStyleName("ie9-input-wrap");
            ie9InputWrapper.addComponent(field);

            container.addComponent(ie9InputWrapper);
        } else {
            container.addComponent(field);
        }
    } else {
        container.addComponent(field);
    }

    if (App.isBound()) {
        ThemeConstants theme = App.getInstance().getThemeConstants();
        setWidth(theme.get("cuba.web.CubaPickerField.width"));
    }

    setFocusDelegate(field);
}

From source file:de.unioninvestment.eai.portal.portlet.crud.CrudUI.java

License:Apache License

private void provideBackButtonFunctionality(String portletId) {
    WebBrowser browser = getPage().getWebBrowser();
    if (browser != null && !browser.isIE()) {
        portletUriFragmentUtility = new PortletUriFragmentUtility(eventBus, portletDomain, portletId);
    } else {/*w w  w  . j a va2  s  .c o m*/
        LOG.info("Browser not detected or is Internet Explorer. Disabling back button functionality");
        // ...weil sie zu einem unschnen Refresh des Browsers
        // fhrt
    }
}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.DefaultTableView.java

License:Apache License

private boolean automaticDownloadIsPossible() {
    WebBrowser browser = Page.getCurrent().getWebBrowser();
    return browser != null && !browser.isIE();
}

From source file:edu.nps.moves.mmowgli.MmowgliSessionGlobals.java

License:Open Source License

private String returnBrowserType(WebBrowser webBr) {
    if (webBr.isFirefox()) {
        return "Firefox";
    }/*  w  ww  .  j av  a 2  s. co m*/
    if (webBr.isSafari()) {
        return "Safari";
    }
    if (webBr.isIE()) {
        return "IE";
    }
    if (webBr.isChrome()) {
        return "Chrome";
    }
    if (webBr.isOpera()) {
        return "Opera";
    }
    if (webBr.isLinux()) {
        return "Linux";
    }
    if (webBr.isAndroid()) {
        return "Android";
    }
    if (webBr.isIPhone()) {
        return "IPhone";
    }
    if (webBr.isIPad()) {
        return "IPad";
    }
    if (webBr.isIOS()) {
        return "IOS";
    }
    return "";
}

From source file:fr.amapj.service.services.session.SessionManager.java

License:Open Source License

/**
 * Permet d'obtenir le nom du navigateur en clair
 *//*www  .jav a 2s.co m*/
public static String getAgentName(UI ui) {
    if (ui.getSession() == null) {
        return "Session null";
    }

    WebBrowser browser = ui.getPage().getWebBrowser();
    if (browser.isChrome()) {
        return "Chrome " + browser.getBrowserMajorVersion();
    } else if (browser.isFirefox()) {
        return "Firefox " + browser.getBrowserMajorVersion();
    } else if (browser.isIE()) {
        return "IE " + browser.getBrowserMajorVersion();
    } else if (browser.isOpera()) {
        return "Opera " + browser.getBrowserMajorVersion();
    } else if (browser.isSafari()) {
        return "Safari " + browser.getBrowserMajorVersion();
    } else if (browser.isEdge()) {
        return "Edge " + browser.getBrowserMajorVersion();
    } else {
        return "XX";
    }
}

From source file:fr.amapj.view.engine.grid.booleangrid.PopupBooleanGrid.java

License:Open Source License

private int getPageLength() {
    WebBrowser webBrowser = UI.getCurrent().getPage().getWebBrowser();
    int pageLength = 15;

    // Pour ie 8 et infrieur : on se limite a 6 lignes, sinon ca rame trop
    if (webBrowser.isIE() && webBrowser.getBrowserMajorVersion() < 9) {
        pageLength = 6;/*from  www  .j  a v a2s.  c  o  m*/
    }

    pageLength = Math.min(pageLength, param.nbLig);
    return pageLength;
}

From source file:fr.amapj.view.engine.grid.currencyvector.PopupCurrencyVector.java

License:Open Source License

private int getPageLength() {
    Page page = UI.getCurrent().getPage();
    int pageLength = 15;

    // On limite le nombre de ligne pour ne pas avoir une double scroolbar

    // Une ligne fait 32 en mode edition , sinon 26
    int lineHeight = param.readOnly ? 26 : 32;

    // On cacule la place cosomme par les headers, boutons, ...
    // 365 : nombre de pixel mesure pour les haeders, les boutons, ... en mode normal, 270 en mode compact
    int headerAndButtonHeight = BaseUiTools.isCompactMode() ? 270 : 365;

    int maxLineAvailable = (page.getBrowserWindowHeight() - headerAndButtonHeight) / lineHeight;

    // Il y a au moins 4 lignes visibles
    maxLineAvailable = Math.max(maxLineAvailable, 4);
    pageLength = Math.min(pageLength, maxLineAvailable);

    // Pour ie 8 et infrieur : on se limite a 6 lignes, sinon ca rame trop
    WebBrowser webBrowser = UI.getCurrent().getPage().getWebBrowser();
    if (webBrowser.isIE() && webBrowser.getBrowserMajorVersion() < 9) {
        pageLength = Math.min(pageLength, 6);
    }//  w ww .j a  v a 2  s  . c o m

    //
    pageLength = Math.min(pageLength, param.nbLig);
    return pageLength;

}

From source file:fr.amapj.view.engine.grid.integergrid.PopupIntegerGrid.java

License:Open Source License

private int getPageLength() {
    Page page = UI.getCurrent().getPage();
    int pageLength = 15;

    // On limite le nombre de ligne pour ne pas avoir une double scroolbar

    ///*www. j a v  a 2 s. co m*/
    int lineHeight = getLineHeight(param.readOnly);

    // On cacule la place consomme par les headers, boutons, ...
    int headerAndButtonHeight = getHeaderHeight();

    int maxLineAvailable = (page.getBrowserWindowHeight() - headerAndButtonHeight) / lineHeight;

    // Il y a au moins 4 lignes visibles
    maxLineAvailable = Math.max(maxLineAvailable, 4);
    pageLength = Math.min(pageLength, maxLineAvailable);

    // Pour ie 8 et infrieur : on se limite a 6 lignes, sinon ca rame trop
    WebBrowser webBrowser = UI.getCurrent().getPage().getWebBrowser();
    if (webBrowser.isIE() && webBrowser.getBrowserMajorVersion() < 9) {
        pageLength = Math.min(pageLength, 6);
    }

    //
    pageLength = Math.min(pageLength, param.nbLig);

    return pageLength;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private static boolean isUnsupportedBrowser() {
    final WebBrowser webBrowser = Page.getCurrent().getWebBrowser();
    return webBrowser.isIE() && webBrowser.getBrowserMajorVersion() < 11;
}

From source file:org.eclipse.hawkbit.ui.login.LoginView.java

License:Open Source License

private boolean isUnsupportedBrowser() {
    final WebBrowser webBrowser = Page.getCurrent().getWebBrowser();
    if (webBrowser.isIE() && webBrowser.getBrowserMajorVersion() < 11) {
        return true;
    }//from  ww w .  jav  a2  s  .  c  o  m
    return false;
}