Interface IPanel
- All Superinterfaces:
IAnyGroup<IPanel>,IComponent<IPanel>,IComposite<IPanel,,IChildrenOfPanel> IHtmlBasedComponent<IPanel>,IXulElement<IPanel>
Panel component
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 IComponent component that is allowed
to have children or layout component. Panels also provide specific features like
float and move. Unlike IWindow, 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.
Support @Action
| Name | Action Type |
|---|---|
| onMove | ActionData: MoveData
Denotes the position of the window is moved by a user. |
| onOpen | ActionData: OpenData
Denotes user has opened or closed a component. |
| onMaximize | ActionData: MaximizeData
Denotes user has maximize a component. |
| onMinimize | ActionData: MinimizeData
Denotes user has minimize a component. |
| onClose | ActionData: OpenData
Denotes the close button is pressed by a user, and the component shall detach itself. |
| onSize | ActionData: SizeData
Denotes the panel's size is updated by a user. |
| onZIndex | ActionData: ZIndexData
Denotes the panel's zindex is updated by a user. |
Support Application Library Properties
-
To set to use Browser's scrollbar or not, you have to specify
withNativeScrollbar(boolean).Or configure it from zk.xml by setting library properties. For example,
<library-property/> <name>org.zkoss.zul.nativebar</name/> <value>false</value/> </library-property/>
- Author:
- katherine
- See Also:
-
Panel
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumSpecifies the border toIPanelcomponent.static classBuilds instances of typeIPanel.static classBuilds an updater of typeIPanelforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the border.Returns the bottom toolbar of this component.Returns the caption of this panel.Returns the foot toolbar of this component.default intReturns the minimum height.default intReturns the minimum width.IPanelchildren<? extends IAnyGroup>Returns the panelchildren of this component.default StringgetTitle()Returns the title.Returns the top toolbar of this component.default StringReturns the client widget class.default booleanReturns whether to show a close button on the title bar.default booleanReturns whether to show a toggle button on the title bar.default booleanReturns whether to float the panel to display it inline where it is rendered.default booleanReturns whether to display the maximizing button and allow the user to maximize the panel.default booleanReturns whether the panel is maximized.default booleanReturns whether to display the minimizing button and allow the user to minimize the panel.default booleanReturns whether the panel is minimized.default booleanReturns whether to move the panel to display it inline where it is rendered.default booleanReturns whether to use Browser's scrollbar or a floating scrollbar (if withfalse).default booleanisOpen()Returns whether this Panel is open.default booleanReturns whether the panel is sizable.static IPanelof(IPanelchildren panelchildren) Returns the instance with the givenIPanelchildrenchild.static IPanelofBorder(IPanel.Border border) Returns the instance with the givenIPanel.Borderborder.static IPanelofBottomToolbar(IToolbar bottomToolbar) Returns the instance with the given bottomIToolbarchild.static IPanelReturns the instance with the given caption.static IPanelofFootToolbar(IToolbar footToolbar) Returns the instance with the given footIToolbarchild.static IPanelReturns the instance with the given id.static IPanelReturns the instance with the given size, width and heightstatic IPanelReturns the instance with the given title.static IPanelofTopToolbar(IToolbar topToolbar) Returns the instance with the given topIToolbarchild.static IPanelReturns the instance with the given vflex.default IPanelwithAllComponents(Iterable<? extends IChildrenOfPanel> elements) Copy the current immutable object with elements that replace the content ofchildren.withBorder(String border) Returns a copy ofthisimmutable component with the specifiedborder.default IPanelwithBorder(IPanel.Border border) Returns a copy ofthisimmutable component with the specifiedborder.withBottomToolbar(IToolbar bottomToolbar) Returns a copy ofthisimmutable component with the specifiedbottomToolbar.withCaption(ICaption caption) Returns a copy ofthisimmutable component with the specifiedcaption.withClosable(boolean closable) Returns a copy ofthisimmutable component with the specifiedclosable.withCollapsible(boolean collapsible) Returns a copy ofthisimmutable component with the specifiedcollapsible.withFloatable(boolean floatable) Returns a copy ofthisimmutable component with the specifiedfloatable.withFootToolbar(IToolbar footToolbar) Returns a copy ofthisimmutable component with the specifiedfootToolbar.withMaximizable(boolean maximizable) Returns a copy ofthisimmutable component with the specifiedmaximizable.withMaximized(boolean maximized) Returns a copy ofthisimmutable component with the specifiedmaximized.withMinheight(int minheight) Returns a copy ofthisimmutable component with the specifiedminheight.withMinimizable(boolean minimizable) Returns a copy ofthisimmutable component with the specifiedminimizable.withMinimized(boolean minimized) Returns a copy ofthisimmutable component with the specifiedminimized.withMinwidth(int minwidth) Returns a copy ofthisimmutable component with the specifiedminwidth.withMovable(boolean movable) Returns a copy ofthisimmutable component with the specifiedmovable.withNativeScrollbar(boolean nativeScrollbar) Returns a copy ofthisimmutable component with the specifiednativeScrollbar.withOpen(boolean open) Returns a copy ofthisimmutable component with the specifiedopen.withPanelchildren(IPanelchildren<? extends IAnyGroup> panelchildren) Returns a copy ofthisimmutable component with the specifiedpanelchildren.withSizable(boolean sizable) Returns a copy ofthisimmutable component with the specifiedsizable.Returns a copy ofthisimmutable component with the specifiedtitle.withTopToolbar(IToolbar topToolbar) Returns a copy ofthisimmutable component with the specifiedtopToolbar.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.wnd.Panel"- Specified by:
getWidgetClassin interfaceIComponent<IPanel>
-
getCaption
Returns the caption of this panel.Default:
null -
withCaption
Returns a copy ofthisimmutable component with the specifiedcaption.Sets the caption child of this component.
- Parameters:
caption- The caption child of the component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getTopToolbar
Returns the top toolbar of this component.Default:
null -
withTopToolbar
Returns a copy ofthisimmutable component with the specifiedtopToolbar.Sets the top toolbar of this component.
- Parameters:
topToolbar- The top toolbar of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getBottomToolbar
Returns the bottom toolbar of this component.Default:
null -
withBottomToolbar
Returns a copy ofthisimmutable component with the specifiedbottomToolbar.Sets the bottom toolbar of this component.
- Parameters:
bottomToolbar- The bottom toolbar of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getFootToolbar
Returns the foot toolbar of this component.Default:
null -
withFootToolbar
Returns a copy ofthisimmutable component with the specifiedfootToolbar.Sets the foot toolbar of this component.
- Parameters:
footToolbar- The foot toolbar of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getPanelchildren
Returns the panelchildren of this component.Default:
null -
withPanelchildren
Returns a copy ofthisimmutable component with the specifiedpanelchildren.Sets the panelchildren of this component to contain more child components.
- Parameters:
panelchildren- The panelchildren of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withAllComponents
Description copied from interface:ICompositeCopy the current immutable object with elements that replace the content ofchildren. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Specified by:
withAllComponentsin interfaceIComposite<IPanel,IChildrenOfPanel> - Parameters:
elements- An iterable of children elements to set- Returns:
- A modified copy of
thisobject
-
getTitle
Returns the title. Besides this attribute, you could useICaptionto define a more sophisticated caption (a.k.a., title).If a panel has a caption whose label (
ILabelElement.getLabel()) is not empty, then this attribute is ignored.Default:
""(empty). -
withTitle
Returns a copy ofthisimmutable component with the specifiedtitle.Sets the title of this component.
- Parameters:
title- The title of this component.Default:
""(empty).- Returns:
- A modified copy of the
thisobject
-
isClosable
default boolean isClosable()Returns whether to show a close button on the title bar.Default:
false -
withClosable
Returns a copy ofthisimmutable component with the specifiedclosable.Sets whether to show a close button on the title bar.
- Parameters:
closable- Whether to show a close button on the title bar.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isFloatable
default boolean isFloatable()Returns whether to float the panel to display it inline where it is rendered.Default:
false. -
withFloatable
Returns a copy ofthisimmutable component with the specifiedfloatable.Sets whether to float the panel to display it inline where it is rendered.
- Parameters:
floatable- Whether to float the panel to display it inline where it is rendered.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isCollapsible
default boolean isCollapsible()Returns whether to show a toggle button on the title bar.Default:
false. -
withCollapsible
Returns a copy ofthisimmutable component with the specifiedcollapsible.Sets whether to show a toggle button on the title bar.
- Parameters:
collapsible- Whether to show a toggle button on the title bar.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMovable
default boolean isMovable()Returns whether to move the panel to display it inline where it is rendered.Default:
false. -
withMovable
Returns a copy ofthisimmutable component with the specifiedmovable.Sets whether to move the panel to display it inline where it is rendered.
- Parameters:
movable- Whether to move the panel to display it inline where it is rendered.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMaximizable
default boolean isMaximizable()Returns whether to display the maximizing button and allow the user to maximize the panel.Default:
false. -
withMaximizable
Returns a copy ofthisimmutable component with the specifiedmaximizable.Sets whether to display the maximizing button and allow the user to maximize the panel.
- Parameters:
maximizable- Whether to display the maximizing button and allow the user to maximize the panel.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMinimizable
default boolean isMinimizable()Returns whether to display the minimizing button and allow the user to minimize the panel.Default:
false. -
withMinimizable
Returns a copy ofthisimmutable component with the specifiedminimizable.Sets whether to display the minimizing button and allow the user to minimize the panel.
- Parameters:
minimizable- Whether to display the minimizing button and allow the user to minimize the panel.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMaximized
default boolean isMaximized()Returns whether the panel is maximized. -
withMaximized
Returns a copy ofthisimmutable component with the specifiedmaximized.Sets whether the panel is maximized, and then the size of the panel will depend on it to show an 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.- Parameters:
maximized- Whether the panel is maximized.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isMinimized
default boolean isMinimized()Returns whether the panel is minimized.Default:
false. -
withMinimized
Returns a copy ofthisimmutable component with the specifiedminimized.Sets whether the panel is minimized.
- Parameters:
minimized- Whether the panel is minimized.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isSizable
default boolean isSizable()Returns whether the panel is sizable.Default:
false -
withSizable
Returns a copy ofthisimmutable component with the specifiedsizable.Sets whether the panel is sizable.
- Parameters:
sizable- Whether the panel is sizable.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getMinheight
default int getMinheight()Returns the minimum height.Default:
100. -
withMinheight
Returns a copy ofthisimmutable component with the specifiedminheight.Sets the minimum height in pixels allowed for this panel. If negative,
100is assumed.- Parameters:
minheight- Whether the panel is sizable.Default:
100.- Returns:
- A modified copy of the
thisobject
-
getMinwidth
default int getMinwidth()Returns the minimum width.Default:
200. -
withMinwidth
Returns a copy ofthisimmutable component with the specifiedminwidth.Sets the minimum width in pixels allowed for this panel. If negative,
200is assumed.- Parameters:
minwidth- Whether the panel is sizable.Default:
200.- Returns:
- A modified copy of the
thisobject
-
isOpen
default boolean isOpen()Returns whether this Panel is open.Default:
true. -
withOpen
Returns a copy ofthisimmutable component with the specifiedopen.Sets whether this Panel is open.
- Parameters:
open- Whether this Panel is open.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getBorder
Returns the border.Default:
"none". -
withBorder
Returns a copy ofthisimmutable component with the specifiedborder.Sets the border. Allowed values include
none(default), andnormal. For more information, please refer to ZK Component Reference: Panel.- Parameters:
border- the border. If null,"0"or"false","none"is assumed.- Returns:
- A modified copy of the
thisobject
-
withBorder
Returns a copy ofthisimmutable component with the specifiedborder.Sets the border with the given
border.- Parameters:
border- The border- Returns:
- A modified copy of the
thisobject
-
isNativeScrollbar
default boolean isNativeScrollbar()Returns whether to use Browser's scrollbar or a floating scrollbar (if withfalse).Default:
trueto use Browser's scrollbar, if the"org.zkoss.zul.nativebar"library property is not set in zk.xml. -
withNativeScrollbar
Returns a copy ofthisimmutable component with the specifiednativeScrollbar.Sets to use Browser's scrollbar or a floating scrollbar
- Parameters:
nativeScrollbar-trueto use Browser's scrollbar, orfalseto use a floating scrollbar.Default:
true.- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the givenIPanelchildrenchild.- Parameters:
panelchildren- The panelchildren
-
ofCaption
Returns the instance with the given caption.- Parameters:
caption- The caption child
-
ofBorder
Returns the instance with the givenIPanel.Borderborder.- Parameters:
border- The border of the component
-
ofTopToolbar
Returns the instance with the given topIToolbarchild.- Parameters:
topToolbar- The top toolbar
-
ofBottomToolbar
Returns the instance with the given bottomIToolbarchild.- Parameters:
bottomToolbar- The bottom toolbar
-
ofFootToolbar
Returns the instance with the given footIToolbarchild.- Parameters:
footToolbar- The foot toolbar
-
ofVflex
Returns the instance with the given vflex.- Parameters:
vflex- The vertical flex hint.
-
ofTitle
Returns the instance with the given title.- Parameters:
title- The title of the component.
-
ofSize
Returns the instance with the given size, width and height- Parameters:
width- The width of the componentheight- The height of the component
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-