Class WPopupWidget
- Direct Known Subclasses:
WDialog
,WSuggestionPopup
A popup widget anchors to another widget, for which it usually provides additional information or assists in editing, etc...
The popup widget will position itself relative to the anchor widget by taking into account available space, and switching sides if necessary to fit the widget into the current window. For example, a vertically anchored widget will by default be a "drop-down", positioning itself under the anchor widget, but it may also choose to position itself above the anchor widget if space is lacking below.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the auto-hide delay.Returns the orientation.hidden()
Signal emitted when the popup is hidden.boolean
Returns whether the popup is transient.protected void
void
remove()
Destructor.protected void
render
(EnumSet<RenderFlag> flags) Renders the widget.final void
setAnchorWidget
(WWidget anchorWidget) Sets an anchor widget.void
setAnchorWidget
(WWidget anchorWidget, Orientation orientation) Sets an anchor widget.void
setHidden
(boolean hidden, WAnimation animation) Hides or shows the widget.final void
setTransient
(boolean isTransient) Sets transient property.void
setTransient
(boolean isTransient, int autoHideDelay) Sets transient property.shown()
Signal emitted when the popup is shown.Methods inherited from class eu.webtoolkit.jwt.WCompositeWidget
addStyleClass, boxBorder, boxPadding, callJavaScriptMember, doJavaScript, enableAjax, 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, removeStyleClass, removeWidget, resize, scrollVisibilityChanged, setAttributeValue, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHiddenKeepsGeometry, setId, setImplementation, setInline, setJavaScriptMember, setLineHeight, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, 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, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, 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 Details
-
WPopupWidget
Constructor.You need to pass in a widget that provides the main contents of the widget (e.g. a
WTemplate
orWContainerWidget
).Unlike other widgets, a popup widget is a top-level widget that should not be added to another container.
-
-
Method Details
-
remove
public void remove()Destructor.- Overrides:
remove
in classWCompositeWidget
- See Also:
-
setAnchorWidget
Sets an anchor widget.A vertical popup will show below (or above) the widget, while a horizontal popup will show right (or left) of the widget.
-
setAnchorWidget
Sets an anchor widget. -
getAnchorWidget
-
getOrientation
Returns the orientation. -
setTransient
public void setTransient(boolean isTransient, int autoHideDelay) Sets transient property.A transient popup will automatically hide when the user clicks outside of the popup. When
autoHideDelay
is not 0, then it will also automatically hide when the user moves the mouse outside the widget for longer than this delay (in ms). -
setTransient
public final void setTransient(boolean isTransient) Sets transient property. -
isTransient
public boolean isTransient()Returns whether the popup is transient. -
getAutoHideDelay
public int getAutoHideDelay()Returns the auto-hide delay. -
setHidden
Description copied from class:WWidget
Hides or shows the widget.Hides or show the widget (including all its descendant widgets). When setting
hidden
=false
, this widget and all descendant widgets that are not hidden will be shown. A widget is only visible if it and all its ancestors in the widget tree are visible, which may be checked usingisVisible()
.- Overrides:
setHidden
in classWCompositeWidget
-
shown
Signal emitted when the popup is shown.This signal is emitted when the popup is being shown because of a client-side event (not when
setHidden()
orWWidget.show()
is called). -
render
Description copied from class:WWidget
Renders the widget.This function renders the widget (or an update for the widget), after this has been scheduled using
scheduleRender()
.The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.
- Overrides:
render
in classWCompositeWidget
-
onPathChange
protected void onPathChange()
-