Class ClientInfo

java.lang.Object
org.adempiere.webui.ClientInfo
All Implemented Interfaces:
Serializable

public class ClientInfo extends Object implements Serializable
Model for client info from browser
Author:
Low Heng Sin
See Also:
  • Field Details

    • colorDepth

      public int colorDepth
    • desktopWidth

      public int desktopWidth
    • desktopHeight

      public int desktopHeight
    • desktopXOffset

      public int desktopXOffset
    • desktopYOffset

      public int desktopYOffset
    • screenHeight

      public int screenHeight
    • screenWidth

      public int screenWidth
    • orientation

      public String orientation
    • timeZone

      public TimeZone timeZone
    • userAgent

      public String userAgent
    • tablet

      public boolean tablet
    • devicePixelRatio

      public double devicePixelRatio
    • LARGE_WIDTH

      public static final int LARGE_WIDTH
      See Also:
    • MEDIUM_WIDTH

      public static final int MEDIUM_WIDTH
      See Also:
    • SMALL_WIDTH

      public static final int SMALL_WIDTH
      See Also:
    • EXTRA_SMALL_WIDTH

      public static final int EXTRA_SMALL_WIDTH
      See Also:
    • LARGE_HEIGHT

      public static final int LARGE_HEIGHT
      See Also:
    • MEDIUM_HEIGHT

      public static final int MEDIUM_HEIGHT
      See Also:
    • SMALL_HEIGHT

      public static final int SMALL_HEIGHT
      See Also:
    • EXTRA_SMALL_HEIGHT

      public static final int EXTRA_SMALL_HEIGHT
      See Also:
  • Constructor Details

    • ClientInfo

      public ClientInfo()
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isMobile

      public static boolean isMobile()
      Is mobile browser client
      Returns:
      true if mobile browser
    • isFirefox

      public static boolean isFirefox(String version)
      Is firefox
      Parameters:
      version - null to match all version
      Returns:
      true if browser is firefox and match the pass in version parameter
    • get

      public static ClientInfo get()
      Get current client info instance
      Returns:
      the current clientinfo instance
    • minWidth

      public static boolean minWidth(int minWidth)
      Get minimum width of desktop
      Parameters:
      minWidth -
      Returns:
      true if desktopWidth >= minWidth
    • maxWidth

      public static boolean maxWidth(int maxWidth)
      Get maximum width of desktop
      Parameters:
      maxWidth -
      Returns:
      true if desktopWidth <= maxWidth
    • minHeight

      public static boolean minHeight(int minHeight)
      Get minimum height of desktop
      Parameters:
      minHeight -
      Returns:
      true if desktopHeight >= minHeight
    • maxHeight

      public static boolean maxHeight(int maxHeight)
      Get maximum height of desktop
      Parameters:
      maxHeight -
      Returns:
      true if desktopHeight <= maxHeight
    • onClientInfo

      public static void onClientInfo(org.zkoss.zk.ui.Component component, Runnable runnable)
      Call runnable on client info update
      Parameters:
      component -
      runnable -
    • isPortrait

      public boolean isPortrait()
      Is screen orientation portrait
      Returns:
      true if screen orientation is portrait, false otherwise