public class Window extends ContainerWidget
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.
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
Modifier and Type | Method and Description |
---|---|
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.
|
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
$, $f, $f, $f, $init, $n, $n, $o, $s, $service, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, bindDoubleTap_, bindMissingAncestors, bindSwipe_, bindTapHold_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedraw_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doPaste_, doResizeScroll_, doRightClick_, doSelect_, doSwipe_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getCssflex, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHeight, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTabindex, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealElement, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onAfterSize, onChildAdded_, onChildRemoved_, onChildRenderDefer_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, rerenderLater_, rerenderNow_, scrollIntoView, sendAU_, set, set, setAction, setChildren, setCssflex, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHeight, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTabindex, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallFireSizedLaterWhenAddChd_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, unbindDoubleTap_, unbindSwipe_, unbindTapHold_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
public String getMode()
public void setMode(String name)
name
- the mode which could be one of
"embedded", "overlapped", "popup", "modal", "highlighted".
Note: it cannot be "modal". Use doModal()
instead.public String getTitle()
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.
public void setTitle(String title)
title
- public String getBorder()
getContentSclass()
for more details.
Default: "none".
public void setBorder(String border)
border
- the border. If null or "0", "none" is assumed.public boolean isClosable()
public void setClosable(boolean closable)
Default: false.
Note: the close button won't be displayed if no title or caption at all.
closable
- public boolean isSizable()
public void setSizable(boolean sizable)
Default: false.
sizable
- public boolean isMaximizable()
Default: false.
public void setMaximizable(boolean maximizable)
Default: false.
Note: the maximize button won't be displayed if no title or caption at all.
maximizable
- public boolean isMinimizable()
Default: false.
public void setMinimizable(boolean minimizable)
Default: false.
Note: the maximize button won't be displayed if no title or caption at all.
minimizable
- public boolean isMaximized()
public void setMaximized(boolean maximized)
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.
maximized
- public boolean isMinimized()
Default: false.
public void setMinimized(boolean minimized)
Default: false.
minimized
- public String getContentStyle()
public void setContentStyle(String contentStyle)
Default: null.
contentStyle
- public String getContentSclass()
public void setContentSclass(String contentSclass)
contentSclass
- public String getPosition()
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.
public void setPosition(String pos)
pos
- how to position. It can be null (the default), or
a combination of the following values (by separating with comma).
Widget.setTop(_global_.String)
and Widget.setLeft(_global_.String)
are both ignored.Widget.setLeft(_global_.String)
is ignored.Widget.setLeft(_global_.String)
is ignored.Widget.setTop(_global_.String)
is ignored.Widget.setTop(_global_.String)
is ignored.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.
public int getMinheight()
Default: 100.
public void setMinheight(int minheight)
Default: 100.
Note: Only applies when isSizable()
= true.
minheight
- public int getMinwidth()
Default: 200.
public void setMinwidth(int minwidth)
Default: 200.
Note: Only applies when isSizable()
= true.
minwidth
- public boolean isShadow()
public void setShadow(boolean shadow)
Default: true.
shadow
- public void repos()
getPosition()
.public void doOverlapped()
public void doPopup()
public void doHighlighted()
public void doModal()
Widget.getLeft()
and
Widget.getTop()
).public void doEmbedded()
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.