|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
public class WCompositeWidget
A widget that hides the implementation of composite widgets.
Composite widgets, built on top of the WebWidgets, should derive from this
class, and use setImplementation() to set the widget that implements the composite widget
(which is typically a WContainerWidget or a WTable, or
another widget that allows composition, including perhaps another
WCompositeWidget).
Using this class you can completely hide the implementation of your composite
widget, and provide access to only the standard WWidget methods.
Styling through CSS is propagated to its implementation.
| Constructor Summary | |
|---|---|
WCompositeWidget()
Creates a WCompositeWidget. |
|
WCompositeWidget(WContainerWidget parent)
Creates a WCompositeWidget. |
|
WCompositeWidget(WWidget implementation,
WContainerWidget parent)
Creates a WCompositeWidget with given implementation. |
|
| Method Summary | |
|---|---|
void |
addStyleClass(java.lang.String styleClass,
boolean force)
Adds a CSS style class. |
protected int |
boxBorder(Orientation orientation)
Returns the widget's built-in border width. |
protected int |
boxPadding(Orientation orientation)
Returns the widget's built-in padding. |
void |
callJavaScriptMember(java.lang.String name,
java.lang.String args)
Calls a JavaScript member. |
void |
doJavaScript(java.lang.String js)
Executes the given JavaScript statements when the widget is rendered or updated. |
protected void |
enableAjax()
Progresses to an Ajax-enabled widget. |
WWidget |
find(java.lang.String name)
Finds a descendent widget by name. |
java.lang.String |
getAttributeValue(java.lang.String name)
Returns an attribute value. |
java.util.EnumSet<Side> |
getClearSides()
Returns the sides that should remain empty. |
WCssDecorationStyle |
getDecorationStyle()
Returns the decoration style of this widget. |
Side |
getFloatSide()
Returns the CSS float side. |
WLength |
getHeight()
Returns the height. |
java.lang.String |
getId()
Returns the (unique) identifier for this object |
protected WWidget |
getImplementation()
Get the implementation widget. |
java.lang.String |
getJavaScriptMember(java.lang.String name)
Returns the value of a JavaScript member. |
WLength |
getLineHeight()
Returns the CSS line height for contained text. |
WLength |
getMargin(Side side)
Returns a CSS margin set. |
WLength |
getMaximumHeight()
Returns the maximum height. |
WLength |
getMaximumWidth()
Returns the maximum width. |
WLength |
getMinimumHeight()
Returns the minimum height. |
WLength |
getMinimumWidth()
Returns the minimum width. |
WLength |
getOffset(Side s)
Returns a CSS offset. |
PositionScheme |
getPositionScheme()
Returns the CSS position scheme. |
java.lang.String |
getStyleClass()
Returns the CSS style class. |
int |
getTabIndex()
Returns the tab index. |
WString |
getToolTip()
Returns the tooltip. |
AlignmentFlag |
getVerticalAlignment()
Returns the vertical alignment. |
WLength |
getVerticalAlignmentLength()
Returns the fixed vertical alignment that was set. |
WLength |
getWidth()
Returns the width. |
boolean |
isDisabled()
Returns whether the widget is set disabled. |
boolean |
isEnabled()
Returns whether the widget is enabled. |
boolean |
isHidden()
Returns whether the widget is set hidden. |
boolean |
isHiddenKeepsGeometry()
Returns whether the widget keeps its geometry when hidden. |
boolean |
isInline()
Returns whether the widget is displayed inline or as block. |
boolean |
isLoaded()
Returns whether this widget has been loaded. |
boolean |
isPopup()
Returns whether the widget is overlayed. |
boolean |
isVisible()
Returns whether the widget is visible. |
void |
load()
Loads content just before the widget is used. |
void |
propagateSetEnabled(boolean enabled)
Propagates that a widget was enabled or disabled through children. |
void |
refresh()
Refresh the widget. |
void |
remove()
Destructor. |
void |
removeStyleClass(java.lang.String styleClass,
boolean force)
Removes a CSS style class. |
void |
resize(WLength width,
WLength height)
Resizes the widget. |
void |
setAttributeValue(java.lang.String name,
java.lang.String value)
Sets an attribute value. |
void |
setClearSides(java.util.EnumSet<Side> sides)
Sets the sides that should be cleared of floats. |
void |
setDecorationStyle(WCssDecorationStyle style)
Sets a CSS decoration style. |
void |
setDisabled(boolean disabled)
Sets whether the widget is disabled. |
void |
setFloatSide(Side s)
Specifies a CSS float side. |
void |
setHidden(boolean hidden,
WAnimation animation)
Hides or shows the widget. |
void |
setHiddenKeepsGeometry(boolean enabled)
Sets whether the widget keeps its geometry when hidden. |
void |
setId(java.lang.String id)
Sets the CSS Id. |
protected void |
setImplementation(WWidget widget)
Set the implementation widget. |
void |
setInline(boolean isInline)
Sets whether the widget is displayed inline or as a block. |
void |
setJavaScriptMember(java.lang.String name,
java.lang.String value)
Sets a JavaScript member. |
void |
setLineHeight(WLength height)
Sets the CSS line height for contained text. |
void |
setMargin(WLength margin,
java.util.EnumSet<Side> sides)
Sets CSS margins around the widget. |
void |
setMaximumSize(WLength width,
WLength height)
Sets a maximum size. |
void |
setMinimumSize(WLength width,
WLength height)
Sets a minimum size. |
void |
setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
Sets CSS offsets for a non-statically positioned widget. |
void |
setPopup(boolean popup)
Lets the widget overlay over other sibling widgets. |
void |
setPositionScheme(PositionScheme scheme)
Sets the CSS position scheme. |
void |
setSelectable(boolean selectable)
Sets as selectable. |
void |
setStyleClass(java.lang.String styleClass)
Sets (one or more) CSS style classes. |
void |
setTabIndex(int index)
Sets the tab index. |
void |
setToolTip(java.lang.CharSequence text,
TextFormat textFormat)
Sets a tooltip. |
void |
setVerticalAlignment(AlignmentFlag alignment,
WLength length)
Sets the vertical alignment. |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, isRendered, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, 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 |
|---|
getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WCompositeWidget(WContainerWidget parent)
You need to set an implemetation using
setImplementation().
public WCompositeWidget()
Calls this((WContainerWidget)null)
public WCompositeWidget(WWidget implementation,
WContainerWidget parent)
| Method Detail |
|---|
public void remove()
WWidgetDeletes a widget and all children (recursively). If the widget is contained in another widget, it is removed first.
remove in class WWidgetWContainerWidget.removeWidget(WWidget widget)public java.lang.String getId()
WObject
For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely
unique, since a WCompositeWidget shares the same id as its implementation.
By default, the id is auto-generated, unless a custom id is set for a widget using WWidget.setId(String). The
auto-generated id is created by concatenating WObject.getObjectName() with a unique number.
getId in class WObjectpublic void setPositionScheme(PositionScheme scheme)
WWidgetEstablishes how the widget must be layed-out relative to its siblings. The default position scheme is Static.
This applies to CSS-based layout.
setPositionScheme in class WWidgetPositionScheme,
WWidget.getPositionScheme()public PositionScheme getPositionScheme()
WWidgetThis applies to CSS-based layout.
getPositionScheme in class WWidgetPositionScheme,
WWidget.setPositionScheme(PositionScheme scheme)
public void setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
WWidget
The argument sides may be a combination of Side.Left, Side.Right, Side.Top, and Side.Bottom.
This applies only to widgets that have a position scheme that is
PositionScheme.Relative, PositionScheme.Absolute, or
PositionScheme.Fixed, and has a slightly different meaning for
these three cases.
For a relatively positioned widget, an
offset applies relative to the position the widget would have when
layed-out using a static position scheme.
The widget may be shifted to the left or right by specifying an offset
for the left or right) side. The
widget may be shifted vertically, by specifying an offset for the
top or bottom side.
For an absolutely positioned widget, an
offset specifies a distance of the corresponding side of the widget with
respect to the corresponding side of the reference parent widget. Thus,
setting all offsets to 0 result in a widget that spans the entire
reference widget. The reference parent widget is the first ancestor
widget that is a table cell, or a widget with a relative, absolute or
fixed position scheme.
For an fixed positioned widget, an offset
specifies a distance of the corresponding side of the widget with respect
to the browser window, regardless of scrolling. Thus, setting all offsets
to 0 result in a widget that spans the entire browser window.
This applies to CSS-based layout.
setOffsets in class WWidgetWWidget.getOffset(Side side)public WLength getOffset(Side s)
WWidgetThis applies to CSS-based layout.
getOffset in class WWidgetWWidget.setOffsets(WLength offset, EnumSet sides)
public void resize(WLength width,
WLength height)
WWidget
Specify a new size for this widget, by specifying width and height. By
default a widget has automatic width and height, see
WLength#isAuto().
This applies to CSS-based layout, and only
block widgets can be given a
size reliably.
When inserted in a layout manager, the widget may be informed about its
current size using setLayoutSizeAware(). If you have defined a
"wtResize()" JavaScript method for the widget,
then this method will also be called. operation.
resize in class WWidgetWWidget.getWidth(),
WWidget.getHeight()public WLength getWidth()
WWidget
Returns the width set for this widget. This is not a calculated width,
based on layout, but the width as specified with
resize().
This applies to CSS-based layout.
getWidth in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getHeight()public WLength getHeight()
WWidget
Returns the height set for this widget. This is not a calculated height,
based on layout, but the height as specified previously with
resize().
This applies to CSS-based layout.
getHeight in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getWidth()
public void setMinimumSize(WLength width,
WLength height)
WWidgetSpecify a minimum size for this widget.
The default minimum width and height is 0. The special value
WLength.Auto indicates that the initial width is used as minimum
size.
When the widget size is actively managed (using e.g. a layout manager), these sizes are taken into account.
setMinimumSize in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getMinimumWidth(),
WWidget.getMinimumHeight()public WLength getMinimumWidth()
WWidget
Returns the minimum width set for this widget with
setMinimumSize().
getMinimumWidth in class WWidgetWWidget.setMinimumSize(WLength width, WLength height),
WWidget.getMinimumHeight()public WLength getMinimumHeight()
WWidget
Returns the minmum height set for this widget with
setMinimumSize().
getMinimumHeight in class WWidgetWWidget.setMinimumSize(WLength width, WLength height),
WWidget.getMinimumWidth()
public void setMaximumSize(WLength width,
WLength height)
WWidgetSpecifies a maximum size for this widget.
The default maximum width and height are WLength.Auto, indicating
no maximum size.
setMaximumSize in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.setMinimumSize(WLength width, WLength height)public WLength getMaximumWidth()
WWidget
Returns the maximum width set for this widget with
setMaximumSize().
getMaximumWidth in class WWidgetWWidget.setMaximumSize(WLength width, WLength height),
WWidget.getMaximumHeight()public WLength getMaximumHeight()
WWidget
Returns the minmum height set for this widget with
setMaximumSize().
getMaximumHeight in class WWidgetWWidget.setMaximumSize(WLength width, WLength height),
WWidget.getMaximumWidth()public void setLineHeight(WLength height)
WWidget
setLineHeight in class WWidgetpublic WLength getLineHeight()
WWidget
getLineHeight in class WWidgetpublic void setFloatSide(Side s)
WWidget
This only applies to widgets with a PositionScheme.Static
getPositionScheme().
This lets the widget float to one of the sides of the parent widget, at
the current line. A typical use is to position images within text. Valid
values for Side or java None , Side.Left or
Side.Right.
This applies to CSS-based layout.
setFloatSide in class WWidgetpublic Side getFloatSide()
WWidget
getFloatSide in class WWidgetWWidget.setFloatSide(Side s)public void setClearSides(java.util.EnumSet<Side> sides)
WWidget
This pushes the widget down until it is not surrounded by floats at the
sides (which may be a combination of Side.Left and
Side.Right).
This applies to CSS-based layout.
setClearSides in class WWidgetWWidget.setFloatSide(Side s)public java.util.EnumSet<Side> getClearSides()
WWidget
getClearSides in class WWidgetWWidget.setClearSides(EnumSet sides)
public void setMargin(WLength margin,
java.util.EnumSet<Side> sides)
WWidgetSetting margin has the effect of adding a distance between the widget and surrounding widgets. The default margin (with an automatic length) is zero.
Use any combination of Side.Left, Side.Right,
Side.Bottom, or Side.Top.
This applies to CSS-based layout.
setMargin in class WWidgetWWidget.getMargin(Side side)public WLength getMargin(Side side)
WWidgetThis applies to CSS-based layout.
getMargin in class WWidgetWWidget.setMargin(WLength margin, EnumSet sides)public void setHiddenKeepsGeometry(boolean enabled)
WWidgetNormally, a widget that is hidden will no longer occupy space, causing a reflow of sibling widgets. Using this method you may change this behavior to keep an (open) space when hidden.
Note: Currently you can only set this before initial rendering.
setHiddenKeepsGeometry in class WWidgetWWidget.setHidden(boolean hidden, WAnimation animation)public boolean isHiddenKeepsGeometry()
WWidget
isHiddenKeepsGeometry in class WWidgetWWidget.setHiddenKeepsGeometry(boolean enabled)
public void setHidden(boolean hidden,
WAnimation animation)
WWidget
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 using isVisible().
setHidden in class WWidgetpublic boolean isHidden()
WWidget
A widget that is not hidden may still be not visible when one of its
ancestor widgets is hidden. Use isVisible()
to check the visibility of a widget.
isHidden in class WWidgetWWidget.setHidden(boolean hidden, WAnimation animation),
WWidget.isVisible()public boolean isVisible()
WWidget
A widget is visible if it is not hidden, and none of its ancestors are
hidden. This method returns the true visibility, while
isHidden() returns whether a widget has been
explicitly hidden.
Note that a widget may be at the same time not hidden, and not visible, in case one of its ancestors was hidden.
isVisible in class WWidgetWWidget.isHidden()public void setDisabled(boolean disabled)
WWidgetEnables or disables the widget (including all its descendant widgets). setDisabled(false) will enable this widget and all descendant widgets that are not disabled. A widget is only enabled if it and all its ancestors in the widget tree are disabled.
Typically, a disabled form widget will not allow changing the value, and disabled widgets will not react to mouse click events.
setDisabled in class WWidgetWWidget.disable(),
WWidget.enable()public boolean isDisabled()
WWidget
A widget that is not set disabled may still be disabled when one of its
ancestor widgets is set disabled. Use isEnabled() to find out whether a widget is enabled.
isDisabled in class WWidgetWWidget.setDisabled(boolean disabled),
WWidget.isEnabled()public boolean isEnabled()
WWidget
A widget is enabled if it is not disabled, and none of its ancestors are
disabled. This method returns whether the widget is rendered as enabled,
while isDisabled() returns whether a widget
has been explicitly disabled.
Note that a widget may be at the same time not enabled, and not disabled, in case one of its ancestors was disabled.
isEnabled in class WWidgetWWidget.isDisabled()public void setPopup(boolean popup)
WWidget
A widget that isPopup() will be rendered on top
of any other sibling widget contained within the same parent (including
other popup widgets previously added to the container).
This will only have an effect when the widgetis either
PositionScheme.Absolute or PositionScheme.Fixed
getPositionScheme().
This applies to CSS-based layout, and configures the z-index property.
setPopup in class WWidgetpublic boolean isPopup()
WWidgetThis applies to CSS-based layout.
isPopup in class WWidgetWWidget.setPopup(boolean popup)public void setInline(boolean isInline)
WWidget
This option changes whether this widget must be rendered in line with
sibling widgets wrapping at the right edge of the parent container (like
text), or whether this widget must be rendered as a rectangular block
that stacks vertically with sibling widgets (unless a CSS float property
is applied). Depending on the widget type, the default value is inline
(such as for example for WText, or WPushButton), or block
(such as for example for a WContainerWidget).
This applies to CSS-based layout.
setInline in class WWidgetpublic boolean isInline()
WWidget
isInline in class WWidgetWWidget.setInline(boolean inlined)public void setDecorationStyle(WCssDecorationStyle style)
WWidget
This copies the style over its current
getDecorationStyle()
setDecorationStyle in class WWidgetpublic WCssDecorationStyle getDecorationStyle()
WWidgetThis groups all decorative aspects of the widget, which do not affect the widget layout (except for the border properties which may behave like extra margin around the widget).
When a decoration style has not been previously set, it returns a default decoration style object.
getDecorationStyle in class WWidgetWWidget.setDecorationStyle(WCssDecorationStyle style)public void setStyleClass(java.lang.String styleClass)
WWidgetYou may set one or more space separated style classes. CSS style class works in conjunction with style sheet, and provides a flexible way to provide many widgets the same markup.
Setting an empty string removes the style class(es).
setStyleClass in class WWidgetWApplication.getStyleSheet()public java.lang.String getStyleClass()
WWidget
getStyleClass in class WWidgetWWidget.setStyleClass(String styleClass)
public void addStyleClass(java.lang.String styleClass,
boolean force)
WWidget
When force = true, a JavaScript call will be
used to add the style class to the DOM element (if JavaScript is
available). This may be necessary when client-side JavaScript manipulates
the same style class.
addStyleClass in class WWidget
public void removeStyleClass(java.lang.String styleClass,
boolean force)
WWidget
When force = true, a JavaScript call will be
used to remove the style class from the DOM element (if JavaScript is
available). This may be necessary when client-side JavaScript manipulates
the same style class.
removeStyleClass in class WWidget
public void setVerticalAlignment(AlignmentFlag alignment,
WLength length)
WWidgetThis only applies to inline widgets, and determines how to position itself on the current line, with respect to sibling inline widgets.
This applies to CSS-based layout.
setVerticalAlignment in class WWidgetpublic AlignmentFlag getVerticalAlignment()
WWidgetThis applies to CSS-based layout.
getVerticalAlignment in class WWidgetWWidget.setVerticalAlignment(AlignmentFlag alignment, WLength
length)public WLength getVerticalAlignmentLength()
WWidgetThis applies to CSS-based layout.
getVerticalAlignmentLength in class WWidgetWWidget.setVerticalAlignment(AlignmentFlag alignment, WLength
length)
public void setToolTip(java.lang.CharSequence text,
TextFormat textFormat)
WWidgetThe tooltip is displayed when the cursor hovers over the widget.
When textFormat is XHTMLText, the tooltip may contain any
valid XHTML snippet. The tooltip will then be rendered using JavaScript.
setToolTip in class WWidgetpublic WString getToolTip()
WWidget
getToolTip in class WWidgetpublic void refresh()
WWidget
The refresh method is invoked when the locale is changed using
WApplication#setLocale() or
when the user hit the refresh button.
The widget must actualize its contents in response.
refresh in class WWidget
public void setAttributeValue(java.lang.String name,
java.lang.String value)
WWidgetAssociate an extra attribute with this widget, with the given value. This is only useful when processing dom nodes associated with widgets in custom JavaScript code.
setAttributeValue in class WWidgetJSlot,
WWidget.doJavaScript(String js)public java.lang.String getAttributeValue(java.lang.String name)
WWidget
getAttributeValue in class WWidgetWWidget.setAttributeValue(String name, String value)
public void setJavaScriptMember(java.lang.String name,
java.lang.String value)
WWidgetThis binds a JavaScript member, which is set as a JavaScript property to the DOM object that implements this widget. The value may be any JavaScript expression, including a function.
Members that start with "wt" are reserved for
internal use. You may define a member
"wtResize(self, width, height)" method if your
widget needs active layout management. If defined, this method will be
used by layout managers and when doing
resize() to set the
size of the widget, instead of setting the CSS width and height
properties.
setJavaScriptMember in class WWidgetpublic java.lang.String getJavaScriptMember(java.lang.String name)
WWidget
getJavaScriptMember in class WWidgetWWidget.setJavaScriptMember(String name, String value)
public void callJavaScriptMember(java.lang.String name,
java.lang.String args)
WWidgetThis calls a JavaScript member.
callJavaScriptMember in class WWidgetWWidget.setJavaScriptMember(String name, String value)public void load()
WWidgetWhen the widget is inserted in the widget hierarchy, this method is called. Widgets that get inserted in the widget hierarchy will be rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground (or not for a plain HTML session). This method is called when the widget is directly or indirectly inserted into the widget tree.
The default implementation simply propagates the load signal to its children. You may want to override this method to delay loading of resource-intensive contents.
During the life-time of a widget, this method may be called multiple times, so you should make sure that you do a deferred initializiation only once.
load in class WWidgetpublic boolean isLoaded()
WWidget
isLoaded in class WWidgetWWidget.load()public void setTabIndex(int index)
WWidgetFor widgets that receive focus, focus is passed on to the next widget in the tabbing chain based on their tab index. When the user navigates through form widgets using the keyboard, widgets receive focus starting from the element with the lowest tab index to elements with the highest tab index.
A tab index only applies to widgets than can receive focus (which are
WFormWidget, WAnchor, WPushButton), but setting a
tab index on any other type of widget will propagate to its contained
form widgets.
Widgets with a same tab index will receive focus in the same order as they are inserted in the widget tree.
The default tab index is 0.
setTabIndex in class WWidgetpublic int getTabIndex()
WWidget
getTabIndex in class WWidgetWWidget.setTabIndex(int index)public void setId(java.lang.String id)
WWidgetSets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed. This is mostly useful for in tests using a test plan that manipulates DOM elements by Id.
By default, auto-generated id's are used.
setId in class WWidgetWObject.getId()public WWidget find(java.lang.String name)
WWidget
find in class WWidgetWObject.setObjectName(String name)public void setSelectable(boolean selectable)
WWidgetWhen a widget is made unselectable, a selection of text (or images) will not be visible (but may still be possible).
By default, the widget inherits this property from its parent, and this
property propagates to all children. The top level container (
WApplication#getRoot()) selectable by
default.
setSelectable in class WWidgetpublic void doJavaScript(java.lang.String js)
WWidget
Calling
WApplication#doJavaScript() with JavaScript code that refers to a widget
using getJsRef(), that is still to be rendered
may cause JavaScript errors because the corresponding DOM node does not
exist. This happens for example when a widget is created, but not yet
inserted in the widget tree.
This method guarantees that the JavaScript code is only run when the
corresponding DOM node (using getJsRef())
resolves to a valid DOM object.
doJavaScript in class WWidgetWWidget.getJsRef()public void propagateSetEnabled(boolean enabled)
WWidget
When enabling or disabling a widget, you usually also want to disable
contained children. This method is called by
setDisabled() to propagate
its state to all children.
You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children.
propagateSetEnabled in class WWidgetprotected void enableAjax()
WWidgetThis 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.
enableAjax in class WWidgetWApplication.enableAjax()protected void setImplementation(WWidget widget)
This sets the widget that implements this compositeWidget. Ownership of the widget is completely transferred (including deletion).
Note: You cannot change the implementation of a composite widget after it has been rendered.
protected WWidget getImplementation()
This returns the widget that implements this compositeWidget.
protected int boxPadding(Orientation orientation)
WWidgetThis is used by the layout managers to correct for a built-in padding which interferes with setting a widget's width (or height) to 100%.
A layout manager needs to set the width to 100% only for form widgets (
WTextArea, WLineEdit, WComboBox, etc...).
Therefore, only for those widgets this needs to return the padding (the
default implementation returns 0).
For form widgets, the padding depends on the specific browser/platform combination, unless an explicit padding is set for the widget.
When setting an explicit padding for the widget using a style class, you will want to reimplement this method to return this padding in case you want to set the widget inside a layout manager.
boxPadding in class WWidgetWWidget.boxBorder(Orientation orientation)protected int boxBorder(Orientation orientation)
WWidgetThis is used by the layout managers to correct for a built-in border which interferes with setting a widget's width (or height) to 100%.
A layout manager needs to set the width to 100% only for form widgets (
WTextArea, WLineEdit, WComboBox, etc...).
Therefore, only for those widgets this needs to return the border width
(the default implementation returns 0).
For form widgets, the border width depends on the specific browser/platform combination, unless an explicit border is set for the widget.
When setting an explicit border for the widget using a style class, you will want to reimplement this method to return this border width, in case you want to set the widget inside a layout manager.
boxBorder in class WWidgetWWidget.boxPadding(Orientation orientation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||