|
||||||||||
| 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
public abstract class WWidget
The abstract base class for a user-interface component
The user-interface is organized in a tree structure, in which each nodes is a
widgets. All widgets, except for the application's root widget and
dialogs, have a parent which is usually a WContainerWidget.
This is an abstract base class. Implementations derive either from the
abstract WWebWidget (for basic widgets with a direct HTML
counter-part) or from the abstract WCompositeWidget (for anything
else). To add a WWebWidget directly to a parent container, either specify the
parent in the constructor (which is conventionally the last constructor
argument), or add the widget to the parent using
WContainerWidget#addWidget(). Alternatively, you may add the widget to a
layout manager set for a WContainerWidget.
A widget provides methods to manage its decorative style base on CSS. It also provides access to CSS-based layout, which you may not use when the widget is not inserted into a layout manager.
| Constructor Summary | |
|---|---|
protected |
WWidget()
Creates a widget. |
protected |
WWidget(WContainerWidget parent)
Creates a widget. |
| Method Summary | |
|---|---|
void |
acceptDrops(java.lang.String mimeType)
Sets a mime type to be accepted for dropping. |
void |
acceptDrops(java.lang.String mimeType,
java.lang.String hoverStyleClass)
Sets a mime type to be accepted for dropping. |
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. |
abstract void |
callJavaScriptMember(java.lang.String name,
java.lang.String args)
Calls a JavaScript member. |
void |
disable()
Disable thes widget. |
protected void |
dropEvent(WDropEvent event)
Handles a drop event. |
void |
enable()
Enables the widget. |
protected abstract void |
enableAjax()
Progresses to an Ajax-enabled widget. |
abstract WWidget |
find(java.lang.String name)
Finds a descendend widget by name. |
abstract java.lang.String |
getAttributeValue(java.lang.String name)
Returns an attribute value. |
abstract java.util.EnumSet<Side> |
getClearSides()
Returns the sides that should remain empty. |
abstract WCssDecorationStyle |
getDecorationStyle()
Returns the decoration style of this widget. |
abstract Side |
getFloatSide()
Returns the CSS float side. |
abstract WLength |
getHeight()
Returns the height. |
abstract java.lang.String |
getJavaScriptMember(java.lang.String name)
Returns the value of a JavaScript member. |
java.lang.String |
getJsRef()
Returns a JavaScript expression to the corresponding DOM node. |
abstract WLength |
getLineHeight()
Returns the CSS line height for contained text. |
abstract WLength |
getMargin(Side side)
Returns a CSS margin set. |
abstract WLength |
getMaximumHeight()
Returns the maximum height. |
abstract WLength |
getMaximumWidth()
Returns the maximum width. |
abstract WLength |
getMinimumHeight()
Returns the minimum height. |
abstract WLength |
getMinimumWidth()
Returns the minimum width. |
abstract WLength |
getOffset(Side side)
Returns a CSS offset. |
WWidget |
getParent()
Returns the parent widget. |
abstract PositionScheme |
getPositionScheme()
Returns the CSS position scheme. |
abstract java.lang.String |
getStyleClass()
Returns the CSS style class. |
abstract WString |
getToolTip()
Returns the tooltip. |
abstract AlignmentFlag |
getVerticalAlignment()
Returns the vertical alignment. |
abstract WLength |
getVerticalAlignmentLength()
Returns the fixed vertical alignment that was set. |
abstract WLength |
getWidth()
Returns the width. |
void |
hide()
Hides the widget. |
void |
htmlText(java.io.Writer out)
Streams the (X)HTML representation. |
abstract boolean |
isDisabled()
Returns whether the widget is set disabled. |
abstract boolean |
isEnabled()
Returns whether the widget is enabled. |
abstract boolean |
isHidden()
Returns whether the widget is set hidden. |
abstract boolean |
isHiddenKeepsGeometry()
Returns whether the widget keeps its geometry when hidden. |
abstract boolean |
isInline()
Returns whether the widget is displayed inline or as block. |
abstract boolean |
isLoaded()
Returns whether this widget has been loaded. |
abstract boolean |
isPopup()
Returns whether the widget is overlayed. |
boolean |
isRendered()
Returns whether the widget is rendered. |
abstract void |
load()
Loads content just before the widget is used. |
void |
positionAt(WWidget widget)
Positions a widget next to another widget. |
void |
positionAt(WWidget widget,
Orientation orientation)
Positions a widget next to another widget. |
void |
refresh()
Refresh the widget. |
void |
remove()
Destructor. |
void |
resize(int widthPixels,
int heightPixels)
Resizes the widget. |
void |
resize(WLength width,
WLength height)
Resizes the widget. |
abstract void |
setAttributeValue(java.lang.String name,
java.lang.String value)
Sets an attribute value. |
abstract void |
setClearSides(java.util.EnumSet<Side> sides)
Sets the sides that should be cleared of floats. |
void |
setClearSides(Side side,
Side... sides)
Sets the sides that should be cleared of floats. |
abstract void |
setDecorationStyle(WCssDecorationStyle style)
Sets a CSS decoration style. |
abstract void |
setDisabled(boolean disabled)
Sets whether the widget is disabled. |
abstract void |
setFloatSide(Side s)
Specifies a CSS float side. |
abstract void |
setHidden(boolean hidden)
Sets whether the widget is hidden. |
abstract void |
setHiddenKeepsGeometry(boolean enabled)
Sets whether the widget keeps its geometry when hidden. |
abstract void |
setId(java.lang.String id)
Sets the CSS Id. |
abstract void |
setInline(boolean inlined)
Sets whether the widget is displayed inline or as a block. |
abstract void |
setJavaScriptMember(java.lang.String name,
java.lang.String value)
Sets a JavaScript member. |
abstract void |
setLineHeight(WLength height)
Sets the CSS line height for contained text. |
void |
setMargin(int pixels)
Sets CSS margins around the widget. |
void |
setMargin(int pixels,
java.util.EnumSet<Side> sides)
Sets CSS margins around the widget. |
void |
setMargin(int pixels,
Side side,
Side... sides)
Sets CSS margins around the widget. |
void |
setMargin(WLength margin)
Sets CSS margins around the widget. |
abstract void |
setMargin(WLength margin,
java.util.EnumSet<Side> sides)
Sets CSS margins around the widget. |
void |
setMargin(WLength margin,
Side side,
Side... sides)
Sets CSS margins around the widget. |
abstract void |
setMaximumSize(WLength width,
WLength height)
Sets a maximum size. |
abstract void |
setMinimumSize(WLength width,
WLength height)
Sets a minimum size. |
void |
setOffsets(int pixels)
Sets CSS offsets for a non-statically positioned widget. |
void |
setOffsets(int pixels,
java.util.EnumSet<Side> sides)
Sets CSS offsets for a non-statically positioned widget. |
void |
setOffsets(int pixels,
Side side,
Side... sides)
Sets CSS offsets for a non-statically positioned widget. |
void |
setOffsets(WLength offset)
Sets CSS offsets for a non-statically positioned widget. |
abstract void |
setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
Sets CSS offsets for a non-statically positioned widget. |
void |
setOffsets(WLength offset,
Side side,
Side... sides)
Sets CSS offsets for a non-statically positioned widget. |
abstract void |
setPopup(boolean popup)
Lets the widget overlay over other sibling widgets. |
abstract void |
setPositionScheme(PositionScheme scheme)
Sets the CSS position scheme. |
abstract void |
setSelectable(boolean selectable)
Sets as selectable. |
abstract void |
setStyleClass(java.lang.String styleClass)
Sets (one or more) CSS style classes. |
abstract void |
setToolTip(java.lang.CharSequence text)
Sets a tooltip. |
void |
setVerticalAlignment(AlignmentFlag alignment)
Sets the vertical alignment. |
abstract void |
setVerticalAlignment(AlignmentFlag alignment,
WLength length)
Sets the vertical alignment. |
void |
show()
Shows the widget. |
void |
stopAcceptDrops(java.lang.String mimeType)
Indicates that a mime type is no longer accepted for dropping. |
static WString |
tr(java.lang.String key)
Short hand for WString#tr(). |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
getId, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected WWidget(WContainerWidget parent)
When a parent container is specified, the widget is added to the
container, using WContainerWidget#addWidget().
protected WWidget()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void remove()
Deletes a widget and all children (recursively). If the widget is contained in another widget, it is removed first.
remove in class WObjectWContainerWidget.removeWidget(WWidget widget)public WWidget getParent()
With a few exceptions, the parent is a WContainerWidget, and has
been set implicitly when adding the widget to a container using
WContainerWidget#addWidget(), by passing a container as a parent to the
constructor, or by inserting the widget into a layout manager.
public abstract void setPositionScheme(PositionScheme scheme)
Establishes how the widget must be layed-out relative to its siblings. The default position scheme is Static.
This applies to CSS-based layout.
PositionScheme,
getPositionScheme()public abstract PositionScheme getPositionScheme()
This applies to CSS-based layout.
PositionScheme,
setPositionScheme(PositionScheme scheme)
public abstract void setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
The argument sides may be a combination of Left, Right, Top, and
Bottom.
This applies only to widgets that have a position scheme that is
Relative, Absolute, or 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 to the
Left or Right). The widget may be
shifted vertically, by specifying an offset for the
Top or Bottom.
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.
getOffset(Side side)
public final void setOffsets(WLength offset,
Side side,
Side... sides)
Calls setOffsets(offset, EnumSet.of(side, sides))
public final void setOffsets(WLength offset)
Calls setOffsets(offset, Side.All)
public void setOffsets(int pixels,
java.util.EnumSet<Side> sides)
This is a convenience method for applying offsets in pixel units.
setOffsets(WLength offset, EnumSet sides)
public final void setOffsets(int pixels,
Side side,
Side... sides)
Calls setOffsets(pixels,
EnumSet.of(side, sides))
public final void setOffsets(int pixels)
Calls setOffsets(pixels,
Side.All)
public abstract WLength getOffset(Side side)
This applies to CSS-based layout.
setOffsets(WLength offset, EnumSet sides)
public void resize(WLength width,
WLength height)
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.
See als setJavaScriptMember() for defining a "wtResize" method which
allows a widget to actively manage its size using client-side JavaScript.
getWidth(),
getHeight()
public void resize(int widthPixels,
int heightPixels)
This is a convenience method for resizing a widget using pixel units.
resize(WLength width, WLength height)public abstract WLength getWidth()
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.
resize(WLength width, WLength height),
getHeight()public abstract WLength getHeight()
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.
resize(WLength width, WLength height),
getWidth()
public abstract void setMinimumSize(WLength width,
WLength height)
Specify a minimum size for this widget. When the widget is managed using a layout manager, these sizes are also taken into account.
resize(WLength width, WLength height),
getMinimumWidth(),
getMinimumHeight()public abstract WLength getMinimumWidth()
Returns the minimum width set for this widget with
setMinimumSize().
setMinimumSize(WLength width, WLength height),
getMinimumHeight()public abstract WLength getMinimumHeight()
Returns the minmum height set for this widget with
setMinimumSize().
setMinimumSize(WLength width, WLength height),
getMinimumWidth()
public abstract void setMaximumSize(WLength width,
WLength height)
Specify a minimum size for this widget.
resize(WLength width, WLength height),
getMaximumWidth(),
getMaximumHeight()public abstract WLength getMaximumWidth()
Returns the maximum width set for this widget with
setMaximumSize().
setMaximumSize(WLength width, WLength height),
getMaximumHeight()public abstract WLength getMaximumHeight()
Returns the minmum height set for this widget with
setMaximumSize().
setMaximumSize(WLength width, WLength height),
getMaximumWidth()
public void positionAt(WWidget widget,
Orientation orientation)
Positions this absolutely positioned widget next to another
widget. Both widgets must be visible.
When orientation = Vertical, the widget is displayed below
the other widget (or above in case there is not enough room below). It is
aligned so that the left edges align (or the right edges if there is not
enough room to the right).
Conversely, when orientation = Horizontal, the widget is
displayed to the right of the other widget (or to the left in case there
is not enough room to the right). It is aligned so that the top edges
align (or the bottom edges if there is not enough room below).
Note: This only works if JavaScript is available.
public final void positionAt(WWidget widget)
Calls positionAt(widget, Orientation.Vertical)
public abstract void setLineHeight(WLength height)
public abstract WLength getLineHeight()
public abstract void setFloatSide(Side s)
This only applies to widgets with a 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 None , Left or
Right.
This applies to CSS-based layout.
public abstract Side getFloatSide()
setFloatSide(Side s)public abstract void setClearSides(java.util.EnumSet<Side> sides)
This pushes the widget down until it is not surrounded by floats at the
sides (which may be a combination of Left
and Right.
This applies to CSS-based layout.
setFloatSide(Side s)
public final void setClearSides(Side side,
Side... sides)
Calls setClearSides(EnumSet.of(side,
sides))
public abstract java.util.EnumSet<Side> getClearSides()
setClearSides(EnumSet sides)
public abstract void setMargin(WLength margin,
java.util.EnumSet<Side> sides)
Setting 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 Left, Right,
Bottom, or Top.
This applies to CSS-based layout.
getMargin(Side side)
public final void setMargin(WLength margin,
Side side,
Side... sides)
Calls setMargin(margin,
EnumSet.of(side, sides))
public final void setMargin(WLength margin)
Calls setMargin(margin,
Side.All)
public void setMargin(int pixels,
java.util.EnumSet<Side> sides)
This is a convenience method for setting margins in pixel units.
setMargin(WLength margin, EnumSet sides)
public final void setMargin(int pixels,
Side side,
Side... sides)
Calls setMargin(pixels,
EnumSet.of(side, sides))
public final void setMargin(int pixels)
Calls setMargin(pixels,
Side.All)
public abstract WLength getMargin(Side side)
This applies to CSS-based layout.
setMargin(WLength margin, EnumSet sides)public abstract void setHiddenKeepsGeometry(boolean enabled)
Normally, 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.
setHidden(boolean hidden)public abstract boolean isHiddenKeepsGeometry()
setHiddenKeepsGeometry(boolean enabled)public abstract void setHidden(boolean hidden)
Hides or show the widget (including all its descendant widgets).
setHidden(false) will show this widget and all descendant widgets that
are not hidden. A widget is only visible if it and all its ancestors in
the widget tree are visible, which may be checked using
isVisible().
hide(),
show()public abstract boolean isHidden()
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.
setHidden(boolean hidden),
isVisible()public abstract void setDisabled(boolean disabled)
Enables 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.
disable(),
enable()public abstract boolean isDisabled()
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.
setDisabled(boolean disabled),
isEnabled()public abstract boolean isEnabled()
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.
isDisabled()public abstract void setPopup(boolean popup)
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
Absolute or Fixed getPositionScheme().
This applies to CSS-based layout, and configures the z-index property.
public abstract boolean isPopup()
This applies to CSS-based layout.
setPopup(boolean popup)public abstract void setInline(boolean inlined)
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.
public abstract boolean isInline()
setInline(boolean inlined)public abstract void setDecorationStyle(WCssDecorationStyle style)
This copies the style over its current
getDecorationStyle()
public abstract WCssDecorationStyle getDecorationStyle()
This 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.
setDecorationStyle(WCssDecorationStyle style)public abstract void setStyleClass(java.lang.String styleClass)
You 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).
WApplication.getStyleSheet()public abstract java.lang.String getStyleClass()
setStyleClass(String styleClass)
public abstract void setVerticalAlignment(AlignmentFlag alignment,
WLength length)
This 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.
public final void setVerticalAlignment(AlignmentFlag alignment)
Calls
setVerticalAlignment(alignment, WLength.Auto)
public abstract AlignmentFlag getVerticalAlignment()
This applies to CSS-based layout.
setVerticalAlignment(AlignmentFlag alignment, WLength
length)public abstract WLength getVerticalAlignmentLength()
This applies to CSS-based layout.
setVerticalAlignment(AlignmentFlag alignment, WLength
length)public abstract void setToolTip(java.lang.CharSequence text)
The tooltip is displayed when the cursor hovers over the widget.
public abstract WString getToolTip()
public void refresh()
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.
public java.lang.String getJsRef()
You may want to use this in conjunction with JSlot or
WApplication#doJavaScript() in custom JavaScript code.
isRendered()
public abstract void setAttributeValue(java.lang.String name,
java.lang.String value)
Associate 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.
JSlot,
WApplication.doJavaScript(String javascript, boolean afterLoaded)public abstract java.lang.String getAttributeValue(java.lang.String name)
setAttributeValue(String name, String value)
public abstract void setJavaScriptMember(java.lang.String name,
java.lang.String value)
This 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.
public abstract java.lang.String getJavaScriptMember(java.lang.String name)
setJavaScriptMember(String name, String value)
public abstract void callJavaScriptMember(java.lang.String name,
java.lang.String args)
This calls a JavaScript member.
setJavaScriptMember(String name, String value)public static WString tr(java.lang.String key)
WString#tr().
Creates a localized string with the given key.
public abstract void load()
When 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.
public abstract boolean isLoaded()
load()
public void acceptDrops(java.lang.String mimeType,
java.lang.String hoverStyleClass)
You may specify a style class that is applied to the widget when the specified mimetype hovers on top of it.
dropEvent(WDropEvent event),
WInteractWidget.setDraggable(String mimeType, WWidget dragWidget,
boolean isDragWidgetOnly, WObject sourceObject),
stopAcceptDrops(String mimeType)public final void acceptDrops(java.lang.String mimeType)
Calls acceptDrops(mimeType, "")
public void stopAcceptDrops(java.lang.String mimeType)
acceptDrops(String mimeType, String hoverStyleClass)public abstract void setId(java.lang.String id)
Sets 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.
WObject.getId()public abstract WWidget find(java.lang.String name)
WObject.setObjectName(String name)public void htmlText(java.io.Writer out)
Streams the widget as UTF8-encoded (HTML-compatible) XHTML.
This may be useful as a debugging tool for the web-savvy, or in other rare situations. Usually, you will not deal directly with HTML, and calling this method on a widget that is rendered may interfere with the library keeping track of changes to the widget.
public abstract void setSelectable(boolean selectable)
When 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.
public boolean isRendered()
getJsRef()public void hide()
This calls setHidden(true).
public void show()
This calls setHidden(false).
public void enable()
This calls setDisabled(false).
public void disable()
This calls setDisabled(true).
protected void dropEvent(WDropEvent event)
Reimplement this method to handle a drop events for mime types you declared to accept using acceptDrops.
The default implementation simply completes the drag and drop operation as if nothing happened.
acceptDrops(String mimeType, String hoverStyleClass),
WInteractWidget.setDraggable(String mimeType, WWidget dragWidget,
boolean isDragWidgetOnly, WObject sourceObject)protected abstract void enableAjax()
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.
WApplication.enableAjax()protected int boxPadding(Orientation orientation)
This 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.
boxBorder(Orientation orientation)protected int boxBorder(Orientation orientation)
This 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.
boxPadding(Orientation orientation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||