org.zkoss.zul.api
Interface Panel

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Panel

public interface Panel
extends XulElement

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 zk.setVParent() function at client side. 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 (by implementing IdSpace), so the ID of each child can be used throughout the panel.

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

Default HtmlBasedComponent.getZclass(): z-panel.

Since:
3.5.2
Author:
jumperchen

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 boolean addToolbarApi(java.lang.String name, Toolbar toolbar)
          Adds the toolbar of the panel by these names, "tbar", "bbar", and "fbar".
 java.lang.String getBorder()
          Returns the border.
 Toolbar getBottomToolbarApi()
          Returns the bottom toolbar of this panel.
 Caption getCaptionApi()
          Returns the caption of this panel.
 Toolbar getFootToolbarApi()
          Returns the foot toolbar of this panel.
 int getMinheight()
          Returns the minimum height.
 int getMinwidth()
          Returns the minimum width.
 Panelchildren getPanelchildrenApi()
          Returns the panelchildren of this panel.
 java.lang.String getTitle()
          Returns the title.
 Toolbar getTopToolbarApi()
          Returns the top toolbar of this panel.
 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 isFramable()
          Returns whether to render the panel with custom rounded borders.
 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(java.lang.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 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 setFramable(boolean framable)
          Sets whether to render the panel with custom rounded borders.
 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(java.lang.String title)
          Sets the title.
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, 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, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

isOpen

boolean isOpen()
Returns whether this Panel is open.

Default: true.


setOpen

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


isFramable

boolean isFramable()
Returns whether to render the panel with custom rounded borders.

Default: false.


setFramable

void setFramable(boolean framable)
Sets whether to render the panel with custom rounded borders.

Default: false.


setMovable

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.


isMovable

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

Default: false.


isFloatable

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

Default: false.


setFloatable

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 HtmlBasedComponent.setTop(String) and HtmlBasedComponent.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.


isMaximized

boolean isMaximized()
Returns whether the panel is maximized.


setMaximized

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.

Throws:
UiException - if isMaximizable() is false.

isMaximizable

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

Default: false.


setMaximizable

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.


isMinimized

boolean isMinimized()
Returns whether the panel is minimized.

Default: false.


setMinimized

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

Default: false.

Throws:
UiException - if isMinimizable() is false.

isMinimizable

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

Default: false.


setMinimizable

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.

See Also:
MinimizeEvent

isCollapsible

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

Default: false.


setCollapsible

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.


isClosable

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


setClosable

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 Panel.onClose(), or listening the onClose event.

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


getCaptionApi

Caption getCaptionApi()
Returns the caption of this panel.


getBorder

java.lang.String getBorder()
Returns the border. In fact, the name of the border (except "normal") is generate as part of the style class used for the content block.

Default: "none".


setBorder

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

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

getTitle

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

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

Default: empty.


setTitle

void setTitle(java.lang.String title)
Sets the title.


setMinheight

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.

Since:
5.0.0

getMinheight

int getMinheight()
Returns the minimum height.

Default: 100.

Since:
5.0.0

setMinwidth

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.

Since:
5.0.0

getMinwidth

int getMinwidth()
Returns the minimum width.

Default: 200.

Since:
5.0.0

isSizable

boolean isSizable()
Returns whether the panel is sizable.

Since:
5.0.0

setSizable

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.

Since:
5.0.0

addToolbarApi

boolean addToolbarApi(java.lang.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".

getTopToolbarApi

Toolbar getTopToolbarApi()
Returns the top toolbar of this panel.


getBottomToolbarApi

Toolbar getBottomToolbarApi()
Returns the bottom toolbar of this panel.


getFootToolbarApi

Toolbar getFootToolbarApi()
Returns the foot toolbar of this panel.


getPanelchildrenApi

Panelchildren getPanelchildrenApi()
Returns the panelchildren of this panel.



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