Interface IPanel
-
- All Superinterfaces:
IAnyGroup<IPanel>
,IComponent<IPanel>
,IComposite<IPanel,IChildrenOfPanel>
,IHtmlBasedComponent<IPanel>
,IXulElement<IPanel>
public interface IPanel extends IXulElement<IPanel>, IAnyGroup<IPanel>, IComposite<IPanel,IChildrenOfPanel>
ImmutablePanel
componentPanel 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. UnlikeIWindow
, Panels can only be floated and moved inside its parent node, which is not usingzk.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 Classes Modifier and Type Interface Description static class
IPanel.Border
Specifies the border toIPanel
component.static class
IPanel.Builder
Builds instances of typeIPanel
.static class
IPanel.Updater
Builds an updater of typeIPanel
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getBorder()
Returns the border.IToolbar
getBottomToolbar()
Returns the bottom toolbar of this component.ICaption
getCaption()
Returns the caption of this panel.IToolbar
getFootToolbar()
Returns the foot toolbar of this component.default int
getMinheight()
Returns the minimum height.default int
getMinwidth()
Returns the minimum width.IPanelchildren<? extends IAnyGroup>
getPanelchildren()
Returns the panelchildren of this component.default java.lang.String
getTitle()
Returns the title.IToolbar
getTopToolbar()
Returns the top toolbar of this component.default java.lang.String
getWidgetClass()
Returns the client widget class.default boolean
isClosable()
Returns whether to show a close button on the title bar.default boolean
isCollapsible()
Returns whether to show a toggle button on the title bar.default boolean
isFloatable()
Returns whether to float the panel to display it inline where it is rendered.default boolean
isMaximizable()
Returns whether to display the maximizing button and allow the user to maximize the panel.default boolean
isMaximized()
Returns whether the panel is maximized.default boolean
isMinimizable()
Returns whether to display the minimizing button and allow the user to minimize the panel.default boolean
isMinimized()
Returns whether the panel is minimized.default boolean
isMovable()
Returns whether to move the panel to display it inline where it is rendered.default boolean
isNativeScrollbar()
Returns whether to use Browser's scrollbar or a floating scrollbar (if withfalse
).default boolean
isOpen()
Returns whether this Panel is open.default boolean
isSizable()
Returns whether the panel is sizable.static IPanel
of(IPanelchildren panelchildren)
Returns the instance with the givenIPanelchildren
child.static IPanel
ofBorder(IPanel.Border border)
Returns the instance with the givenIPanel.Border
border.static IPanel
ofBottomToolbar(IToolbar bottomToolbar)
Returns the instance with the given bottomIToolbar
child.static IPanel
ofCaption(ICaption caption)
Returns the instance with the given caption.static IPanel
ofFootToolbar(IToolbar footToolbar)
Returns the instance with the given footIToolbar
child.static IPanel
ofId(java.lang.String id)
Returns the instance with the given id.static IPanel
ofSize(java.lang.String width, java.lang.String height)
Returns the instance with the given size, width and heightstatic IPanel
ofTitle(java.lang.String title)
Returns the instance with the given title.static IPanel
ofTopToolbar(IToolbar topToolbar)
Returns the instance with the given topIToolbar
child.static IPanel
ofVflex(java.lang.String vflex)
Returns the instance with the given vflex.default IPanel
withAllComponents(java.lang.Iterable<? extends IChildrenOfPanel> elements)
Copy the current immutable object with elements that replace the content ofchildren
.IPanel
withBorder(java.lang.String border)
Returns a copy ofthis
immutable component with the specifiedborder
.default IPanel
withBorder(IPanel.Border border)
Returns a copy ofthis
immutable component with the specifiedborder
.IPanel
withBottomToolbar(IToolbar bottomToolbar)
Returns a copy ofthis
immutable component with the specifiedbottomToolbar
.IPanel
withCaption(ICaption caption)
Returns a copy ofthis
immutable component with the specifiedcaption
.IPanel
withClosable(boolean closable)
Returns a copy ofthis
immutable component with the specifiedclosable
.IPanel
withCollapsible(boolean collapsible)
Returns a copy ofthis
immutable component with the specifiedcollapsible
.IPanel
withFloatable(boolean floatable)
Returns a copy ofthis
immutable component with the specifiedfloatable
.IPanel
withFootToolbar(IToolbar footToolbar)
Returns a copy ofthis
immutable component with the specifiedfootToolbar
.IPanel
withMaximizable(boolean maximizable)
Returns a copy ofthis
immutable component with the specifiedmaximizable
.IPanel
withMaximized(boolean maximized)
Returns a copy ofthis
immutable component with the specifiedmaximized
.IPanel
withMinheight(int minheight)
Returns a copy ofthis
immutable component with the specifiedminheight
.IPanel
withMinimizable(boolean minimizable)
Returns a copy ofthis
immutable component with the specifiedminimizable
.IPanel
withMinimized(boolean minimized)
Returns a copy ofthis
immutable component with the specifiedminimized
.IPanel
withMinwidth(int minwidth)
Returns a copy ofthis
immutable component with the specifiedminwidth
.IPanel
withMovable(boolean movable)
Returns a copy ofthis
immutable component with the specifiedmovable
.IPanel
withNativeScrollbar(boolean nativeScrollbar)
Returns a copy ofthis
immutable component with the specifiednativeScrollbar
.IPanel
withOpen(boolean open)
Returns a copy ofthis
immutable component with the specifiedopen
.IPanel
withPanelchildren(IPanelchildren<? extends IAnyGroup> panelchildren)
Returns a copy ofthis
immutable component with the specifiedpanelchildren
.IPanel
withSizable(boolean sizable)
Returns a copy ofthis
immutable component with the specifiedsizable
.IPanel
withTitle(java.lang.String title)
Returns a copy ofthis
immutable component with the specifiedtitle
.IPanel
withTopToolbar(IToolbar topToolbar)
Returns a copy ofthis
immutable 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, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final IPanel DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.wnd.Panel"
- Specified by:
getWidgetClass
in interfaceIComponent<IPanel>
-
getCaption
@Nullable ICaption getCaption()
Returns the caption of this panel.Default:
null
-
withCaption
IPanel withCaption(@Nullable ICaption caption)
Returns a copy ofthis
immutable 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
this
object
-
getTopToolbar
@Nullable IToolbar getTopToolbar()
Returns the top toolbar of this component.Default:
null
-
withTopToolbar
IPanel withTopToolbar(@Nullable IToolbar topToolbar)
Returns a copy ofthis
immutable 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
this
object
-
getBottomToolbar
@Nullable IToolbar getBottomToolbar()
Returns the bottom toolbar of this component.Default:
null
-
withBottomToolbar
IPanel withBottomToolbar(@Nullable IToolbar bottomToolbar)
Returns a copy ofthis
immutable 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
this
object
-
getFootToolbar
@Nullable IToolbar getFootToolbar()
Returns the foot toolbar of this component.Default:
null
-
withFootToolbar
IPanel withFootToolbar(@Nullable IToolbar footToolbar)
Returns a copy ofthis
immutable 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
this
object
-
getPanelchildren
@Nullable IPanelchildren<? extends IAnyGroup> getPanelchildren()
Returns the panelchildren of this component.Default:
null
-
withPanelchildren
IPanel withPanelchildren(@Nullable IPanelchildren<? extends IAnyGroup> panelchildren)
Returns a copy ofthis
immutable 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
this
object
-
withAllComponents
default IPanel withAllComponents(java.lang.Iterable<? extends IChildrenOfPanel> elements)
Description copied from interface:IComposite
Copy 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:
withAllComponents
in interfaceIComposite<IPanel,IChildrenOfPanel>
- Parameters:
elements
- An iterable of children elements to set- Returns:
- A modified copy of
this
object
-
getTitle
default java.lang.String getTitle()
Returns the title. Besides this attribute, you could useICaption
to 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
IPanel withTitle(java.lang.String title)
Returns a copy ofthis
immutable 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
this
object
-
isClosable
default boolean isClosable()
Returns whether to show a close button on the title bar.Default:
false
-
withClosable
IPanel withClosable(boolean closable)
Returns a copy ofthis
immutable 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
this
object
-
isFloatable
default boolean isFloatable()
Returns whether to float the panel to display it inline where it is rendered.Default:
false
.
-
withFloatable
IPanel withFloatable(boolean floatable)
Returns a copy ofthis
immutable 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
this
object
-
isCollapsible
default boolean isCollapsible()
Returns whether to show a toggle button on the title bar.Default:
false
.
-
withCollapsible
IPanel withCollapsible(boolean collapsible)
Returns a copy ofthis
immutable 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
this
object
-
isMovable
default boolean isMovable()
Returns whether to move the panel to display it inline where it is rendered.Default:
false
.
-
withMovable
IPanel withMovable(boolean movable)
Returns a copy ofthis
immutable 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
this
object
-
isMaximizable
default boolean isMaximizable()
Returns whether to display the maximizing button and allow the user to maximize the panel.Default:
false
.
-
withMaximizable
IPanel withMaximizable(boolean maximizable)
Returns a copy ofthis
immutable 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
this
object
-
isMinimizable
default boolean isMinimizable()
Returns whether to display the minimizing button and allow the user to minimize the panel.Default:
false
.
-
withMinimizable
IPanel withMinimizable(boolean minimizable)
Returns a copy ofthis
immutable 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
this
object
-
isMaximized
default boolean isMaximized()
Returns whether the panel is maximized.
-
withMaximized
IPanel withMaximized(boolean maximized)
Returns a copy ofthis
immutable 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
this
object
-
isMinimized
default boolean isMinimized()
Returns whether the panel is minimized.Default:
false
.
-
withMinimized
IPanel withMinimized(boolean minimized)
Returns a copy ofthis
immutable 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
this
object
-
isSizable
default boolean isSizable()
Returns whether the panel is sizable.Default:
false
-
withSizable
IPanel withSizable(boolean sizable)
Returns a copy ofthis
immutable 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
this
object
-
getMinheight
default int getMinheight()
Returns the minimum height.Default:
100
.
-
withMinheight
IPanel withMinheight(int minheight)
Returns a copy ofthis
immutable component with the specifiedminheight
.Sets the minimum height in pixels allowed for this panel. If negative,
100
is assumed.- Parameters:
minheight
- Whether the panel is sizable.Default:
100
.- Returns:
- A modified copy of the
this
object
-
getMinwidth
default int getMinwidth()
Returns the minimum width.Default:
200
.
-
withMinwidth
IPanel withMinwidth(int minwidth)
Returns a copy ofthis
immutable component with the specifiedminwidth
.Sets the minimum width in pixels allowed for this panel. If negative,
200
is assumed.- Parameters:
minwidth
- Whether the panel is sizable.Default:
200
.- Returns:
- A modified copy of the
this
object
-
isOpen
default boolean isOpen()
Returns whether this Panel is open.Default:
true
.
-
withOpen
IPanel withOpen(boolean open)
Returns a copy ofthis
immutable 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
this
object
-
getBorder
default java.lang.String getBorder()
Returns the border.Default:
"none"
.
-
withBorder
IPanel withBorder(java.lang.String border)
Returns a copy ofthis
immutable 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
this
object
-
withBorder
default IPanel withBorder(IPanel.Border border)
Returns a copy ofthis
immutable component with the specifiedborder
.Sets the border with the given
border
.- Parameters:
border
- The border- Returns:
- A modified copy of the
this
object
-
isNativeScrollbar
default boolean isNativeScrollbar()
Returns whether to use Browser's scrollbar or a floating scrollbar (if withfalse
).Default:
true
to use Browser's scrollbar, if the"org.zkoss.zul.nativebar"
library property is not set in zk.xml.
-
withNativeScrollbar
IPanel withNativeScrollbar(boolean nativeScrollbar)
Returns a copy ofthis
immutable component with the specifiednativeScrollbar
.Sets to use Browser's scrollbar or a floating scrollbar
- Parameters:
nativeScrollbar
-true
to use Browser's scrollbar, orfalse
to use a floating scrollbar.Default:
true
.- Returns:
- A modified copy of the
this
object
-
of
static IPanel of(IPanelchildren panelchildren)
Returns the instance with the givenIPanelchildren
child.- Parameters:
panelchildren
- The panelchildren
-
ofCaption
static IPanel ofCaption(ICaption caption)
Returns the instance with the given caption.- Parameters:
caption
- The caption child
-
ofBorder
static IPanel ofBorder(IPanel.Border border)
Returns the instance with the givenIPanel.Border
border.- Parameters:
border
- The border of the component
-
ofTopToolbar
static IPanel ofTopToolbar(IToolbar topToolbar)
Returns the instance with the given topIToolbar
child.- Parameters:
topToolbar
- The top toolbar
-
ofBottomToolbar
static IPanel ofBottomToolbar(IToolbar bottomToolbar)
Returns the instance with the given bottomIToolbar
child.- Parameters:
bottomToolbar
- The bottom toolbar
-
ofFootToolbar
static IPanel ofFootToolbar(IToolbar footToolbar)
Returns the instance with the given footIToolbar
child.- Parameters:
footToolbar
- The foot toolbar
-
ofVflex
static IPanel ofVflex(java.lang.String vflex)
Returns the instance with the given vflex.- Parameters:
vflex
- The vertical flex hint.
-
ofTitle
static IPanel ofTitle(java.lang.String title)
Returns the instance with the given title.- Parameters:
title
- The title of the component.
-
ofSize
static IPanel ofSize(java.lang.String width, java.lang.String height)
Returns the instance with the given size, width and height- Parameters:
width
- The width of the componentheight
- The height of the component
-
ofId
static IPanel ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-