|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.protocol.http.ClientProperties
public class ClientProperties
Description of various user agent (browser) properties. To fill the properties with values from
the user agent you need to probe the browser using javascript and request header analysis. Wicket
provides a default implementation of this in BrowserInfoPage
.
A convenient way of letting Wicket do a sneaky redirect to BrowserInfoPage
(and back
again) is to put this in your Application's init method:
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);WARNING: Be sure you think about the dangers of depending on information you pull from the client too much. They may be easily spoofed or inaccurate in other ways, and properties like window and browser size are all too easy to be used naively.
BrowserInfoPage
,
Serialized FormConstructor Summary | |
---|---|
ClientProperties()
|
Method Summary | |
---|---|
int |
getBrowserHeight()
|
int |
getBrowserVersionMajor()
|
int |
getBrowserVersionMinor()
|
int |
getBrowserWidth()
|
String |
getHostname()
|
String |
getNavigatorAppCodeName()
|
String |
getNavigatorAppName()
|
String |
getNavigatorAppVersion()
|
String |
getNavigatorLanguage()
|
String |
getNavigatorPlatform()
|
String |
getNavigatorUserAgent()
|
String |
getRemoteAddress()
|
int |
getScreenColorDepth()
|
int |
getScreenHeight()
|
int |
getScreenWidth()
|
TimeZone |
getTimeZone()
Get the client's time zone if that could be detected. |
String |
getUtcDSTOffset()
|
String |
getUtcOffset()
|
boolean |
isBrowserChrome()
Flag indicating that the browser is a derivative of the Chrome browser platform. |
boolean |
isBrowserInternetExplorer()
Flag indicating that the browser is a derivative of the Microsoft Internet Explorer browser platform. |
boolean |
isBrowserKonqueror()
Flag indicating that the browser is a derivative of the KDE Konqueror browser platform. |
boolean |
isBrowserMozilla()
Flag indicating that the browser is a derivative of the Mozilla 1.0-1.8+ browser platform. |
boolean |
isBrowserMozillaFirefox()
Flag indicating that the browser is a derivative of the Mozilla Firefox 1.0+ browser platform. |
boolean |
isBrowserOpera()
Flag indicating that the browser is a derivative of the Opera browser platform. |
boolean |
isBrowserSafari()
Flag indicating that the browser is a derivative of the Apple Safari browser platform. |
boolean |
isCookiesEnabled()
|
boolean |
isJavaEnabled()
|
boolean |
isProprietaryIECssExpressionsSupported()
A proprietary feature flag indicating support for IE-style CSS expressions. |
boolean |
isProprietaryIEPngAlphaFilterRequired()
A proprietary feature flag indicating that PNG alpha channel support is available only by using a 'filter'. |
boolean |
isQuirkCssBackgroundAttachmentUseFixed()
A quirk flag indicating that the 'fixed' attribute should be used to for fixed-to-element background attachment. |
boolean |
isQuirkCssBorderCollapseFor0Padding()
A quirk flag indicating the only means of achieving 0 padding in table cells is to use 0px padding. |
boolean |
isQuirkCssBorderCollapseInside()
A quirk flag indicating whether the client will incorrectly render CSS collapsed borders such that they reside entirely within the region of a component. |
boolean |
isQuirkCssPositioningOneSideOnly()
A quirk flag indicating that CSS positioning values do not work correctly when either both "top" and "bottom" or "left" and "right" positions are set at the same time. |
boolean |
isQuirkIERepaint()
A quirk flag describing the curious repaint behavior found in Internet Explorer 6, where repaints may be excessively delayed. |
boolean |
isQuirkIESelectListDomUpdate()
A quirk flag indicating that listbox-style select fields cannot be reliably manipulated using the client DOM API. |
boolean |
isQuirkIESelectPercentWidth()
A quirk flag indicating that select fields with percentage widths are not reliably rendered. |
boolean |
isQuirkIESelectZIndex()
A quirk flag describing the issue of "windowed" select fields in Internet Explorer, which do not render correctly with regard to z-index value. |
boolean |
isQuirkIETablePercentWidthScrollbarError()
A quirk flag indicating incorrect calculation of 100% table widths when within a vertically scrolling region. |
boolean |
isQuirkIETextareaNewlineObliteration()
A quirk flag indicating the incorrect parsing of newlines in the content of a 'textarea'. |
boolean |
isQuirkMozillaPerformanceLargeDomRemove()
A quirk flag indicating whether the client has poor performance when attempting to remove large element hierarchies from a DOM. |
boolean |
isQuirkMozillaTextInputRepaint()
A quirk flag describing a Mozilla-specific behavior where the text contained within text input fields may be drawn outside of text input component due to the component having shifted its location on the page. |
void |
setBrowserChrome(boolean browserChrome)
Flag indicating that the browser is a derivative of the Chrome browser platform. |
void |
setBrowserHeight(int browserHeight)
|
void |
setBrowserInternetExplorer(boolean browserInternetExplorer)
Flag indicating that the browser is a derivative of the Microsoft Internet Explorer browser platform. |
void |
setBrowserKonqueror(boolean browserKonqueror)
Flag indicating that the browser is a derivative of the KDE Konqueror browser platform. |
void |
setBrowserMozilla(boolean browserMozilla)
Flag indicating that the browser is a derivative of the Mozilla 1.0-1.8+ browser platform. |
void |
setBrowserMozillaFirefox(boolean browserMozillaFirefox)
Flag indicating that the browser is a derivative of the Mozilla Firefox 1.0+ browser platform. |
void |
setBrowserOpera(boolean browserOpera)
Flag indicating that the browser is a derivative of the Opera browser platform. |
void |
setBrowserSafari(boolean browserSafari)
Flag indicating that the browser is a derivative of the Apple Safari browser platform. |
void |
setBrowserVersionMajor(int browserVersionMajor)
|
void |
setBrowserVersionMinor(int browserVersionMinor)
|
void |
setBrowserWidth(int browserWidth)
|
void |
setCookiesEnabled(boolean cookiesEnabled)
|
void |
setHostname(String hostname)
|
void |
setJavaEnabled(boolean navigatorJavaEnabled)
|
void |
setNavigatorAppCodeName(String navigatorAppCodeName)
|
void |
setNavigatorAppName(String navigatorAppName)
|
void |
setNavigatorAppVersion(String navigatorAppVersion)
|
void |
setNavigatorLanguage(String navigatorLanguage)
|
void |
setNavigatorPlatform(String navigatorPlatform)
|
void |
setNavigatorUserAgent(String navigatorUserAgent)
|
void |
setProprietaryIECssExpressionsSupported(boolean proprietaryIECssExpressionsSupported)
|
void |
setProprietaryIEPngAlphaFilterRequired(boolean proprietaryIEPngAlphaFilterRequired)
|
void |
setQuirkCssBackgroundAttachmentUseFixed(boolean quirkCssBackgroundAttachmentUseFixed)
|
void |
setQuirkCssBorderCollapseFor0Padding(boolean quirkCssBorderCollapseFor0Padding)
|
void |
setQuirkCssBorderCollapseInside(boolean quirkCssBorderCollapseInside)
|
void |
setQuirkCssPositioningOneSideOnly(boolean quirkCssPositioningOneSideOnly)
|
void |
setQuirkIERepaint(boolean quirkIERepaint)
|
void |
setQuirkIESelectListDomUpdate(boolean quirkIESelectListDomUpdate)
|
void |
setQuirkIESelectPercentWidth(boolean quirkIESelectPercentWidth)
|
void |
setQuirkIESelectZIndex(boolean quirkIESelectZIndex)
|
void |
setQuirkIETablePercentWidthScrollbarError(boolean quirkIETablePercentWidthScrollbarError)
|
void |
setQuirkIETextareaNewlineObliteration(boolean quirkIETextareaNewlineObliteration)
|
void |
setQuirkMozillaPerformanceLargeDomRemove(boolean quirkMozillaPerformanceLargeDomRemove)
|
void |
setQuirkMozillaTextInputRepaint(boolean quirkMozillaTextInputRepaint)
|
void |
setRemoteAddress(String remoteAddress)
|
void |
setScreenColorDepth(int screenColorDepth)
|
void |
setScreenHeight(int screenHeight)
|
void |
setScreenWidth(int screenWidth)
|
void |
setTimeZone(TimeZone timeZone)
Sets time zone. |
void |
setUtcDSTOffset(String utcDSTOffset)
|
void |
setUtcOffset(String utcOffset)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClientProperties()
Method Detail |
---|
public int getBrowserHeight()
public int getBrowserVersionMajor()
public int getBrowserVersionMinor()
public int getBrowserWidth()
public String getNavigatorAppCodeName()
public String getNavigatorAppName()
public String getNavigatorAppVersion()
public String getNavigatorLanguage()
public String getNavigatorPlatform()
public String getNavigatorUserAgent()
public String getRemoteAddress()
public String getHostname()
public int getScreenColorDepth()
public int getScreenHeight()
public int getScreenWidth()
public TimeZone getTimeZone()
public String getUtcDSTOffset()
public String getUtcOffset()
public boolean isBrowserInternetExplorer()
public boolean isBrowserKonqueror()
public boolean isBrowserMozilla()
public boolean isBrowserMozillaFirefox()
public boolean isBrowserOpera()
public boolean isBrowserSafari()
public boolean isBrowserChrome()
public boolean isCookiesEnabled()
public boolean isJavaEnabled()
public boolean isProprietaryIECssExpressionsSupported()
This proprietary feature is provided by:
public boolean isProprietaryIEPngAlphaFilterRequired()
This proprietary feature is provided by:
public boolean isQuirkCssBackgroundAttachmentUseFixed()
This quirk occurs with:
public boolean isQuirkCssBorderCollapseFor0Padding()
This quirk occurs with:
public boolean isQuirkCssBorderCollapseInside()
This quirk occurs with:
public boolean isQuirkCssPositioningOneSideOnly()
This quirk occurs with:
public boolean isQuirkIERepaint()
This quirk occurs with:
public boolean isQuirkIESelectListDomUpdate()
This quirk occurs with:
public boolean isQuirkIESelectPercentWidth()
This quirk occurs with:
public boolean isQuirkIESelectZIndex()
This quirk occurs with:
public boolean isQuirkIETablePercentWidthScrollbarError()
This quirk occurs with:
public boolean isQuirkIETextareaNewlineObliteration()
This quirk occurs with:
public boolean isQuirkMozillaPerformanceLargeDomRemove()
This quirk occurs with:
public boolean isQuirkMozillaTextInputRepaint()
This quirk occurs with:
public void setBrowserHeight(int browserHeight)
browserHeight
- The height of the browserpublic void setBrowserInternetExplorer(boolean browserInternetExplorer)
browserInternetExplorer
- True if a derivative of the Microsoft Internet Explorer browser platform.public void setBrowserKonqueror(boolean browserKonqueror)
browserKonqueror
- True if a derivative of the KDE Konqueror browser platform.public void setBrowserMozilla(boolean browserMozilla)
browserMozilla
- True if a derivative of the Mozilla 1.0-1.8+ browser platform.public void setBrowserMozillaFirefox(boolean browserMozillaFirefox)
browserMozillaFirefox
- True if a derivative of the Mozilla Firefox 1.0+ browser platform.public void setBrowserOpera(boolean browserOpera)
browserOpera
- True if a derivative of the Opera browser platform.public void setBrowserSafari(boolean browserSafari)
browserSafari
- True if a derivative of the Apple Safari browser platform.public void setBrowserChrome(boolean browserChrome)
browserChrome
- True if a derivative of the Chrome browser platform.public void setBrowserVersionMajor(int browserVersionMajor)
browserVersionMajor
- The major version number of the browser.public void setBrowserVersionMinor(int browserVersionMinor)
browserVersionMinor
- The minor version number of the browser.public void setBrowserWidth(int browserWidth)
browserWidth
- The browser widthpublic void setCookiesEnabled(boolean cookiesEnabled)
cookiesEnabled
- The client's navigator.cookieEnabled property.public void setJavaEnabled(boolean navigatorJavaEnabled)
navigatorJavaEnabled
- The client's navigator.javaEnabled property.public void setNavigatorAppCodeName(String navigatorAppCodeName)
navigatorAppCodeName
- The client's navigator.appCodeName property.public void setNavigatorAppName(String navigatorAppName)
navigatorAppName
- The client's navigator.appName property.public void setNavigatorAppVersion(String navigatorAppVersion)
navigatorAppVersion
- The client's navigator.appVersion property.public void setNavigatorLanguage(String navigatorLanguage)
navigatorLanguage
- The client's navigator.language (or navigator.userLanguage) property.public void setNavigatorPlatform(String navigatorPlatform)
navigatorPlatform
- The client's navigator.platform property.public void setNavigatorUserAgent(String navigatorUserAgent)
navigatorUserAgent
- The client's navigator.userAgent property.public void setProprietaryIECssExpressionsSupported(boolean proprietaryIECssExpressionsSupported)
proprietaryIECssExpressionsSupported
- True if support for IE-style CSS expressions.public void setProprietaryIEPngAlphaFilterRequired(boolean proprietaryIEPngAlphaFilterRequired)
proprietaryIEPngAlphaFilterRequired
- True if PNG alpha channel support is available only by using a 'filter'.public void setQuirkCssBackgroundAttachmentUseFixed(boolean quirkCssBackgroundAttachmentUseFixed)
quirkCssBackgroundAttachmentUseFixed
- True if the 'fixed' attribute should be used to for fixed-to-element background
attachment.public void setQuirkCssBorderCollapseFor0Padding(boolean quirkCssBorderCollapseFor0Padding)
quirkCssBorderCollapseFor0Padding
- True if the only means of achieving 0 padding in table cells is to use 0px
padding.public void setQuirkCssBorderCollapseInside(boolean quirkCssBorderCollapseInside)
quirkCssBorderCollapseInside
- True if the client will incorrectly render CSS collapsed borders such that they
reside entirely within the region of a component.public void setQuirkCssPositioningOneSideOnly(boolean quirkCssPositioningOneSideOnly)
quirkCssPositioningOneSideOnly
- True if CSS positioning values do not work correctly when either both "top" and
"bottom" or "left" and "right" positions are set at the same time.public void setQuirkIERepaint(boolean quirkIERepaint)
quirkIERepaint
- True if means needs to be taken against weird Internet Explorer repaint behaviors.public void setQuirkIESelectListDomUpdate(boolean quirkIESelectListDomUpdate)
quirkIESelectListDomUpdate
- True if listbox-style select fields cannot be reliably manipulated using the
client DOM API.public void setQuirkIESelectPercentWidth(boolean quirkIESelectPercentWidth)
quirkIESelectPercentWidth
- True if select fields with percentage widths are not reliably rendered.public void setQuirkIESelectZIndex(boolean quirkIESelectZIndex)
quirkIESelectZIndex
- True if the browser do not render correctly with regard to z-index value.public void setQuirkIETablePercentWidthScrollbarError(boolean quirkIETablePercentWidthScrollbarError)
quirkIETablePercentWidthScrollbarError
- True if incorrect calculation of 100% table widths when within a vertically
scrolling region.public void setQuirkIETextareaNewlineObliteration(boolean quirkIETextareaNewlineObliteration)
quirkIETextareaNewlineObliteration
- True if the browser has incorrect parsing of newlines in the content of a
'textarea'.public void setQuirkMozillaPerformanceLargeDomRemove(boolean quirkMozillaPerformanceLargeDomRemove)
quirkMozillaPerformanceLargeDomRemove
- True if the client has poor performance when attempting to remove large element
hierarchies from a DOM.public void setQuirkMozillaTextInputRepaint(boolean quirkMozillaTextInputRepaint)
quirkMozillaTextInputRepaint
- True if the text contained within text input fields may be drawn outside of text
input component due to the component having shifted its location on the page.public void setRemoteAddress(String remoteAddress)
remoteAddress
- The client's remote/ip address.public void setHostname(String hostname)
hostname
- the hostname shown in the browser.public void setScreenColorDepth(int screenColorDepth)
screenColorDepth
- Color depth of the screen in bits (integer).public void setScreenHeight(int screenHeight)
screenHeight
- Height of the screen in pixels (integer).public void setScreenWidth(int screenWidth)
screenWidth
- Height of the screen in pixels (integer).public void setTimeZone(TimeZone timeZone)
timeZone
- public void setUtcDSTOffset(String utcDSTOffset)
utcDSTOffset
- public void setUtcOffset(String utcOffset)
utcOffset
- The client's time offset from UTC in minutes (note: if you do this yourself, use
'new Date().getTimezoneOffset() / -60' (note the -)).public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |