com.plumtree.uiinfrastructure.activityspace.utils
Class BrowserType

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.utils.BrowserType

public class BrowserType
extends java.lang.Object

Utility class for client browser type information.

Author:
DavidP, NaveenP

Field Summary
static java.lang.String CHROME
           
static java.lang.String FIREFOX
           
static java.lang.String LINUX
           
static java.lang.String MACINTOSH
           
static java.lang.String MOZILLA
           
static java.lang.String MSIE
          Constants used by this class.
static java.lang.String NETSCAPE
           
static java.lang.String OPERA
           
static java.lang.String SAFARI
           
static java.lang.String SUNOS
           
static java.lang.String UNIX
           
static java.lang.String UNKNOWN
           
static java.lang.String WINDOWS
           
 
Constructor Summary
BrowserType(IXPRequest request)
          Constructor
 
Method Summary
 java.lang.String GetBrowserName()
           
 float GetBrowserVersion()
          NOTE: This only includes the major and minor versions of the browser.
protected  float GetVersionNumber(java.lang.String _strAgent)
          This helper function attempts to convert the user agent string into a float major/minor version number.
 boolean IsChrome()
           
 boolean IsDragDropLayoutCompliant()
           
 boolean IsECMAScriptOK()
           
 boolean IsFirefox()
           
 boolean IsIE()
           
 boolean IsJSPortalMenuCompliant()
           
 boolean IsJSPortletCompliant()
           
 boolean IsMac()
           
 boolean IsMozilla()
           
 boolean IsNetscape()
           
 boolean IsNetscape4()
           
 boolean IsNetscape67()
           
 boolean IsOpera()
           
 boolean IsSafari()
           
 boolean IsSunOS()
           
 boolean IsWindows()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSIE

public static final java.lang.String MSIE
Constants used by this class.

See Also:
Constant Field Values

OPERA

public static final java.lang.String OPERA
See Also:
Constant Field Values

MOZILLA

public static final java.lang.String MOZILLA
See Also:
Constant Field Values

NETSCAPE

public static final java.lang.String NETSCAPE
See Also:
Constant Field Values

FIREFOX

public static final java.lang.String FIREFOX
See Also:
Constant Field Values

SAFARI

public static final java.lang.String SAFARI
See Also:
Constant Field Values

CHROME

public static final java.lang.String CHROME
See Also:
Constant Field Values

WINDOWS

public static final java.lang.String WINDOWS
See Also:
Constant Field Values

UNIX

public static final java.lang.String UNIX
See Also:
Constant Field Values

SUNOS

public static final java.lang.String SUNOS
See Also:
Constant Field Values

LINUX

public static final java.lang.String LINUX
See Also:
Constant Field Values

MACINTOSH

public static final java.lang.String MACINTOSH
See Also:
Constant Field Values

UNKNOWN

public static final java.lang.String UNKNOWN
See Also:
Constant Field Values
Constructor Detail

BrowserType

public BrowserType(IXPRequest request)
Constructor

Method Detail

GetVersionNumber

protected float GetVersionNumber(java.lang.String _strAgent)
This helper function attempts to convert the user agent string into a float major/minor version number.

Parameters:
_strAgent - The browser user agent string.
Returns:
The major/minor version number as a float.
Throws:
XPFormatException - If the agent string cannot be converted to a float.

IsECMAScriptOK

public boolean IsECMAScriptOK()
Returns:
true if the current client browser can handle javascript, else false

IsJSPortalMenuCompliant

public boolean IsJSPortalMenuCompliant()
Returns:
true if the current client browser can handle javascript, else false

IsJSPortletCompliant

public boolean IsJSPortletCompliant()
Returns:
true if the current client browser can handle javascript, else false

IsDragDropLayoutCompliant

public boolean IsDragDropLayoutCompliant()
Returns:
true if the current client browser can handle javascript, else false

IsIE

public boolean IsIE()
Returns:
true if the current client browser is an Internet Explorer browser, else false

IsSafari

public boolean IsSafari()
Returns:
true if the current client browser is a Safari browser, else false

IsFirefox

public boolean IsFirefox()
Returns:
true if the current client browser is a Firefox browser, else false

IsMozilla

public boolean IsMozilla()
Returns:
true if the current client browser is a Mozilla browser, else false

IsOpera

public boolean IsOpera()
Returns:
true if the current client browser is a Mozilla browser, else false

IsNetscape

public boolean IsNetscape()
Returns:
true if the current client browser is a Netscape browser, else false

IsNetscape4

public boolean IsNetscape4()
Returns:
true if the current client browser is a Netscape 4.x browser, else false

IsNetscape67

public boolean IsNetscape67()
Returns:
true if the current client browser is a Netscape 6.x or 7.x browser, else false

IsChrome

public boolean IsChrome()

IsWindows

public boolean IsWindows()
Returns:
true if the current client browser is a browser for Windows OS, else false

IsMac

public boolean IsMac()
Returns:
true if the current client browser is a browser for Mac OS, else false

IsSunOS

public boolean IsSunOS()
Returns:
true if the current client browser is running on Solaris

GetBrowserName

public java.lang.String GetBrowserName()
Returns:
the browser's name

GetBrowserVersion

public float GetBrowserVersion()
NOTE: This only includes the major and minor versions of the browser. I.E. "1.3.1" will be returned as "1.3".

Returns:
the browser's version number, returns 1.0 if it was not found



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.