List of usage examples for com.vaadin.server WebBrowser isSafari
public boolean isSafari()
From source file:com.haulmont.cuba.web.exception.ExceptionDialog.java
License:Apache License
protected boolean browserSupportCopy() { WebBrowser webBrowser = Page.getCurrent().getWebBrowser(); return !webBrowser.isSafari() && !webBrowser.isIOS() && !webBrowser.isWindowsPhone(); }
From source file:com.haulmont.cuba.web.gui.components.CubaCurrencyField.java
License:Apache License
protected boolean useWrapper() { Page current = Page.getCurrent();/* w w w . ja v a2 s . co m*/ if (current != null) { WebBrowser browser = current.getWebBrowser(); return browser != null && (browser.isIE() && browser.getBrowserMajorVersion() <= 10 || browser.isSafari()); } else { return false; } }
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 a va 2s. co 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:edu.nps.moves.mmowgli.MmowgliSessionGlobals.java
License:Open Source License
private String returnBrowserType(WebBrowser webBr) { if (webBr.isFirefox()) { return "Firefox"; }/*from ww w . j a v a2s . c o 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 *//*from w ww .j a v a 2 s . 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:org.vaadin.tori.component.BBCodeWysiwygEditor.java
License:Apache License
private void configurePlugins(final CKEditorConfig config, final boolean autoGrow, final boolean bbcode) { if (bbcode) { config.addToExtraPlugins("custombbcode"); }/*from www . j a v a2 s. com*/ config.addToExtraPlugins("codebutton"); config.addToRemovePlugins("magicline"); WebBrowser browser = Page.getCurrent().getWebBrowser(); boolean disableResizer = true; if (autoGrow) { if (browser.isChrome() || browser.isSafari() || browser.isOpera()) { config.addToExtraPlugins("autogrow"); } else { disableResizer = false; } } if (disableResizer) { config.disableResizeEditor(); } }