|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.device.GenericDevice
public abstract class GenericDevice
A skeletal implementation of Device
.
Field Summary |
---|
Fields inherited from interface org.zkoss.zk.device.Device |
---|
RESEND |
Constructor Summary | |
---|---|
GenericDevice()
|
Method Summary | |
---|---|
void |
addEmbedded(java.lang.String content)
Adds the content that shall be added to the output generated and sent to the client, when rending a desktop. |
java.lang.String |
getDocType()
Returns null to indicate not to generate <! |
java.lang.String |
getEmbedded()
Returns the content that shall be embedded to the output being generated to the client, or null if no embedded content. |
java.lang.Class |
getServerPushClass()
Returns the class that implements the server-push feature ( ServerPush ) for this device, or null if the default is used. |
java.lang.String |
getTimeoutURI()
Deprecated. |
java.lang.String |
getType()
Returns the device type. |
java.lang.String |
getUnavailableMessage()
Returns the unavailable message that is shown to the client if the client doesn't support this device. |
void |
init(java.lang.String type,
DeviceConfig config)
Initializes the device. |
boolean |
isCacheable()
Return true to indicate it is cacheable. |
boolean |
isClient(java.lang.String userAgent,
java.lang.String type)
Tests if a client is the givent type. |
java.lang.Boolean |
isCompatible(java.lang.String userAgent)
Returns null to indicate unknown. |
boolean |
isSupported(int func)
Returns whether the specified function is supported. |
void |
sessionDidActivate(Desktop desktop)
Notification that the desktop, which owns this device, has just been activated (aka., deserialized) by the Web container. |
void |
sessionWillPassivate(Desktop desktop)
Notification that the desktop, which owns this device, is about to be passivated (aka., serialized) by the Web container. |
java.lang.Class |
setServerPushClass(java.lang.Class cls)
Sets the class that implements the server-push feature ( ServerPush ) for this device, or null to use the default. |
java.lang.String |
setTimeoutURI(java.lang.String timeoutURI)
Deprecated. |
java.lang.String |
setUnavailableMessage(java.lang.String msg)
Sets the unavailable message that is shown to the client if the client doesn't support this device. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.zkoss.zk.device.Device |
---|
getContentType |
Constructor Detail |
---|
public GenericDevice()
Method Detail |
---|
public boolean isSupported(int func)
Device
isSupported
in interface Device
func
- the function. It can be one of Device.RESEND
.public java.lang.String getType()
Device
getType
in interface Device
public boolean isCacheable()
isCacheable
in interface Device
public java.lang.Boolean isCompatible(java.lang.String userAgent)
isCompatible
in interface Device
userAgent
- represents a client.
For HTTP clients, It is the user-agent header.
Execution.getUserAgent()
,
Devices.getDeviceByClient(java.lang.String)
public java.lang.String getUnavailableMessage()
Device
getUnavailableMessage
in interface Device
public java.lang.String setUnavailableMessage(java.lang.String msg)
Device
setUnavailableMessage
in interface Device
msg
- the unavailable message.
public java.lang.String getTimeoutURI()
getTimeoutURI
in interface Device
public java.lang.String setTimeoutURI(java.lang.String timeoutURI)
setTimeoutURI
in interface Device
public java.lang.Class setServerPushClass(java.lang.Class cls)
Device
ServerPush
) for this device, or null to use the default.
Default: PollingServerPush
.
If ZK EE (with zkmax.jar) is loaded,
the COMET-based server push (CometServerPush
)
is the default.
setServerPushClass
in interface Device
public java.lang.Class getServerPushClass()
Device
ServerPush
) for this device, or null if the default is used.
getServerPushClass
in interface Device
public java.lang.String getDocType()
getDocType
in interface Device
public void addEmbedded(java.lang.String content)
Device
As the method name suggests, the embedded contents are accumulated and all generated to the output.
addEmbedded
in interface Device
public java.lang.String getEmbedded()
Device
getEmbedded
in interface Device
public boolean isClient(java.lang.String userAgent, java.lang.String type)
This implementation always return false.
isClient
in interface Device
userAgent
- represents a client.type
- the type of the browser.
public void init(java.lang.String type, DeviceConfig config)
Device
init
in interface Device
type
- the device type (never null)config
- the configuration to initialize the device (never null)public void sessionWillPassivate(Desktop desktop)
Device
sessionWillPassivate
in interface Device
public void sessionDidActivate(Desktop desktop)
Device
sessionDidActivate
in interface Device
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |