org.zkoss.zul
Class Window

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Window
All Implemented Interfaces:
Serializable, Cloneable, org.zkoss.zk.ui.api.HtmlBasedComponent, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.IdSpace, org.zkoss.zk.ui.sys.ComponentCtrl, Window, Framable, XulElement
Direct Known Subclasses:
FileuploadDlg, MessageboxDlg

public class Window
extends XulElement
implements Window, Framable, org.zkoss.zk.ui.IdSpace

A window.

Unlike other elements, each Window is an independent ID space (by implementing IdSpace). It means a window and all its descendants forms a ID space and the ID of each of them is unique in this space. You could retrieve any of them in this space by calling AbstractComponent.getFellow(java.lang.String).

If a window X is a descendant of another window Y, X's descendants are not visible in Y's space. To retrieve a descendant, say Z, of X, you have to invoke Y.getFellow('X').getFellow('Z').

Events:
onMove, onOpen, onMaximize, onMinimize, and onClose.
Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see Deferrable).

onMaximize and onMinimize are supported. (since 3.5.0)

onClose is sent when the close button is pressed (if isClosable() is true). The window has to detach or hide the window. By default, onClose() detaches the window. To prevent it from detached, you have to call Event.stopPropagation() to prevent onClose() is called.

On the other hand, onOpen is sent when a popup window (i.e., getMode() is popup) is closed due to user's activity (such as press ESC). This event is only a notification. In other words, the popup is hidden before the event is sent to the server. The application cannot prevent the window from being hidden.

Default getZclass(): z-window-getMode().(since 3.5.0)

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children
 
Field Summary
static int EMBEDDED
          Embeds the window as normal component.
static int HIGHLIGHTED
          Makes the window as highlighted.
static int MODAL
          Makes the window as a modal dialog.
static int OVERLAPPED
          Makes the window as overlapped other components.
static int POPUP
          Makes the window as popup.
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
Window()
           
Window(String title, String border, boolean closable)
           
 
Method Summary
 void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)
           
 Object clone()
           
 void doEmbedded()
          Makes this window as embeded with other components (Default).
 void doHighlighted()
          Makes this window as highlited.
 void doModal()
          Makes this window as a modal dialog.
 void doOverlapped()
          Makes this window as overlapped with other components.
 void doPopup()
          Makes this window as popup, which is overlapped with other component and auto-hiden when user clicks outside of the window.
 String getBorder()
          Returns the border.
 Caption getCaption()
          Returns the caption of this window.
 Caption getCaptionApi()
          Returns the caption of this window.
 String getContentSclass()
          Returns the style class used for the content block.
 String getContentStyle()
          Returns the CSS style for the content block of the window.
static String getDefaultActionOnShow()
          Deprecated. As release of 5.0.0, replaced with HtmlBasedComponent.setAction(java.lang.String).
 int getMinheight()
          Returns the minimum height.
 int getMinwidth()
          Returns the minimum width.
 String getMode()
          Returns the current mode.
 String getPosition()
          Returns how to position the window at the client screen.
 String getTitle()
          Returns the title.
 String getZclass()
           
 boolean inEmbedded()
          Returns whether this is embedded with other components (Default).
 boolean inHighlighted()
          Returns whether this is a highlighted window.
 boolean inModal()
          Returns whether this is a modal dialog.
 boolean inOverlapped()
          Returns whether this is a overlapped window.
 boolean inPopup()
          Returns whether this is a popup window.
 boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)
           
 boolean isClosable()
          Returns whether to show a close button on the title bar.
 boolean isCollapsible()
          Always return false.
 boolean isMaximizable()
          Returns whether to display the maximizing button and allow the user to maximize the window.
 boolean isMaximized()
          Returns whether the window is maximized.
 boolean isMinimizable()
          Returns whether to display the minimizing button and allow the user to minimize the window.
 boolean isMinimized()
          Returns whether the window is minimized.
 boolean isShadow()
          Returns whether to show the shadow of an overlapped/popup/modal window.
 boolean isSizable()
          Returns whether the window is sizable.
 void onChildRemoved(org.zkoss.zk.ui.Component child)
           
 void onClose()
          Process the onClose event sent when the close button is pressed.
 void onModal()
          Process the onModal event by making itself a modal window.
 void onPageDetached(org.zkoss.zk.ui.Page page)
           
protected  void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
           
 void service(org.zkoss.zk.au.AuRequest request, boolean everError)
          Processes an AU request.
 void setBorder(boolean border)
          Enables or disables the border.
 void setBorder(String border)
          Sets the border (either none or normal).
 void setClosable(boolean closable)
          Sets whether to show a close button on the title bar.
 void setContentSclass(String scls)
          Sets the style class used for the content block.
 void setContentStyle(String style)
          Sets the CSS style for the content block of the window.
static void setDefaultActionOnShow(String onshow)
          Deprecated. As release of 5.0.0, replaced with HtmlBasedComponent.setAction(java.lang.String).
 void setDraggable(String draggable)
           
 void setMaximizable(boolean maximizable)
          Sets whether to display the maximizing button and allow the user to maximize the window, when a window is maximized, the button will automatically change to a restore button with the appropriate behavior already built-in that will restore the window to its previous size.
 void setMaximized(boolean maximized)
          Sets whether the window is maximized, and then the size of the window will depend on it to show a appropriate size.
 void setMinheight(int minheight)
          Sets the minimum height in pixels allowed for this window.
 void setMinimizable(boolean minimizable)
          Sets whether to display the minimizing button and allow the user to minimize the window.
 void setMinimized(boolean minimized)
          Sets whether the window is minimized.
 void setMinwidth(int minwidth)
          Sets the minimum width in pixels allowed for this window.
 void setMode(int mode)
          Sets the mode to overlapped, popup, modal, embedded or highlighted.
 void setMode(String name)
          Sets the mode to overlapped, popup, modal, embedded or highlighted.
 void setPosition(String pos)
          Sets how to position the window at the client screen.
 void setShadow(boolean shadow)
          Sets whether to show the shadow of an overlapped/popup/modal window.
 void setSizable(boolean sizable)
          Sets whether the window is sizable.
 void setTitle(String title)
          Sets the title.
 void setTopmost()
          Makes this window as topmost.
 boolean setVisible(boolean visible)
          Changes the visibility of the window.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, containsVariable, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getUuid, getVariable, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, newChildren, newExtraCtrl, onChildAdded, onPageAttached, onWrongValue, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, renderIdSpace, response, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setVariable, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, unsetVariable, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDroppable, setFocus, setHeight, setLeft, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getUuid, getVariable, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setVariable, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 
Methods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow
 

Field Detail

EMBEDDED

public static final int EMBEDDED
Embeds the window as normal component.

See Also:
Constant Field Values

MODAL

public static final int MODAL
Makes the window as a modal dialog. once doModal() is called, the execution of the event processing thread is suspended until one of the following occurs.
  1. setMode(java.lang.String) is called with a mode other than MODAL.
  2. Either doOverlapped(), doPopup(), doEmbedded(), or doHighlighted() is called.
  3. setVisible(boolean) is called with false.
  4. The window is detached from the window.

Note: In the last two cases, the mode becomes OVERLAPPED. In other words, one might say a modal window is a special overlapped window.

See Also:
HIGHLIGHTED, Constant Field Values

OVERLAPPED

public static final int OVERLAPPED
Makes the window as overlapped other components.

See Also:
Constant Field Values

POPUP

public static final int POPUP
Makes the window as popup. It is similar to OVERLAPPED, except it is auto hidden when user clicks outside of the window.

See Also:
Constant Field Values

HIGHLIGHTED

public static final int HIGHLIGHTED
Makes the window as highlighted. Its visual effect is the same as MODAL. However, from the server side's viewpoint, it is similar to OVERLAPPED. The execution won't be suspended when doHighlighted() is called.

See Also:
MODAL, OVERLAPPED, Constant Field Values
Constructor Detail

Window

public Window()

Window

public Window(String title,
              String border,
              boolean closable)
Parameters:
title - the window title (see setTitle(java.lang.String)).
border - the border (see setBorder(java.lang.String)).
closable - whether it is closable (see setClosable(boolean)).
Method Detail

isMaximized

public boolean isMaximized()
Returns whether the window is maximized.

Specified by:
isMaximized in interface Window
Specified by:
isMaximized in interface Framable
Since:
3.5.0

setMaximized

public void setMaximized(boolean maximized)
Sets whether the window is maximized, and then the size of the window will depend on it to show a appropriate size. In other words, if true, the size of the window will count on the size of its offset parent node whose position is absolute (by not inEmbedded()) or its parent node. Otherwise, its size will be original size. Note that the maximized effect will run at client's sizing phase not initial phase.

Default: false.

Specified by:
setMaximized in interface Window
Throws:
org.zkoss.zk.ui.UiException - if isMaximizable() is false.
Since:
3.5.0

isMaximizable

public boolean isMaximizable()
Returns whether to display the maximizing button and allow the user to maximize the window.

Default: false.

Specified by:
isMaximizable in interface Window
Specified by:
isMaximizable in interface Framable
Since:
3.5.0

setMaximizable

public void setMaximizable(boolean maximizable)
Sets whether to display the maximizing button and allow the user to maximize the window, when a window is maximized, the button will automatically change to a restore button with the appropriate behavior already built-in that will restore the window to its previous size.

Default: false.

Note: the maximize button won't be displayed if no title or caption at all.

Specified by:
setMaximizable in interface Window
Since:
3.5.0

isMinimized

public boolean isMinimized()
Returns whether the window is minimized.

Default: false.

Specified by:
isMinimized in interface Window
Since:
3.5.0

setMinimized

public void setMinimized(boolean minimized)
Sets whether the window is minimized.

Default: false.

Specified by:
setMinimized in interface Window
Throws:
org.zkoss.zk.ui.UiException - if isMinimizable() is false.
Since:
3.5.0

isMinimizable

public boolean isMinimizable()
Returns whether to display the minimizing button and allow the user to minimize the window.

Default: false.

Specified by:
isMinimizable in interface Window
Specified by:
isMinimizable in interface Framable
Since:
3.5.0

setMinimizable

public void setMinimizable(boolean minimizable)
Sets whether to display the minimizing button and allow the user to minimize the window. Note that this button provides no implementation -- the behavior of minimizing a window is implementation-specific, so the MinimizeEvent event must be handled and a custom minimize behavior implemented for this option to be useful.

Default: false.

Note: the maximize button won't be displayed if no title or caption at all.

Specified by:
setMinimizable in interface Window
Since:
3.5.0
See Also:
MinimizeEvent

setMinheight

public void setMinheight(int minheight)
Sets the minimum height in pixels allowed for this window. If negative, 100 is assumed.

Default: 100.

Note: Only applies when isSizable() = true.

Specified by:
setMinheight in interface Window
Since:
3.5.0

getMinheight

public int getMinheight()
Returns the minimum height.

Default: 100.

Specified by:
getMinheight in interface Window
Since:
3.5.0

setMinwidth

public void setMinwidth(int minwidth)
Sets the minimum width in pixels allowed for this window. If negative, 200 is assumed.

Default: 200.

Note: Only applies when isSizable() = true.

Specified by:
setMinwidth in interface Window
Since:
3.5.0

getMinwidth

public int getMinwidth()
Returns the minimum width.

Default: 200.

Specified by:
getMinwidth in interface Window
Since:
3.5.0

setDefaultActionOnShow

public static void setDefaultActionOnShow(String onshow)
Deprecated. As release of 5.0.0, replaced with HtmlBasedComponent.setAction(java.lang.String).


getDefaultActionOnShow

public static String getDefaultActionOnShow()
Deprecated. As release of 5.0.0, replaced with HtmlBasedComponent.setAction(java.lang.String).


getCaption

public Caption getCaption()
Returns the caption of this window.


getCaptionApi

public Caption getCaptionApi()
Returns the caption of this window.

Specified by:
getCaptionApi in interface Window
Since:
3.5.2

getBorder

public String getBorder()
Returns the border.

Default: "none".

Specified by:
getBorder in interface Window

setBorder

public void setBorder(String border)
Sets the border (either none or normal).

Specified by:
setBorder in interface Window
Parameters:
border - the border. If null, "0" or "false", "none" is assumed. If "true", "normal" is assumed (since 5.0.8).

setBorder

public void setBorder(boolean border)
Enables or disables the border.

Parameters:
border - whether to have a border. If true is specified, it is the same as setBorder("normal").
Since:
5.0.8

getTitle

public String getTitle()
Returns the title. Besides this attribute, you could use Caption to define a more sophiscated caption (aka., title).

If a window has a caption whose label (LabelElement.getLabel()) is not empty, then this attribute is ignored.

Default: empty.

Specified by:
getTitle in interface Window
Specified by:
getTitle in interface Framable

setTitle

public void setTitle(String title)
Sets the title.

Specified by:
setTitle in interface Window

getMode

public String getMode()
Returns the current mode. One of "modal", "embedded", "overlapped", "popup", and "highlighted".

Specified by:
getMode in interface Window

setMode

public void setMode(String name)
             throws InterruptedException
Sets the mode to overlapped, popup, modal, embedded or highlighted.

Notice: Events.ON_MODAL is posted if you specify "modal" to this method. Unlike doModal(), Events.ON_MODAL is posted, so the window will become modal later (since 3.0.4). In other words, setMode("modal") never suspends the execution of the current thread. On the other hand, doModal() will suspends the execution if executed in an event listener, or throws an exception if not executed in an event listener.

Refer to Overlapped, Popup, Modal, Highlighted and Embedded for more information.

If the event processing thread is disabled (it is the default), InterruptedException won't be thrown.

Specified by:
setMode in interface Window
Parameters:
name - the mode which could be one of "embedded", "overlapped", "popup", "modal", "highlighted". Note: it cannot be "modal". Use doModal() instead.
Throws:
InterruptedException - thrown if "modal" is specified the event thread is enabled (disabled by default), and one of the following conditions occurs: 1) the desktop or the Web application is being destroyed, or 2) DesktopCtrl.ceaseSuspendedThread(org.zkoss.zk.ui.sys.EventProcessingThread, java.lang.String). To tell the difference, check the getMessage method of InterruptedException.

setMode

public void setMode(int mode)
             throws InterruptedException
Sets the mode to overlapped, popup, modal, embedded or highlighted.

Specified by:
setMode in interface Window
Throws:
InterruptedException
See Also:
setMode(String)

inModal

public boolean inModal()
Returns whether this is a modal dialog.

Specified by:
inModal in interface Window

inEmbedded

public boolean inEmbedded()
Returns whether this is embedded with other components (Default).

Specified by:
inEmbedded in interface Window
See Also:
doEmbedded()

inOverlapped

public boolean inOverlapped()
Returns whether this is a overlapped window.

Specified by:
inOverlapped in interface Window

inPopup

public boolean inPopup()
Returns whether this is a popup window.

Specified by:
inPopup in interface Window

inHighlighted

public boolean inHighlighted()
Returns whether this is a highlighted window.

Specified by:
inHighlighted in interface Window

doModal

public void doModal()
             throws InterruptedException,
                    org.zkoss.zk.ui.SuspendNotAllowedException
Makes this window as a modal dialog. It will automatically center the window (ignoring HtmlBasedComponent.getLeft() and HtmlBasedComponent.getTop()).

Notice: though both setMode("modal") and doModal() both causes the window to become modal, they are a bit different. doModal causes the event listener to suspend immediately, while setMode("modal") posts an event (Events.ON_MODAL). That is, setMode(java.lang.String) won't suspend the execution immediately, but doModal() will. doModal() can be called only in an event listener, while setMode(java.lang.String) can be called anytime.

Specified by:
doModal in interface Window
Throws:
org.zkoss.zk.ui.SuspendNotAllowedException - if 1) not in an event listener;
2) the event thread is disabled.
3) there are too many suspended processing thread than the deployer allows. By default, there is no limit of # of suspended threads.
InterruptedException - thrown if the desktop or the Web application is being destroyed, or DesktopCtrl.ceaseSuspendedThread(org.zkoss.zk.ui.sys.EventProcessingThread, java.lang.String). To tell the difference, check the getMessage method of InterruptedException.
Since:
3.0.4

doOverlapped

public void doOverlapped()
Makes this window as overlapped with other components.

Specified by:
doOverlapped in interface Window

doPopup

public void doPopup()
Makes this window as popup, which is overlapped with other component and auto-hiden when user clicks outside of the window.

Specified by:
doPopup in interface Window

doHighlighted

public void doHighlighted()
Makes this window as highlited. The visual effect is the similar to the modal window, but, like overlapped, it doesn't suspend (block) the execution at the server. In other words, it is more like an overlapped window from the server side's viewpoint.

Specified by:
doHighlighted in interface Window

doEmbedded

public void doEmbedded()
Makes this window as embeded with other components (Default).

Specified by:
doEmbedded in interface Window

isClosable

public boolean isClosable()
Returns whether to show a close button on the title bar.

Specified by:
isClosable in interface Window
Specified by:
isClosable in interface Framable

setClosable

public void setClosable(boolean closable)
Sets whether to show a close button on the title bar. If closable, a button is displayed and the onClose event is sent if an user clicks the button.

Default: false.

You can intercept the default behavior by either overriding onClose(), or listening the onClose event.

Note: the close button won't be displayed if no title or caption at all.

Specified by:
setClosable in interface Window

isSizable

public boolean isSizable()
Returns whether the window is sizable.

Specified by:
isSizable in interface Window

setSizable

public void setSizable(boolean sizable)
Sets whether the window is sizable. If true, an user can drag the border to change the window width.

Default: false.

Specified by:
setSizable in interface Window

isShadow

public boolean isShadow()
Returns whether to show the shadow of an overlapped/popup/modal window. It is meaningless if it is an embedded window.

Since:
3.6.0

setShadow

public void setShadow(boolean shadow)
Sets whether to show the shadow of an overlapped/popup/modal window. It is meaningless if it is an embedded window.

Default: true.

Since:
3.6.0

getPosition

public String getPosition()
Returns how to position the window at the client screen. It is meaningless if the embedded mode is used.

Default: null which depends on getMode(): If overlapped or popup, HtmlBasedComponent.setLeft(java.lang.String) and HtmlBasedComponent.setTop(java.lang.String) are assumed. If modal or highlighted, it is centered.

Specified by:
getPosition in interface Window

setPosition

public void setPosition(String pos)
Sets how to position the window at the client screen. It is meaningless if the embedded mode is used.

Specified by:
setPosition in interface Window
Parameters:
pos - how to position. It can be null (the default), or a combination of the following values (by separating with comma).
center
Position the window at the center. HtmlBasedComponent.setTop(java.lang.String) and HtmlBasedComponent.setLeft(java.lang.String) are both ignored.
nocenter
Not to position the window at the center. A modal window, by default, will be position at the center. By specifying this value could prevent it and the real position depends on HtmlBasedComponent.setTop(java.lang.String) and HtmlBasedComponent.setLeft(java.lang.String) (since 5.0.4)
left
Position the window at the left edge. HtmlBasedComponent.setLeft(java.lang.String) is ignored.
right
Position the window at the right edge. HtmlBasedComponent.setLeft(java.lang.String) is ignored.
top
Position the window at the top edge. HtmlBasedComponent.setTop(java.lang.String) is ignored.
bottom
Position the window at the bottom edge. HtmlBasedComponent.setTop(java.lang.String) is ignored.
parent
Position the window relative to its parent. That is, the left and top (HtmlBasedComponent.getTop() and HtmlBasedComponent.getLeft()) is an offset to his parent's let-top corner. (since 3.0.2)

For example, "left,center" means to position it at the center of the left edge.


onClose

public void onClose()
Process the onClose event sent when the close button is pressed.

Default: detach itself.


onModal

public void onModal()
             throws InterruptedException
Process the onModal event by making itself a modal window.

Throws:
InterruptedException

getContentStyle

public String getContentStyle()
Returns the CSS style for the content block of the window.

Specified by:
getContentStyle in interface Window

setContentStyle

public void setContentStyle(String style)
Sets the CSS style for the content block of the window.

Default: null.

Specified by:
setContentStyle in interface Window

getContentSclass

public String getContentSclass()
Returns the style class used for the content block.

Specified by:
getContentSclass in interface Window
See Also:
setContentSclass(java.lang.String)

setContentSclass

public void setContentSclass(String scls)
Sets the style class used for the content block.

Specified by:
setContentSclass in interface Window
Since:
3.0.0
See Also:
getContentSclass()

setTopmost

public void setTopmost()
Makes this window as topmost. It has no effect if this window is embedded.

Since:
5.0.0

renderProperties

protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                         throws IOException
Overrides:
renderProperties in class XulElement
Throws:
IOException

getZclass

public String getZclass()
Specified by:
getZclass in interface org.zkoss.zk.ui.api.HtmlBasedComponent
Overrides:
getZclass in class org.zkoss.zk.ui.HtmlBasedComponent

beforeChildAdded

public void beforeChildAdded(org.zkoss.zk.ui.Component child,
                             org.zkoss.zk.ui.Component refChild)
Specified by:
beforeChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
beforeChildAdded in class org.zkoss.zk.ui.AbstractComponent

insertBefore

public boolean insertBefore(org.zkoss.zk.ui.Component child,
                            org.zkoss.zk.ui.Component refChild)
Specified by:
insertBefore in interface org.zkoss.zk.ui.Component
Overrides:
insertBefore in class org.zkoss.zk.ui.AbstractComponent

onChildRemoved

public void onChildRemoved(org.zkoss.zk.ui.Component child)
Specified by:
onChildRemoved in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
onChildRemoved in class org.zkoss.zk.ui.AbstractComponent

onPageDetached

public void onPageDetached(org.zkoss.zk.ui.Page page)
Specified by:
onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
onPageDetached in class org.zkoss.zk.ui.AbstractComponent

setVisible

public boolean setVisible(boolean visible)
Changes the visibility of the window.

Note if you turned on the event thread:
If a modal dialog becomes invisible, the modal state will be ended automatically. In other words, the mode (getMode()) will become OVERLAPPED and the suspending thread is resumed. In other words, the modal window (MODAL) can not be invisible (while a window in other modes could be invisible).

However, if the event thread is not enabled (default), there is no such limitation. In other words, it remains the same mode when becoming invisible.

Specified by:
setVisible in interface org.zkoss.zk.ui.Component
Overrides:
setVisible in class org.zkoss.zk.ui.AbstractComponent

setDraggable

public void setDraggable(String draggable)
Specified by:
setDraggable in interface org.zkoss.zk.ui.api.HtmlBasedComponent
Overrides:
setDraggable in class org.zkoss.zk.ui.HtmlBasedComponent

clone

public Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class XulElement

service

public void service(org.zkoss.zk.au.AuRequest request,
                    boolean everError)
Processes an AU request.

Default: in addition to what are handled by HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean), it also handles onOpen.

Specified by:
service in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
service in class org.zkoss.zk.ui.HtmlBasedComponent
Since:
5.0.0

isCollapsible

public boolean isCollapsible()
Always return false.

Specified by:
isCollapsible in interface Framable
Since:
3.6.2


Copyright © 2011. All Rights Reserved.