com.itmill.toolkit.terminal.gwt.client
Class BrowserInfo

java.lang.Object
  extended by com.itmill.toolkit.terminal.gwt.client.BrowserInfo

public class BrowserInfo
extends Object

Class used to query information about web browser. Browser details are detected only once and those are stored in this singleton class.


Method Summary
static BrowserInfo get()
          Singleton method to get BrowserInfo object.
static String getBrowserString()
           
 String getCSSClass()
          Returns a string representing the browser in use, for use in CSS classnames.
 float getGeckoVersion()
           
 float getIEVersion()
           
 float getWebkitVersion()
           
 boolean isFF2()
           
 boolean isFF3()
           
 boolean isGecko()
           
 boolean isIE()
           
 boolean isIE6()
           
 boolean isIE7()
           
 boolean isOpera()
           
 boolean isSafari()
           
static void test()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static BrowserInfo get()
Singleton method to get BrowserInfo object.

Returns:
instance of BrowserInfo object

getCSSClass

public String getCSSClass()
Returns a string representing the browser in use, for use in CSS classnames. The classnames will be space separated abbrevitaions, optionally with a version appended. Abbreviaions: Firefox: ff Internet Explorer: ie Safari: sa Opera: op Browsers that CSS-wise behave like each other will get the same abbreviation (this usually depends on the rendering engine). This is quite simple at the moment, more heuristics will be added when needed. Examples: Internet Explorer 6: ".i-ie .i-ie6", Firefox 3.0.4: ".i-ff .i-ff3", Opera 9.60: ".i-op .i-op96"

Parameters:
prefix - a prefix to add to the classnames
Returns:

isIE

public boolean isIE()

isSafari

public boolean isSafari()

isIE6

public boolean isIE6()

isIE7

public boolean isIE7()

isGecko

public boolean isGecko()

isFF2

public boolean isFF2()

isFF3

public boolean isFF3()

getGeckoVersion

public float getGeckoVersion()

getWebkitVersion

public float getWebkitVersion()

getIEVersion

public float getIEVersion()

isOpera

public boolean isOpera()

getBrowserString

public static String getBrowserString()

test

public static void test()


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