zul.wnd
Class Panel

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

public class Panel
extends Widget

Panel is a container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. The Panel contains bottom, top, and foot toolbars, along with separate header, footer and body sections. It also provides built-in collapsible, closable, maximizable, and minimizable behavior, along with a variety of pre-built tool buttons that can be wired up to provide other customized behavior. Panels can be easily embedded into any kind of ZUL component that is allowed to have children or layout component. Panels also provide specific features like float and move. Unlike Window, Panels can only be floated and moved inside its parent node, which is not using jqzk.makeVParent() function. In other words, if Panel's parent node is an relative position, the floated panel is only inside its parent, not the whole page. The second difference of Window is that Panel is not an independent ID space, so the ID of each child can be used throughout the panel.

Events:
onMove, onOpen, onZIndex, onMaximize, onMinimize, and onClose.

Default Widget.getZclass(): z-panel.


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
 boolean addToolbar(String name, Toolbar toolbar)
          Adds the toolbar of the panel by these names, "tbar", "bbar", and "fbar".
 String getBorder()
          Returns the border.
 int getMinheight()
          Returns the minimum height.
 int getMinwidth()
          Returns the minimum width.
 String getTitle()
          Returns the title.
 boolean isClosable()
          Returns whether to show a close button on the title bar.
 boolean isCollapsible()
          Returns whether to show a toggle button on the title bar.
 boolean isFloatable()
          Returns whether to float the panel to display it inline where it is rendered.
 boolean isMaximizable()
          Returns whether to display the maximizing button and allow the user to maximize the panel.
 boolean isMaximized()
          Returns whether the panel is maximized.
 boolean isMinimizable()
          Returns whether to display the minimizing button and allow the user to minimize the panel.
 boolean isMinimized()
          Returns whether the panel is minimized.
 boolean isMovable()
          Returns whether to move the panel to display it inline where it is rendered.
 boolean isOpen()
          Returns whether this Panel is open.
 boolean isSizable()
          Returns whether the panel is sizable.
 void setBorder(String border)
          Sets the border.
 void setClosable(boolean closable)
          Sets whether to show a close button on the title bar.
 void setCollapsible(boolean collapsible)
          Sets whether to show a toggle button on the title bar.
 void setFloatable(boolean floatable)
          Sets whether to float the panel to display it inline where it is rendered.
 void setMaximizable(boolean maximizable)
          Sets whether to display the maximizing button and allow the user to maximize the panel, when a panel is maximized, the button will automatically change to a restore button with the appropriate behavior already built-in that will restore the panel to its previous size.
 void setMaximized(boolean maximized)
          Sets whether the panel is maximized, and then the size of the panel will depend on it to show a appropriate size.
 void setMinheight(int minheight)
          Sets the minimum height in pixels allowed for this panel.
 void setMinimizable(boolean minimizable)
          Sets whether to display the minimizing button and allow the user to minimize the panel.
 void setMinimized(boolean minimized)
          Sets whether the panel is minimized.
 void setMinwidth(int minwidth)
          Sets the minimum width in pixels allowed for this panel.
 void setMovable(boolean movable)
          Sets whether to move the panel to display it inline where it is rendered.
 void setOpen(boolean open)
          Opens or closes this Panel.
 void setSizable(boolean sizable)
          Sets whether the panel 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_, 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_, 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_, 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_, 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

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 panel. 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 panel. If negative, 200 is assumed.

Default: 200.

Note: Only applies when isSizable() = true.

Parameters:
minwidth -

isSizable

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

Returns:
boolean

setSizable

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

Default: false.

Parameters:
sizable -

isMovable

public boolean isMovable()
Returns whether to move the panel to display it inline where it is rendered.

Default: false.

Returns:
boolean

setMovable

public void setMovable(boolean movable)
Sets whether to move the panel to display it inline where it is rendered.

Default: false;

Note that this method only applied when isFloatable() is true.

Parameters:
movable -

isFloatable

public boolean isFloatable()
Returns whether to float the panel to display it inline where it is rendered.

Default: false.

Returns:
boolean

setFloatable

public void setFloatable(boolean floatable)
Sets whether to float the panel to display it inline where it is rendered.

Note that by default, setting floatable to true will cause the panel to display at default offsets, which depend on the offsets of the embedded panel from its element to document.body -- because the panel is absolute positioned, the position must be set explicitly by Widget.setTop(String) and Widget.setLeft(String). Also, when floatable a panel you should always assign a fixed width, otherwise it will be auto width and will expand to fill to the right edge of the viewport.

Parameters:
floatable -

isMaximizable

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

Default: false.

Returns:
boolean

setMaximizable

public void setMaximizable(boolean maximizable)
Sets whether to display the maximizing button and allow the user to maximize the panel, when a panel is maximized, the button will automatically change to a restore button with the appropriate behavior already built-in that will restore the panel 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 panel.

Default: false.

Returns:
boolean

setMinimizable

public void setMinimizable(boolean minimizable)
Sets whether to display the minimizing button and allow the user to minimize the panel. Note that this button provides no implementation -- the behavior of minimizing a panel 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 -

isCollapsible

public boolean isCollapsible()
Returns whether to show a toggle button on the title bar.

Default: false.

Returns:
boolean

setCollapsible

public void setCollapsible(boolean collapsible)
Sets whether to show a toggle button on the title bar.

Default: false.

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

Parameters:
collapsible -

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 -

getBorder

public String getBorder()
Returns the border.

Default: "none".

Returns:
String

setBorder

public void setBorder(String border)
Sets the border. Allowed values include none (default), normal, rounded and rounded+. For more information, please refer to ZK Component Reference: Panel.

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

getTitle

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

If a panel 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 -

isOpen

public boolean isOpen()
Returns whether this Panel is open.

Default: true.

Returns:
boolean

setOpen

public void setOpen(boolean open)
Opens or closes this Panel.

Parameters:
open -

isMaximized

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

Returns:
boolean

setMaximized

public void setMaximized(boolean maximized)
Sets whether the panel is maximized, and then the size of the panel will depend on it to show a appropriate size. In other words, if true, the size of the panel will count on the size of its offset parent node whose position is absolute (by isFloatable()) 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 panel is minimized.

Default: false.

Returns:
boolean

setMinimized

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

Default: false.

Parameters:
minimized -

addToolbar

public boolean addToolbar(String name,
                          Toolbar toolbar)
Adds the toolbar of the panel by these names, "tbar", "bbar", and "fbar". "tbar" is the name of top toolbar, and "bbar" the name of bottom toolbar, and "fbar" the name of foot toolbar.

Parameters:
name - "tbar", "bbar", and "fbar".
toolbar -
Returns:
boolean


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