com.vaadin.terminal.gwt.client.
Class VBrowserDetails
java.lang.Object
com.vaadin.terminal.gwt.client.VBrowserDetails
All Implemented Interfaces:
- extends Object
- implements Serializable
public class VBrowserDetails
Class that parses the user agent string from the browser and provides
information about the browser. Used internally by BrowserInfo
and
WebBrowser
. Should not be used directly.
Since:
6.3
Version:
6.8.18
Author:
Vaadin Ltd.
See Also:
Nested Class Summary | |
---|---|
static class |
VBrowserDetails.OperatingSystem
|
Constructor Summary | |
---|---|
VBrowserDetails(String userAgent)
Create an instance based on the given user agent. |
Method Summary | |
---|---|
float |
getBrowserEngineVersion()
Returns the version of the browser engine. |
int |
getBrowserMajorVersion()
Returns the browser major version e.g., 3 for Firefox 3.5, 4 for Chrome 4, 8 for Internet Explorer 8. |
int |
getBrowserMinorVersion()
Returns the browser minor version e.g., 5 for Firefox 3.5. |
int |
getOperatingSystemMajorVersion()
Returns the major version of the operating system. |
int |
getOperatingSystemMinorVersion()
Returns the minor version of the operating system. |
boolean |
isAndroid()
Tests if the browser is run on Android. |
boolean |
isChrome()
Tests if the browser is Chrome. |
boolean |
isFirefox()
Tests if the browser is Firefox. |
boolean |
isGecko()
Tests if the browser is using the Gecko engine |
boolean |
isIE()
Tests if the browser is Internet Explorer. |
boolean |
isIOS()
Tests if the browser is run in iOS. |
boolean |
isLinux()
Tests if the browser is run on Linux. |
boolean |
isMacOSX()
Tests if the browser is run on Mac OSX. |
boolean |
isOpera()
Tests if the browser is Opera. |
boolean |
isPresto()
Tests if the browser is using the Presto engine |
boolean |
isSafari()
Tests if the browser is Safari. |
boolean |
isTrident()
Tests if the browser is using the Trident engine |
boolean |
isWebKit()
Tests if the browser is using the WebKit engine |
boolean |
isWindows()
Tests if the browser is run on Windows. |
void |
setIEMode(int documentMode)
Sets the version for IE based on the documentMode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
VBrowserDetails
public VBrowserDetails(String userAgent)
- Parameters:
userAgent
- User agent as provided by the browser.
Create an instance based on the given user agent.
Method Detail |
---|
isFirefox
public boolean isFirefox()
- Returns:
- true if it is Firefox, false otherwise
Tests if the browser is Firefox.
isGecko
public boolean isGecko()
- Returns:
- true if it is Gecko, false otherwise
Tests if the browser is using the Gecko engine
isWebKit
public boolean isWebKit()
- Returns:
- true if it is WebKit, false otherwise
Tests if the browser is using the WebKit engine
isPresto
public boolean isPresto()
- Returns:
- true if it is Presto, false otherwise
Tests if the browser is using the Presto engine
isTrident
public boolean isTrident()
- Returns:
- true if it is Trident, false otherwise
- Since:
- 7.1.7
Tests if the browser is using the Trident engine
isSafari
public boolean isSafari()
- Returns:
- true if it is Safari, false otherwise
Tests if the browser is Safari.
isChrome
public boolean isChrome()
- Returns:
- true if it is Chrome, false otherwise
Tests if the browser is Chrome.
isOpera
public boolean isOpera()
- Returns:
- true if it is Opera, false otherwise
Tests if the browser is Opera.
isIE
public boolean isIE()
- Returns:
- true if it is Internet Explorer, false otherwise
Tests if the browser is Internet Explorer.
getBrowserEngineVersion
public float getBrowserEngineVersion()
- Returns:
- The version of the browser engine
Returns the version of the browser engine. For WebKit this is an integer e.g., 532.0. For gecko it is a float e.g., 1.8 or 1.9.
getBrowserMajorVersion
public final int getBrowserMajorVersion()
- Returns:
- The major version of the browser.
Returns the browser major version e.g., 3 for Firefox 3.5, 4 for Chrome 4, 8 for Internet Explorer 8.
Note that Internet Explorer 8 and newer will return the document mode so IE8 rendering as IE7 will return 7.
getBrowserMinorVersion
public final int getBrowserMinorVersion()
- Returns:
- The minor version of the browser, or -1 if not known/parsed.
- See Also:
getBrowserMajorVersion()
Returns the browser minor version e.g., 5 for Firefox 3.5.
setIEMode
public void setIEMode(int documentMode)
- Parameters:
documentMode
- The current document mode
Sets the version for IE based on the documentMode. This is used to return the correct the correct IE version when the version from the user agent string and the value of the documentMode property do not match.
isWindows
public boolean isWindows()
- Returns:
- true if run on Windows, false otherwise
Tests if the browser is run on Windows.
isMacOSX
public boolean isMacOSX()
- Returns:
- true if run on Mac OSX, false otherwise
Tests if the browser is run on Mac OSX.
isLinux
public boolean isLinux()
- Returns:
- true if run on Linux, false otherwise
Tests if the browser is run on Linux.
isAndroid
public boolean isAndroid()
- Returns:
- true if run on Android, false otherwise
Tests if the browser is run on Android.
isIOS
public boolean isIOS()
- Returns:
- true if run in iOS, false otherwise
Tests if the browser is run in iOS.
getOperatingSystemMajorVersion
public int getOperatingSystemMajorVersion()
- Returns:
- The major version or -1 if unknown
Returns the major version of the operating system. Currently only supported for mobile devices (iOS/Android)
getOperatingSystemMinorVersion
public int getOperatingSystemMinorVersion()
- Returns:
- The minor version or -1 if unknown
Returns the minor version of the operating system. Currently only supported for mobile devices (iOS/Android)