org.zkoss.zk.device
Interface Device

All Known Implementing Classes:
AjaxDevice

public interface Device

Represents a client device. For example, the HTML browsers with Ajax are called AjaxDevice, and the MIL device called org.zkoss.mil.device.MilDevice.

Note: the device must be serializable.

Since:
2.4.0
Author:
tomyeh

Method Summary
 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, Desktop desktop, java.lang.String unavailmsg)
          Initializes the device.
 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.
 void setUnavailableMessage(java.lang.String unavailmsg)
          Sets the unavailable message that is shown to the client if the client doesn't support this device.
 

Method Detail

getType

java.lang.String getType()
Returns the device type.


getUnavailableMessage

java.lang.String getUnavailableMessage()
Returns the unavailable message that is shown to the client if the client doesn't support this device.

Returns:
the unavailable message, or null if no such message
Since:
2.4.0

setUnavailableMessage

void setUnavailableMessage(java.lang.String unavailmsg)
Sets the unavailable message that is shown to the client if the client doesn't support this device.

Note: this method must be called before the desktop is rendered (and sent to the client). Otherwise, it is meaningless.

Parameters:
unavailmsg - the unavailable message.
Since:
2.4.0

init

void init(java.lang.String type,
          Desktop desktop,
          java.lang.String unavailmsg)
Initializes the device. A device is created for each desktop, and this method is called when it is associated to the desktop.

Parameters:
type - the device type
desktop - the desktop to associate this device with (never null).
unavailmsg - the message to shown when the device is not, or null no message will be shown
Since:
2.4.0

sessionWillPassivate

void sessionWillPassivate(Desktop desktop)
Notification that the desktop, which owns this device, is about to be passivated (aka., serialized) by the Web container.

Since:
2.4.0

sessionDidActivate

void sessionDidActivate(Desktop desktop)
Notification that the desktop, which owns this device, has just been activated (aka., deserialized) by the Web container.

Since:
2.4.0


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.