Package org.zkoss.zats.mimic
Interface Client
- All Known Implementing Classes:
EmulatorClient
public interface Client
Represent a client that can connect to zul files. It plays a role like a browser but without rendering anything.
- Author:
- Hawk, Dennis, Pao, jumperchen
-
Method Summary
Modifier and TypeMethodDescriptionconnect to a zul file, you have to provide the path that relative to the resource root folderconnectAsIncluded(String zulPath, Map<String, Object> args) connect to a zul file, you have to provide the path that relative to the resource root folder.connectWithContent(String content, String ext, ComponentAgent parent, Map<String, Object> args) Connect to a zul content or another language from a string.voiddestroy()destroy this client, it will also destory all un-destroyed desktops that is created by this clientget value of cookie with specify name.get all cookies in an unmodifiable map.get the current echo event handling mode.voidset cookie for the client, the cookie will be sent at every HTTP request.voidchange the echo event handling mode.
-
Method Details
-
connect
connect to a zul file, you have to provide the path that relative to the resource root folder- See Also:
-
connectAsIncluded
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.- Parameters:
zulPath- the path of zul file.args- the arguments to pass.- Returns:
- desktop agent.
- See Also:
-
connectWithContent
DesktopAgent connectWithContent(String content, String ext, ComponentAgent parent, Map<String, Object> args) 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.- Parameters:
content- the raw content of the page. It must be a XML and compliant to the page format (such as ZUL).extension- the default extension if the content doesn't specify an language. In other words, if the content doesn't specify an language,LanguageDefinition.getByExtension(java.lang.String)is called. If extension is null and the content doesn't specify a language, the language called "xul/html" is assumed.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.arg- a map of parameters that is accessible by the arg variable in EL, or byExecution.getArg(). Ignored if null.- Returns:
- desktop agent.
- Since:
- 1.2.1
- See Also:
-
Executions.createComponentsDirectly(String, String, org.zkoss.zk.ui.Component, Map)
-
destroy
void destroy()destroy this client, it will also destory all un-destroyed desktops that is created by this client -
setCookie
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.- Parameters:
name- 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.- Since:
- 1.1.0
-
getCookie
get value of cookie with specify name.- Parameters:
name- The name of the cookie, it should not be null or empty string.- Returns:
- the cookie value if cookie is existed or null otherwise.
- Since:
- 1.1.0
-
getCookies
get all cookies in an unmodifiable map.- Returns:
- the map contained cookies.
- Since:
- 1.1.0
-
setEchoEventMode
change the echo event handling mode. the default mode is EchoEventMode.IMMEDIATE- Parameters:
mode- Control echo event handling mode. If null, do nothing.- Since:
- 1.1.0
- See Also:
-
getEchoEventMode
EchoEventMode getEchoEventMode()get the current echo event handling mode. the default mode is EchoEventMode.IMMEDIATE- Returns:
- current echo event handling mode.
- Since:
- 1.1.0
- See Also:
-