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>
ImmutablePanelcomponentPanel 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
IComponentcomponent 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 classIPanel.BorderSpecifies the border toIPanelcomponent.static classIPanel.BuilderBuilds instances of typeIPanel.static classIPanel.UpdaterBuilds an updater of typeIPanelforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetBorder()Returns the border.IToolbargetBottomToolbar()Returns the bottom toolbar of this component.ICaptiongetCaption()Returns the caption of this panel.IToolbargetFootToolbar()Returns the foot toolbar of this component.default intgetMinheight()Returns the minimum height.default intgetMinwidth()Returns the minimum width.IPanelchildren<? extends IAnyGroup>getPanelchildren()Returns the panelchildren of this component.default java.lang.StringgetTitle()Returns the title.IToolbargetTopToolbar()Returns the top toolbar of this component.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisClosable()Returns whether to show a close button on the title bar.default booleanisCollapsible()Returns whether to show a toggle button on the title bar.default booleanisFloatable()Returns whether to float the panel to display it inline where it is rendered.default booleanisMaximizable()Returns whether to display the maximizing button and allow the user to maximize the panel.default booleanisMaximized()Returns whether the panel is maximized.default booleanisMinimizable()Returns whether to display the minimizing button and allow the user to minimize the panel.default booleanisMinimized()Returns whether the panel is minimized.default booleanisMovable()Returns whether to move the panel to display it inline where it is rendered.default booleanisNativeScrollbar()Returns whether to use Browser's scrollbar or a floating scrollbar (if withfalse).default booleanisOpen()Returns whether this Panel is open.default booleanisSizable()Returns 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 IPanelofCaption(ICaption caption)Returns the instance with the given caption.static IPanelofFootToolbar(IToolbar footToolbar)Returns the instance with the given footIToolbarchild.static IPanelofId(java.lang.String id)Returns the instance with the given id.static IPanelofSize(java.lang.String width, java.lang.String height)Returns the instance with the given size, width and heightstatic IPanelofTitle(java.lang.String title)Returns the instance with the given title.static IPanelofTopToolbar(IToolbar topToolbar)Returns the instance with the given topIToolbarchild.static IPanelofVflex(java.lang.String vflex)Returns the instance with the given vflex.default IPanelwithAllComponents(java.lang.Iterable<? extends IChildrenOfPanel> elements)Copy the current immutable object with elements that replace the content ofchildren.IPanelwithBorder(java.lang.String border)Returns a copy ofthisimmutable component with the specifiedborder.default IPanelwithBorder(IPanel.Border border)Returns a copy ofthisimmutable component with the specifiedborder.IPanelwithBottomToolbar(IToolbar bottomToolbar)Returns a copy ofthisimmutable component with the specifiedbottomToolbar.IPanelwithCaption(ICaption caption)Returns a copy ofthisimmutable component with the specifiedcaption.IPanelwithClosable(boolean closable)Returns a copy ofthisimmutable component with the specifiedclosable.IPanelwithCollapsible(boolean collapsible)Returns a copy ofthisimmutable component with the specifiedcollapsible.IPanelwithFloatable(boolean floatable)Returns a copy ofthisimmutable component with the specifiedfloatable.IPanelwithFootToolbar(IToolbar footToolbar)Returns a copy ofthisimmutable component with the specifiedfootToolbar.IPanelwithMaximizable(boolean maximizable)Returns a copy ofthisimmutable component with the specifiedmaximizable.IPanelwithMaximized(boolean maximized)Returns a copy ofthisimmutable component with the specifiedmaximized.IPanelwithMinheight(int minheight)Returns a copy ofthisimmutable component with the specifiedminheight.IPanelwithMinimizable(boolean minimizable)Returns a copy ofthisimmutable component with the specifiedminimizable.IPanelwithMinimized(boolean minimized)Returns a copy ofthisimmutable component with the specifiedminimized.IPanelwithMinwidth(int minwidth)Returns a copy ofthisimmutable component with the specifiedminwidth.IPanelwithMovable(boolean movable)Returns a copy ofthisimmutable component with the specifiedmovable.IPanelwithNativeScrollbar(boolean nativeScrollbar)Returns a copy ofthisimmutable component with the specifiednativeScrollbar.IPanelwithOpen(boolean open)Returns a copy ofthisimmutable component with the specifiedopen.IPanelwithPanelchildren(IPanelchildren<? extends IAnyGroup> panelchildren)Returns a copy ofthisimmutable component with the specifiedpanelchildren.IPanelwithSizable(boolean sizable)Returns a copy ofthisimmutable component with the specifiedsizable.IPanelwithTitle(java.lang.String title)Returns a copy ofthisimmutable component with the specifiedtitle.IPanelwithTopToolbar(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, 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:
getWidgetClassin interfaceIComponent<IPanel>
-
getCaption
@Nullable ICaption getCaption()
Returns the caption of this panel.Default:
null
-
withCaption
IPanel withCaption(@Nullable ICaption caption)
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
@Nullable IToolbar getTopToolbar()
Returns the top toolbar of this component.Default:
null
-
withTopToolbar
IPanel withTopToolbar(@Nullable IToolbar topToolbar)
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
@Nullable IToolbar getBottomToolbar()
Returns the bottom toolbar of this component.Default:
null
-
withBottomToolbar
IPanel withBottomToolbar(@Nullable IToolbar bottomToolbar)
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
@Nullable IToolbar getFootToolbar()
Returns the foot toolbar of this component.Default:
null
-
withFootToolbar
IPanel withFootToolbar(@Nullable IToolbar footToolbar)
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
@Nullable IPanelchildren<? extends IAnyGroup> getPanelchildren()
Returns the panelchildren of this component.Default:
null
-
withPanelchildren
IPanel withPanelchildren(@Nullable IPanelchildren<? extends IAnyGroup> panelchildren)
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
default IPanel withAllComponents(java.lang.Iterable<? extends IChildrenOfPanel> elements)
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
default java.lang.String 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
IPanel withTitle(java.lang.String title)
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
IPanel withClosable(boolean closable)
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
IPanel withFloatable(boolean floatable)
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
IPanel withCollapsible(boolean collapsible)
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
IPanel withMovable(boolean movable)
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
IPanel withMaximizable(boolean maximizable)
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
IPanel withMinimizable(boolean minimizable)
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
IPanel withMaximized(boolean maximized)
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
IPanel withMinimized(boolean minimized)
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
IPanel withSizable(boolean sizable)
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
IPanel withMinheight(int minheight)
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
IPanel withMinwidth(int minwidth)
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
IPanel withOpen(boolean open)
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
default java.lang.String getBorder()
Returns the border.Default:
"none".
-
withBorder
IPanel withBorder(java.lang.String border)
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
default IPanel withBorder(IPanel.Border border)
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
IPanel withNativeScrollbar(boolean nativeScrollbar)
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
static IPanel of(IPanelchildren panelchildren)
Returns the instance with the givenIPanelchildrenchild.- 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.Borderborder.- Parameters:
border- The border of the component
-
ofTopToolbar
static IPanel ofTopToolbar(IToolbar topToolbar)
Returns the instance with the given topIToolbarchild.- Parameters:
topToolbar- The top toolbar
-
ofBottomToolbar
static IPanel ofBottomToolbar(IToolbar bottomToolbar)
Returns the instance with the given bottomIToolbarchild.- Parameters:
bottomToolbar- The bottom toolbar
-
ofFootToolbar
static IPanel ofFootToolbar(IToolbar footToolbar)
Returns the instance with the given footIToolbarchild.- 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
-
-