Class WPopupWidget
- Direct Known Subclasses:
WDialog
,WSuggestionPopup
public class WPopupWidget extends WCompositeWidget
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
Constructors Constructor Description WPopupWidget(WWidget impl)
Constructor.WPopupWidget(WWidget impl, WObject parent)
Constructor. -
Method Summary
Modifier and Type Method Description WWidget
getAnchorWidget()
int
getAutoHideDelay()
Returns the auto-hide delay.Orientation
getOrientation()
Returns the orientation.Signal
hidden()
Signal emitted when the popup is hidden.boolean
isDeleteWhenHidden()
Returns whether auto delete is enabled.boolean
isTransient()
Returns whether the popup is transient.protected void
onPathChange()
void
remove()
Destructor.protected void
render(java.util.EnumSet<RenderFlag> flags)
Renders the widget.void
setAnchorWidget(WWidget anchorWidget)
Sets an anchor widget.void
setAnchorWidget(WWidget anchorWidget, Orientation orientation)
Sets an anchor widget.void
setDeleteWhenHidden(boolean enable)
Lets the popup delete itself when hidden.void
setHidden(boolean hidden, WAnimation animation)
Hides or shows the widget.protected void
setParent(WObject p)
void
setTransient(boolean isTransient)
Sets transient property.void
setTransient(boolean isTransient, int autoHideDelay)
Sets transient property.Signal
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, 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, 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, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, removeChild, 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
addChild, setFormData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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 does not need a parent widget (it acts like a pseudo top-level widget), but it can be given a parent object which is used to scope its lifetime.
-
WPopupWidget
Constructor.
-
-
Method Details
-
remove
public void remove()Destructor.- Overrides:
remove
in classWCompositeWidget
- See Also:
WContainerWidget.removeWidget(WWidget widget)
-
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. -
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. -
setDeleteWhenHidden
public void setDeleteWhenHidden(boolean enable)Lets the popup delete itself when hidden.When this is enabled, the popup will delete itself when hidden. You need to take care that when overriding
setHidden()
, the popup may thus be deleted from withinsetHidden()
.The default value is
false
. -
isDeleteWhenHidden
public boolean isDeleteWhenHidden()Returns whether auto delete is enabled.- See Also:
setDeleteWhenHidden(boolean enable)
-
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 hidden 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
-
setParent
-
onPathChange
protected void onPathChange()
-