Class EmulatorClient

    • Constructor Detail

      • EmulatorClient

        public EmulatorClient​(Emulator emulator)
    • Method Detail

      • connectAsIncluded

        public DesktopAgent connectAsIncluded​(String zulPath,
                                              Map<String,​Object> args)
        Description copied from interface: Client
        connect to a zul file, you have to provide the path that relative to the resource root folder. You can pass arguments through a map into the specific zul file as including.
        Specified by:
        connectAsIncluded in interface Client
        Parameters:
        zulPath - the path of zul file.
        args - the arguments to pass.
        Returns:
        desktop agent.
        See Also:
        ZatsEnvironment.init(String)
      • connectWithContent

        public DesktopAgent connectWithContent​(String content,
                                               String ext,
                                               ComponentAgent parent,
                                               Map<String,​Object> args)
        Description copied from interface: Client
        Connect to a zul content or another language from a string. You can pass arguments through a map into the specific zul content or another language.
        Specified by:
        connectWithContent in interface Client
        Parameters:
        content - the raw content of the page. It must be a XML and compliant to the page format (such as ZUL).
        parent - the parent component, or null if you want it to be a root component. If parent is null, the page is assumed to be the current page, which is determined by the execution context. In other words, the new component will be the root component of the current page if parent is null.
        Returns:
        desktop agent.
        See Also:
        Executions.createComponentsDirectly(String, String, org.zkoss.zk.ui.Component, Map)
      • destroy

        public void destroy()
        Description copied from interface: Client
        destroy this client, it will also destory all un-destroyed desktops that is created by this client
        Specified by:
        destroy in interface Client
      • postUpdate

        public void postUpdate​(String desktopId,
                               String targetUUID,
                               String command,
                               Map<String,​Object> data,
                               boolean ignorable)
        Description copied from interface: ClientCtrl
        post an asynchronous update event. It will be queued until invoke flush.
        Specified by:
        postUpdate in interface ClientCtrl
      • postPiggyback

        public void postPiggyback​(String desktopId,
                                  String targetUUID,
                                  String command,
                                  Map<String,​Object> data,
                                  boolean ignorable)
        Description copied from interface: ClientCtrl
        post a piggyback asynchronous update event. a piggyback event's order is after normal events. It will be queued until invoke flush.
        Specified by:
        postPiggyback in interface ClientCtrl
      • flush

        public void flush​(String desktopId)
        Description copied from interface: ClientCtrl
        flush the queued AU update event including piggyback events.
        Specified by:
        flush in interface ClientCtrl
      • setCookie

        public void setCookie​(String key,
                              String value)
        Description copied from interface: Client
        set cookie for the client, the cookie will be sent at every HTTP request. The cookie name can't start with '$'. Please refer to section 3.2.2 of RFC 2965. If the name existed, the origin value will be replaced.
        Specified by:
        setCookie in interface Client
        Parameters:
        key - The name of the cookie, it should not be null or empty string.
        value - The value of the cookie. If the value is null, it will erase this cookie.
      • getCookie

        public String getCookie​(String key)
        Description copied from interface: Client
        get value of cookie with specify name.
        Specified by:
        getCookie in interface Client
        Parameters:
        key - The name of the cookie, it should not be null or empty string.
        Returns:
        the cookie value if cookie is existed or null otherwise.
      • getCookies

        public Map<String,​String> getCookies()
        Description copied from interface: Client
        get all cookies in an unmodifiable map.
        Specified by:
        getCookies in interface Client
        Returns:
        the map contained cookies.
      • setEchoEventMode

        public void setEchoEventMode​(EchoEventMode mode)
        Description copied from interface: Client
        change the echo event handling mode. the default mode is EchoEventMode.IMMEDIATE
        Specified by:
        setEchoEventMode in interface Client
        Parameters:
        mode - Control echo event handling mode. If null, do nothing.
        See Also:
        EchoEventMode
      • getEchoEventMode

        public EchoEventMode getEchoEventMode()
        Description copied from interface: Client
        get the current echo event handling mode. the default mode is EchoEventMode.IMMEDIATE
        Specified by:
        getEchoEventMode in interface Client
        Returns:
        current echo event handling mode.
        See Also:
        EchoEventMode
      • mapsOf

        public Map mapsOf​(Object... args)
        Returns a map containing the given mappings.