public class Browser
extends java.lang.Object
Browser
class contains various class attributes that indicate basic properties of the browser and
whether certain features are enabled.Constructor and Description |
---|
Browser() |
Modifier and Type | Method and Description |
---|---|
static int |
getDefaultFontIncrease()
Preferred font size increase if none is specified.
|
static int |
getDefaultSizeIncrease()
Preferred control size increase if none is specified.
|
static java.lang.String |
getDefaultSkin()
Preferred default skin if none is specified.
|
static boolean |
getIsDesktop()
Is the application running in a desktop browser? This is true if
isTablet and isHandset 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 |
getIsMultiWindow()
Are the
MultiWindow APIs supported and cross-window optimizations enabled?
By default this is true in the main window if OpenFin is loaded, false otherwise. |
static boolean |
getIsOpenFin()
Are we in an OpenFin environment? See class
OpenFin for ways to call OpenFin methods from within Smart GWT.
|
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 boolean |
getSupportsFlatSkins()
Whether browser is capable of rendering flat skins (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 |
setIsMultiWindow(boolean isMultiWindow)
Sets a non-default value for
isMultiWindow , such as enabling it
even if OpenFin isn't present. |
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. |
public static int getDefaultFontIncrease()
public static int getDefaultSizeIncrease()
public static java.lang.String getDefaultSkin()
public static boolean getIsDesktop()
isTablet
and isHandset
are both false
.public static boolean getIsHandset()
This typically implies that the application will be working with only 300-400 pixels.
public static boolean getIsMultiWindow()
MultiWindow
APIs supported and cross-window optimizations enabled?
By default this is true in the main window
if OpenFin
is loaded, false otherwise. In child windows
, this property is read-only, and assumes the value
from the main window. Note: MultiWindow
is currently an
experimental feature and not supported except by special arrangement
public static boolean getIsOpenFin()
public static boolean getIsTablet()
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 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()
to change this global variable before any components are
created.
The value of this variable is only meaningful on touch devices.
public static boolean getIsTouch()
Smart GWT's auto-detected
value for isTouch
can be overridden via setIsTouch()
.
public static boolean getSupportsFlatSkins()
public static void setIsDesktop(boolean isDesktop)
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
.
isDesktop
- new setting for Browser.isDesktop
.public static void setIsHandset(boolean isHandset)
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
.
isHandset
- new setting for Browser.isHandset
.public static void setIsMultiWindow(boolean isMultiWindow)
isMultiWindow
, such as enabling it
even if OpenFin
isn't present. Note that this method may only be
called from the main window
, and only once.
isMultiWindow
- new setting for Browser.isMultiWindow
.public static void setIsTablet(boolean isTablet)
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
.
isTablet
- new setting for Browser.isTablet
.public static void setIsTouch(boolean isTouch)
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
.
isTouch
- new setting for Browser.isTablet
.