Example usage for com.vaadin.server WebBrowser getBrowserMajorVersion

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

Introduction

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

Prototype

public int getBrowserMajorVersion() 

Source Link

Document

Gets the major version of the browser the user is using.

Usage

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

License:Open Source License

private void deriveBrowserBooleans(WebBrowser webBr) {
    browserApp = webBr.getBrowserApplication();
    browserMiniType = returnBrowserType(webBr);
    browserOS = returnBrowserOS(webBr);/*from  w w  w.  j  a  v a2 s .  co m*/
    browserMajVersion = webBr.getBrowserMajorVersion();
    browserMajVersionString = "" + browserMajVersion;
    browserMinVersion = webBr.getBrowserMinorVersion();
    browserAddress = webBr.getAddress();

    if (browserApp.contains("MSIE 7.0")) {
        internetExplorer = true;
        if (browserMajVersion <= 7)
            internetExplorer7 = true;
    }
}

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

License:Open Source License

/**
 * Permet d'obtenir le nom du navigateur en clair
 *//*from   ww w .  java2s .  c o  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 ww  w.j a  v  a2  s  .  c  om
    }

    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);
    }// ww w. j  a  va2 s .  co 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

    ///*from   ww  w.  ja  v a 2s .com*/
    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  w  ww  .j  a v  a2  s  .  c  o m*/
    return false;
}