Class WPanel
- java.lang.Object
-
- eu.webtoolkit.jwt.WObject
-
- eu.webtoolkit.jwt.WWidget
-
- eu.webtoolkit.jwt.WCompositeWidget
-
- eu.webtoolkit.jwt.WPanel
-
public class WPanel extends WCompositeWidget
A WPanel provides a container with a title bar.The panel provides a container with an optional title bar, and an optional collapse icon.
Two panels: one collapsed and one expanded (default theme)
Two panels: one collapsed and one expanded (polished theme)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WPanel()Creates a panel.WPanel(WContainerWidget parentContainer)Creates a panel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollapse()Collapses the panel.Signalcollapsed()Signal emitted when the panel is collapsed.protected voidenableAjax()Progresses to an Ajax-enabled widget.voidexpand()Collapses the panel.Signalexpanded()Signal emitted when the panel is expanded.WWidgetgetCentralWidget()Returns the central widget.WStringgetTitle()Returns the title.WContainerWidgetgetTitleBarWidget()Returns the title bar widget.booleanisCollapsed()Returns if the panel is collapsed.booleanisCollapsible()Returns if the panel can be collapsed by the user.booleanisTitleBar()Returns if a title bar is set.voidsetAnimation(WAnimation transition)Sets an animation.voidsetCentralWidget(WWidget w)Sets the central widget.voidsetCollapsed(boolean on)Sets the panel expanded or collapsed.voidsetCollapsible(boolean on)Makes the panel collapsible.voidsetTitle(java.lang.CharSequence title)Sets a title.voidsetTitleBar(boolean enable)Shows or hides the title bar for the panel.-
Methods inherited from class eu.webtoolkit.jwt.WCompositeWidget
addStyleClass, boxBorder, boxPadding, callJavaScriptMember, doJavaScript, find, findById, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getImplementation, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getObjectName, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getTakeImplementation, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, load, propagateSetEnabled, propagateSetVisible, refresh, remove, removeStyleClass, removeWidget, render, resize, scrollVisibilityChanged, setAttributeValue, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setId, setImplementation, setInline, setJavaScriptMember, setLineHeight, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPopup, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment
-
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
-
Methods inherited from class eu.webtoolkit.jwt.WObject
setFormData
-
-
-
-
Constructor Detail
-
WPanel
public WPanel(WContainerWidget parentContainer)
Creates a panel.
-
WPanel
public WPanel()
Creates a panel.
-
-
Method Detail
-
setTitle
public void setTitle(java.lang.CharSequence title)
Sets a title.The panel title is set in the title bar. This method also makes the title bar visible by calling setTitleBar(true).
The default value is "" (no title).
- See Also:
getTitle(),setTitleBar(boolean enable)
-
getTitle
public WString getTitle()
Returns the title.- See Also:
setTitle(CharSequence title)
-
setTitleBar
public void setTitleBar(boolean enable)
Shows or hides the title bar for the panel.The title bar appears at the top of the panel.
The default value is
false:the title bar is not shown unless a title is set or the panel is made collapsible.If the title bar is hidden, the panel is automatically made non-collapsible, and expands if it was collapsed.
-
isTitleBar
public boolean isTitleBar()
Returns if a title bar is set.- See Also:
setTitleBar(boolean enable)
-
getTitleBarWidget
public WContainerWidget getTitleBarWidget()
Returns the title bar widget.The title bar widget contains the collapse/expand icon (if the panel
isCollapsible()), and the title text (if a title was set usingsetTitle()). You can access the title bar widget to customize the contents of the title.The method returns
nullifisTitleBar()isfalse. You need to callsetTitleBar()first.- See Also:
setTitleBar(boolean enable)
-
setCollapsible
public void setCollapsible(boolean on)
Makes the panel collapsible.When
onistrue, a collapse/expand icon is added to the title bar. This also calls setTitleBar(true) to enable the title bar.Additionally, the Wt-collapsible class is added to the panel.
The default value is
false.
-
isCollapsible
public boolean isCollapsible()
Returns if the panel can be collapsed by the user.- See Also:
setCollapsible(boolean on)
-
setCollapsed
public void setCollapsed(boolean on)
Sets the panel expanded or collapsed.When
onistrue, equivalent tocollapse(), otherwise toexpand().The default value is
false.If the panel is collapsed, the Wt-collapsed style class is added.
-
isCollapsed
public boolean isCollapsed()
Returns if the panel is collapsed.
-
collapse
public void collapse()
Collapses the panel.When
isCollapsible()is true, the panel is collapsed to minimize screen real-estate.
-
expand
public void expand()
Collapses the panel.When
isCollapsible()is true, the panel is expanded to its original state.
-
setAnimation
public void setAnimation(WAnimation transition)
Sets an animation.The animation is used when collapsing or expanding the panel.
Note: It is possible to make a
WPanelcollapsible withWBootstrap5Theme, but it's not possible to set the animation.
-
setCentralWidget
public void setCentralWidget(WWidget w)
Sets the central widget.Sets the widget that is the contents of the panel.
The default value is
null(no widget set).
-
getCentralWidget
public WWidget getCentralWidget()
Returns the central widget.- See Also:
setCentralWidget(WWidget w)
-
collapsed
public Signal collapsed()
Signal emitted when the panel is collapsed.Signal emitted when the panel is collapsed. The signal is only emitted when the panel is collapsed by the user using the collapse icon in the tible bar, not when calling
setCollapsed().
-
expanded
public Signal expanded()
Signal emitted when the panel is expanded.Signal emitted when the panel is expanded. The signal is only emitted when the panel is expanded by the user using the expand icon in the title bar, not when calling
setCollapsed().
-
enableAjax
protected void enableAjax()
Description copied from class:WWidgetProgresses to an Ajax-enabled widget.This method is called when the progressive bootstrap method is used, and support for AJAX has been detected. The default behavior will upgrade the widget's event handling to use AJAX instead of full page reloads, and propagate the call to its children.
You may want to reimplement this method if you want to make changes to widget when AJAX is enabled. You should always call the base implementation.
- Overrides:
enableAjaxin classWCompositeWidget- See Also:
WApplication.enableAjax()
-
-