Class AjaxDevice

java.lang.Object
org.zkoss.zk.device.GenericDevice
org.zkoss.zk.device.AjaxDevice
All Implemented Interfaces:
Device

public class AjaxDevice extends GenericDevice
Represents a Web browser with the Ajax support.
Since:
2.4.0
Author:
tomyeh
  • Constructor Details

    • AjaxDevice

      public AjaxDevice()
  • Method Details

    • isCacheable

      public boolean isCacheable()
      Return false to indicate it is not cacheable.
      Specified by:
      isCacheable in interface Device
      Overrides:
      isCacheable in class GenericDevice
    • isCompatible

      public Boolean isCompatible(String userAgent)
      Description copied from class: GenericDevice
      Returns null to indicate unknown. Deriving should override it to provide more precise information.
      Specified by:
      isCompatible in interface Device
      Overrides:
      isCompatible in class GenericDevice
      Parameters:
      userAgent - represents a client. For HTTP clients, It is the user-agent header.
      Returns:
      Boolean.TRUE if this device supports the specified client, Boolean.FALSE if cannot, or null if unknown.
      See Also:
    • getContentType

      public String getContentType()
      Returns text/html
    • getDocType

      public String getDocType()
      Returns <!DOCTYPE html>. (since 7.0.0)
      Specified by:
      getDocType in interface Device
      Overrides:
      getDocType in class GenericDevice
    • packageToPath

      public String packageToPath(String pkg)
      Converts a package to a path that can be accessible by the class loader (classpath).

      Default: "/js/" + pkg + ".wpd";

      Specified by:
      packageToPath in interface Device
      Overrides:
      packageToPath in class GenericDevice
      Since:
      5.0.4
    • toAbsolutePath

      public String toAbsolutePath(String path)
      Converts a relative path to an absolute path that can be accessible by the class loader (classpath).

      Default: "/js/" + path (if path doesn't start with '/' or '~').

      Specified by:
      toAbsolutePath in interface Device
      Overrides:
      toAbsolutePath in class GenericDevice
      Parameters:
      path - the path (never null). It is assumed to be a relative path if not starting with '/' or '~'.
      Since:
      5.0.4
    • reloadMessages

      public void reloadMessages(Locale locale) throws IOException
      Description copied from class: GenericDevice
      Reloads the client-side messages in the specified locale.

      Default: throw UnsupportedOperationException.

      Specified by:
      reloadMessages in interface Device
      Overrides:
      reloadMessages in class GenericDevice
      Parameters:
      locale - the locale. If null, Locales.getCurrent() is assumed.
      Throws:
      IOException