com.smartgwt.client.util

## Class Browser

- java.lang.Object
- - com.smartgwt.client.util.Browser

-     public class Browser
      extends java.lang.Object

  The `Browser` class contains various class attributes that indicate basic properties of the browser and whether certain features are enabled.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Browser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `getIsDesktop()` Is the application running in a desktop browser? This is true if `getIsTablet()` and `getIsHandset()` are both `false`.
    `static boolean` | `getIsHandset()` Is the application running on a handset-sized device, with a typical screen width of around 3-4 inches?
    `static boolean` | `getIsTablet()` Is the application running on a tablet device (e.g.
    `static boolean` | `getIsTouch()` Is the application running on a touch device (e.g.
    `static void` | `setIsDesktop(boolean isDesktop)` Setter for `isDesktop` to allow this global variable to be changed at runtime.
    `static void` | `setIsHandset(boolean isHandset)` Setter for `isHandset` to allow this global variable to be changed at runtime.
    `static void` | `setIsTablet(boolean isTablet)` Setter for `isTablet` to allow this global variable to be changed at runtime.
    `static void` | `setIsTouch(boolean isTouch)` Setter for `isTouch` to allow this global variable to be changed at runtime.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Browser

          public Browser()

  - ### Method Detail

    - #### setIsDesktop

          public static void setIsDesktop(boolean isDesktop)

      Setter for `isDesktop` to allow this global variable to be changed at runtime. This advanced method is provided to override Smart GWT's detection of devices, since the framework can only detect devices that existed at the time the platform was released. Any changes to `isDesktop`, `isHandset`, or `isTablet` must be made before any component is created; it is an application error to attempt to change `isDesktop`, `isHandset`, or `isTablet` after components have been created.

      Note that setting `Browser.isDesktop` might affect the values of `isHandset` and `isTablet`.

      Parameters:
        `isDesktop` - new setting for `Browser.isDesktop`.

    - #### setIsHandset

          public static void setIsHandset(boolean isHandset)

      Setter for `isHandset` to allow this global variable to be changed at runtime. This advanced method is provided to override Smart GWT's detection of devices, since the framework can only detect devices that existed at the time the platform was released. Any changes to `isDesktop`, `isHandset`, or `isTablet` must be made before any component is created; it is an application error to attempt to change `isDesktop`, `isHandset`, or `isTablet` after components have been created.

      Note that setting `Browser.isHandset` might affect the values of `isDesktop` and `isTablet`.

      Parameters:
        `isHandset` - new setting for `Browser.isHandset`.

    - #### setIsTablet

          public static void setIsTablet(boolean isTablet)

      Setter for `isTablet` to allow this global variable to be changed at runtime. This advanced method is provided to override Smart GWT's detection of devices, since the framework can only detect devices that existed at the time the platform was released. Any changes to `isDesktop`, `isHandset`, or `isTablet` must be made before any component is created; it is an application error to attempt to change `isDesktop`, `isHandset`, or `isTablet` after components have been created.

      Note that setting `Browser.isTablet` might affect the values of `isDesktop` and `isHandset`.

      Parameters:
        `isTablet` - new setting for `Browser.isTablet`.

    - #### setIsTouch

          public static void setIsTouch(boolean isTouch)

      Setter for `isTouch` to allow this global variable to be changed at runtime. This advanced method is provided to override Smart GWT's auto-detection logic, since the framework can only detect touch devices that existed at the time the platform was released. Any change to `isTouch` must be made before any component is created; it is an application error to attempt to change `isTouch` after components have been created.

      Note that setting `Browser.isTouch` might affect the values of `isDesktop`, `isTablet`, and/or `isHandset`.

      Parameters:
        `isTouch` - new setting for `Browser.isTablet`.

    - #### getIsDesktop

          public static final boolean getIsDesktop()

      Is the application running in a desktop browser? This is true if `getIsTablet()` and `getIsHandset()` are both `false`.
      Returns:
        the value of `Browser.isDesktop`
      See Also:
        `setIsHandset(boolean)`

    - #### getIsHandset

          public static final boolean getIsHandset()

      Is the application running on a handset-sized device, with a typical screen width of around 3-4 inches?

      This typically implies that the application will be working with only 300-400 pixels.

      Returns:
        the value of `Browser.isHandset`
      See Also:
        `setIsHandset(boolean)`

    - #### getIsTablet

          public static final boolean getIsTablet()

      Is the application running on a tablet device (e.g. iPad, Nexus 7)?

      Smart GWT can correctly determine whether the device is a tablet in most cases. On any uncommon device for which this variable is incorrect, you can define the `isc_isTablet` global in the host page with the correct value, and Smart GWT will use `isc_isTablet` for `Browser.isTablet` instead of its own detection logic. Alternatively, you can use `setIsTablet(boolean)` to change this global variable before any components are created.

      Returns:
        the value of `Browser.isTablet`
      See Also:
        `setIsTablet(boolean)`

    - #### getIsTouch

          public static final boolean getIsTouch()

      Is the application running on a touch device (e.g. iPhone, iPad, Android device, etc.)?

      Smart GWT's auto-detected value for `isTouch` can be overridden via `setIsTouch(boolean)`.

      Returns:
        the value of `Browser.isTouch`
      See Also:
        `setIsTouch(boolean)`