zul.wnd
Class Window

java.lang.Object
  extended by zk.Object
      extended by zk.Widget
          extended by zul.Widget
              extended by zul.wnd.Window

public class Window
extends Widget

A window.

Unlike other elements, each Window is an independent ID space. 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 Widget.$f(_global_.String, boolean).

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.$f('X').$f('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.

onClose is sent when the close button is pressed (if isClosable() is true). The window has to detach or hide the window.

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 Widget.getZclass(): z-window-getMode().


Field Summary
 
Fields inherited from class zk.Widget
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
 
Fields inherited from class zk.Object
$class, $oid
 
Method Summary
 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.
 String getContentSclass()
          Returns the style class used for the content block.
 String getContentStyle()
          Returns the CSS style for the content block of the window.
 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.
 boolean isClosable()
          Returns whether to show a close button on the title bar.
 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 repos()
          Re-position the window based on the value of getPosition().
 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 contentSclass)
          Sets the style class used for the content block.
 void setContentStyle(String contentStyle)
          Sets the CSS style for the content block of the window.
 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(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.
 
Methods inherited from class zul.Widget
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class zk.Widget
$, $f, $f, $f, $init, $n, $n, $o, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, bindDoubleTap_, bindSwipe_, bindTapHold_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doRightClick_, doSelect_, doSwipe_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHeight, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onChildAdded_, onChildRemoved_, onChildRenderDefer_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, scrollIntoView, sendAU_, set, set, setAction, setChildren, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHeight, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, unbindDoubleTap_, unbindSwipe_, unbindTapHold_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
 
Methods inherited from class zk.Object
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMode

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

Returns:
String

setMode

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

Parameters:
name - the mode which could be one of "embedded", "overlapped", "popup", "modal", "highlighted". Note: it cannot be "modal". Use doModal() instead.

getTitle

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

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

Default: empty.

Returns:
String

setTitle

public void setTitle(String title)
Sets the title.

Parameters:
title -

getBorder

public String getBorder()
Returns the border. The border actually controls what the content style class is is used. In fact, the name of the border (except "normal") is generate as part of the style class used for the content block. Refer to getContentSclass() for more details.

Default: "none".

Returns:
String

setBorder

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

Parameters:
border - the border. If null or "0", "none" is assumed.

isClosable

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

Returns:
boolean

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.

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

Parameters:
closable -

isSizable

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

Returns:
boolean

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.

Parameters:
sizable -

isMaximizable

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

Default: false.

Returns:
boolean

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.

Parameters:
maximizable -

isMinimizable

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

Default: false.

Returns:
boolean

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.

Parameters:
minimizable -

isMaximized

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

Returns:
boolean

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 doEmbedded()) 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.

Parameters:
maximized -

isMinimized

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

Default: false.

Returns:
boolean

setMinimized

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

Default: false.

Parameters:
minimized -

getContentStyle

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

Returns:
String

setContentStyle

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

Default: null.

Parameters:
contentStyle -

getContentSclass

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

Returns:
String

setContentSclass

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

Parameters:
contentSclass -

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, Widget.setLeft(_global_.String) and Widget.setTop(_global_.String) are assumed. If modal or highlighted, it is centered.

Returns:
String

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.

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. Widget.setTop(_global_.String) and Widget.setLeft(_global_.String) are both ignored.
left
Position the window at the left edge. Widget.setLeft(_global_.String) is ignored.
right
Position the window at the right edge. Widget.setLeft(_global_.String) is ignored.
top
Position the window at the top edge. Widget.setTop(_global_.String) is ignored.
bottom
Position the window at the bottom edge. Widget.setTop(_global_.String) is ignored.
parent
Position the window relative to its parent. That is, the left and top (Widget.getTop() and Widget.getLeft()) is an offset to his parent's let-top corner.

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


getMinheight

public int getMinheight()
Returns the minimum height.

Default: 100.

Returns:
int

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.

Parameters:
minheight -

getMinwidth

public int getMinwidth()
Returns the minimum width.

Default: 200.

Returns:
int

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.

Parameters:
minwidth -

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.

Returns:
boolean

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.

Parameters:
shadow -

repos

public void repos()
Re-position the window based on the value of getPosition().

Since:
5.0.3

doOverlapped

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


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.


doHighlighted

public void doHighlighted()
Makes this window as highlited. The visual effect is the similar to the modal window.


doModal

public void doModal()
Makes this window as a modal dialog. It will automatically center the window (ignoring Widget.getLeft() and Widget.getTop()).


doEmbedded

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



Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo