com.itmill.toolkit.terminal.web
Class WebBrowser

java.lang.Object
  extended by com.itmill.toolkit.terminal.web.WebBrowser
All Implemented Interfaces:
Terminal

public class WebBrowser
extends Object
implements Terminal

Web browser terminal type. This class implements web browser properties, which declare the features of the web browser.

Since:
3.0
Version:
4.1.4
Author:
IT Mill Ltd.

Nested Class Summary
 class WebBrowser.JavaScriptVersion
           
 class WebBrowser.MarkupVersion
           
 class WebBrowser.RenderingMode
           
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Terminal
Terminal.ErrorEvent, Terminal.ErrorListener
 
Field Summary
static WebBrowser.JavaScriptVersion ECMA_262
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_0
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_1
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_2
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_3
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_4
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_1_5
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_NONE
           
static WebBrowser.JavaScriptVersion JAVASCRIPT_UNCHECKED
           
static WebBrowser.JavaScriptVersion[] JAVASCRIPT_VERSIONS
           
static WebBrowser.JavaScriptVersion JSCRIPT_1_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_3_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_4_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_0
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_1
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_5
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_6
           
static WebBrowser.JavaScriptVersion JSCRIPT_5_7
           
static WebBrowser.MarkupVersion MARKUP_HTML_2_0
           
static WebBrowser.MarkupVersion MARKUP_HTML_3_2
           
static WebBrowser.MarkupVersion MARKUP_HTML_4_0
           
static WebBrowser.MarkupVersion MARKUP_UNKNOWN
           
static WebBrowser.MarkupVersion[] MARKUP_VERSIONS
           
static WebBrowser.MarkupVersion MARKUP_WML_1_0
           
static WebBrowser.MarkupVersion MARKUP_WML_1_1
           
static WebBrowser.MarkupVersion MARKUP_WML_1_2
           
static WebBrowser.MarkupVersion MARKUP_XHTML_1_0
           
static WebBrowser.MarkupVersion MARKUP_XHTML_2_0
           
static WebBrowser.RenderingMode RENDERING_MODE_AJAX
           
static WebBrowser.RenderingMode RENDERING_MODE_HTML
           
static WebBrowser.RenderingMode RENDERING_MODE_UNDEFINED
           
 
Constructor Summary
WebBrowser()
          Constructor WebBrowserType.
 
Method Summary
 boolean equals(Object obj)
          Tests the equality of the properties for two web browser types.
 String getBrowserApplication()
          Gets the name and version of the web browser application.
 String getContentType()
          Gets the preferred content type.
 Locale getDefaultLocale()
          Gets the default locale requested by the browser.
 String getDefaultTheme()
          Gets the name of the default theme.
 WebBrowser.JavaScriptVersion getJavaScriptVersion()
          Gets the version of the supported Java Script by the browser.
 Collection getLocales()
          Returns the locales supported by the web browser.
 WebBrowser.MarkupVersion getMarkupVersion()
          Gets the supported markup language.
 WebBrowser.RenderingMode getRenderingMode()
          Gets the current rendering mode.
 int getScreenHeight()
          Gets the height of the terminal window in pixels.
 int getScreenWidth()
          Gets the width of the terminal window in pixels.
 int hashCode()
          Hash code composed of the properties of the web browser type.
 boolean isClientSideChecked()
          Gets the client side cheked property.
 boolean isFrameSupport()
          Does the browser support frames ?
 boolean isJavaEnabled()
          Checks if web browser supports Java.
static WebBrowser.MarkupVersion parseHTMLVersion(String html)
          Parses HTML version from string.
static WebBrowser.JavaScriptVersion parseJavaScriptVersion(String js)
          Parse JavaScript version from string.
 boolean performClientCheck()
          Should the client features be checked using remote scripts.
 void performClientCheck(boolean value)
          Should the client features be checked using remote scripts.
 void setBrowserApplication(String browserApplication)
          Sets the browser application.
 void setClientSideChecked(boolean value)
          Sets the client side checked property.
 void setContentType(String contentType)
          Sets the default content type.
 void setFrameSupport(boolean frameSupport)
          Sets the browser frame support.
 void setJavaEnabled(boolean javaEnabled)
          Sets the java enabled property.
 void setJavaScriptVersion(WebBrowser.JavaScriptVersion javaScriptVersion)
          Sets the JavaScript version.
 void setMarkupVersion(WebBrowser.MarkupVersion markupVersion)
          Sets the markup language version.
 void setRenderingMode(WebBrowser.RenderingMode renderingMode)
          Sets the current rendering mode.
 void setScreenHeight(int screenHeight)
          Sets the screen height.
 void setScreenWidth(int screenWidth)
          Sets the screen width.
 boolean supports(String browser)
          Checks if this type supports also given browser.
 boolean supports(WebBrowser.JavaScriptVersion js)
          Checks if this type supports given javascript version.
 boolean supports(WebBrowser.MarkupVersion html)
          Checks if this type supports given markup language version.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MARKUP_UNKNOWN

public static final WebBrowser.MarkupVersion MARKUP_UNKNOWN

MARKUP_HTML_2_0

public static final WebBrowser.MarkupVersion MARKUP_HTML_2_0

MARKUP_HTML_3_2

public static final WebBrowser.MarkupVersion MARKUP_HTML_3_2

MARKUP_HTML_4_0

public static final WebBrowser.MarkupVersion MARKUP_HTML_4_0

MARKUP_XHTML_1_0

public static final WebBrowser.MarkupVersion MARKUP_XHTML_1_0

MARKUP_XHTML_2_0

public static final WebBrowser.MarkupVersion MARKUP_XHTML_2_0

MARKUP_WML_1_0

public static final WebBrowser.MarkupVersion MARKUP_WML_1_0

MARKUP_WML_1_1

public static final WebBrowser.MarkupVersion MARKUP_WML_1_1

MARKUP_WML_1_2

public static final WebBrowser.MarkupVersion MARKUP_WML_1_2

MARKUP_VERSIONS

public static final WebBrowser.MarkupVersion[] MARKUP_VERSIONS

JAVASCRIPT_UNCHECKED

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_UNCHECKED

JAVASCRIPT_NONE

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_NONE

JAVASCRIPT_1_0

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_0

JAVASCRIPT_1_1

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_1

JAVASCRIPT_1_2

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_2

JAVASCRIPT_1_3

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_3

JAVASCRIPT_1_4

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_4

JAVASCRIPT_1_5

public static final WebBrowser.JavaScriptVersion JAVASCRIPT_1_5

JSCRIPT_1_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_1_0

JSCRIPT_3_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_3_0

JSCRIPT_4_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_4_0

JSCRIPT_5_0

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_0

JSCRIPT_5_1

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_1

JSCRIPT_5_5

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_5

JSCRIPT_5_6

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_6

JSCRIPT_5_7

public static final WebBrowser.JavaScriptVersion JSCRIPT_5_7

ECMA_262

public static final WebBrowser.JavaScriptVersion ECMA_262

JAVASCRIPT_VERSIONS

public static final WebBrowser.JavaScriptVersion[] JAVASCRIPT_VERSIONS

RENDERING_MODE_UNDEFINED

public static final WebBrowser.RenderingMode RENDERING_MODE_UNDEFINED

RENDERING_MODE_HTML

public static final WebBrowser.RenderingMode RENDERING_MODE_HTML

RENDERING_MODE_AJAX

public static final WebBrowser.RenderingMode RENDERING_MODE_AJAX
Constructor Detail

WebBrowser

public WebBrowser()
Constructor WebBrowserType. Creates a default WebBrowserType instance.

Method Detail

getDefaultTheme

public String getDefaultTheme()
Gets the name of the default theme.

Specified by:
getDefaultTheme in interface Terminal
Returns:
the Name of the terminal window.

getBrowserApplication

public String getBrowserApplication()
Gets the name and version of the web browser application. This is the version string reported by the web-browser in http headers.

Returns:
the Web browser application.

getJavaScriptVersion

public WebBrowser.JavaScriptVersion getJavaScriptVersion()
Gets the version of the supported Java Script by the browser. Null if the Java Script is not supported.

Returns:
the Version of the supported Java Script.

isFrameSupport

public boolean isFrameSupport()
Does the browser support frames ?

Returns:
true if the browser supports frames, otherwise false.

setFrameSupport

public void setFrameSupport(boolean frameSupport)
Sets the browser frame support.

Parameters:
frameSupport - True if the browser supports frames, False if not.

getMarkupVersion

public WebBrowser.MarkupVersion getMarkupVersion()
Gets the supported markup language.

Returns:
the Supported markup language

getScreenHeight

public int getScreenHeight()
Gets the height of the terminal window in pixels.

Specified by:
getScreenHeight in interface Terminal
Returns:
the Height of the terminal window.

getScreenWidth

public int getScreenWidth()
Gets the width of the terminal window in pixels.

Specified by:
getScreenWidth in interface Terminal
Returns:
the Width of the terminal window.

getDefaultLocale

public Locale getDefaultLocale()
Gets the default locale requested by the browser.

Returns:
the Default locale.

hashCode

public int hashCode()
Hash code composed of the properties of the web browser type.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Tests the equality of the properties for two web browser types.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getContentType

public String getContentType()
Gets the preferred content type.

Returns:
the content type.

supports

public boolean supports(String browser)
Checks if this type supports also given browser.

Parameters:
browser - the browser type.
Returns:
true if this type matches the given browser.

supports

public boolean supports(WebBrowser.MarkupVersion html)
Checks if this type supports given markup language version.

Parameters:
html - the markup language version.
Returns:
true if this type supports the given markup version,otherwise false.

supports

public boolean supports(WebBrowser.JavaScriptVersion js)
Checks if this type supports given javascript version.

Parameters:
js - the javascript version to check for.
Returns:
true if this type supports the given javascript version.

parseHTMLVersion

public static WebBrowser.MarkupVersion parseHTMLVersion(String html)
Parses HTML version from string.

Parameters:
html -
Returns:
the HTMLVersion instance.

parseJavaScriptVersion

public static WebBrowser.JavaScriptVersion parseJavaScriptVersion(String js)
Parse JavaScript version from string.

Parameters:
js - the javascript version to check for.
Returns:
the HTMLVersion instance.

isClientSideChecked

public boolean isClientSideChecked()
Gets the client side cheked property. Certain terminal features can only be detected at client side. This property indicates if the client side detections have been performed for this type.

Returns:
true if client has sent information about its properties. Default is false.

setClientSideChecked

public void setClientSideChecked(boolean value)
Sets the client side checked property. Certain terminal features can only be detected at client side. This property indicates if the client side detections have been performed for this type.

Parameters:
value - true if client has sent information about its properties, false otherweise.

performClientCheck

public boolean performClientCheck()
Should the client features be checked using remote scripts. Should the client side terminal feature check be performed.

Returns:
true if client side checking should be performed for this terminal type. Default is false.

performClientCheck

public void performClientCheck(boolean value)
Should the client features be checked using remote scripts.

Parameters:
value -

isJavaEnabled

public boolean isJavaEnabled()
Checks if web browser supports Java.

Returns:
true if the browser supports java otherwise false.

getLocales

public Collection getLocales()
Returns the locales supported by the web browser.

Returns:
the Collection.

setBrowserApplication

public void setBrowserApplication(String browserApplication)
Sets the browser application. This corresponds to User-Agent HTTP header.

Parameters:
browserApplication - the browserApplication to set.

setContentType

public void setContentType(String contentType)
Sets the default content type. Default is text/html

Parameters:
contentType - the contentType to set.

setJavaEnabled

public void setJavaEnabled(boolean javaEnabled)
Sets the java enabled property.

Parameters:
javaEnabled - the javaEnabled to set.

setJavaScriptVersion

public void setJavaScriptVersion(WebBrowser.JavaScriptVersion javaScriptVersion)
Sets the JavaScript version.

Parameters:
javaScriptVersion - the JavaScript version to set.

setMarkupVersion

public void setMarkupVersion(WebBrowser.MarkupVersion markupVersion)
Sets the markup language version.

Parameters:
markupVersion - the markup language version to set.

setScreenHeight

public void setScreenHeight(int screenHeight)
Sets the screen height.

Parameters:
screenHeight - the screen height to set in pixels.

setScreenWidth

public void setScreenWidth(int screenWidth)
Sets the screen width.

Parameters:
screenWidth - the screenWidth to set in pixels.

getRenderingMode

public WebBrowser.RenderingMode getRenderingMode()
Gets the current rendering mode.

Returns:
the current rendering mode.

setRenderingMode

public void setRenderingMode(WebBrowser.RenderingMode renderingMode)
Sets the current rendering mode.

Parameters:
renderingMode - the rendering mode.


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.