eu.webtoolkit.jwt
Class WGroupBox

java.lang.Object
  extended by eu.webtoolkit.jwt.WObject
      extended by eu.webtoolkit.jwt.WWidget
          extended by eu.webtoolkit.jwt.WWebWidget
              extended by eu.webtoolkit.jwt.WInteractWidget
                  extended by eu.webtoolkit.jwt.WContainerWidget
                      extended by eu.webtoolkit.jwt.WGroupBox

public class WGroupBox
extends WContainerWidget

A widget which group widgets into a frame with a title.

This is typically used in a form to group certain form elements together.

Usage example:

 enum Vote { Republican , Democrate , NoVote };
  
  // use a group box as widget container for 3 radio buttons, with a title
  WGroupBox container = new WGroupBox("USA elections vote");
  		 
  // use a button group to logically group the 3 options
  WButtonGroup group = new WButtonGroup(this);
 		 
  WRadioButton button;
  button = new WRadioButton("I voted Republican", container);
  new WBreak(container);
  group.addButton(button, Vote.Republican.ordinal());
 
  button = new WRadioButton("I voted Democrat", container);
  new WBreak(container);
  group.addButton(button, Vote.Democrate.ordinal());
 
  button = new WRadioButton("I didn't vote", container);
  new WBreak(container);
  group.addButton(button, Vote.NoVote.ordinal());
 		 
  group.setCheckedButton(group.button(Vote.NoVote.ordinal()));
 
 

Like WContainerWidget, WGroupBox is by default displayed as a block.

WGroupBox example

WGroupBox example

CSS

The widget corresponds to the HTML <fieldset> tag, and the title in a nested <legend> tag. This widget does not provide styling, and can be styled using inline or external CSS as appropriate.


Nested Class Summary
 
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WContainerWidget
WContainerWidget.Overflow
 
Constructor Summary
WGroupBox()
          Creates a groupbox with empty title.
WGroupBox(java.lang.CharSequence title)
          Creates a groupbox with given title message.
WGroupBox(java.lang.CharSequence title, WContainerWidget parent)
          Creates a groupbox with given title message.
WGroupBox(WContainerWidget parent)
          Creates a groupbox with empty title.
 
Method Summary
 WString getTitle()
          Returns the title.
protected  void propagateSetEnabled(boolean enabled)
          Propagates that a widget was enabled or disabled through children.
 void refresh()
          Refresh the widget.
 void setTitle(java.lang.CharSequence title)
          Returns the title.
 
Methods inherited from class eu.webtoolkit.jwt.WContainerWidget
addWidget, clear, getContentAlignment, getCount, getIndexOf, getLayout, getPadding, getWidget, insertBefore, insertWidget, isList, isOrderedList, isUnorderedList, remove, removeWidget, scrolled, setContentAlignment, setContentAlignment, setLayout, setLayout, setLayout, setList, setList, setOverflow, setOverflow, setOverflow, setPadding, setPadding, setPadding
 
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted
 
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, callJavaScriptMember, childrenChanged, doJavaScript, domCanBeSaved, enableAjax, escapeText, escapeText, escapeText, escapeText, find, getAttributeValue, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isVisible, jsStringLiteral, jsStringLiteral, removeScript, removeStyleClass, render, resize, setAttributeValue, setClearSides, setDecorationStyle, setDisabled, setFloatSide, setHidden, setHiddenKeepsGeometry, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPopup, setPositionScheme, setSelectable, setStyleClass, setTabIndex, setToolTip, setVerticalAlignment, updateSignalConnection
 
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, 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
addChild, getObjectName, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WGroupBox

public WGroupBox(WContainerWidget parent)
Creates a groupbox with empty title.


WGroupBox

public WGroupBox()
Creates a groupbox with empty title.

Calls this((WContainerWidget)null)


WGroupBox

public WGroupBox(java.lang.CharSequence title,
                 WContainerWidget parent)
Creates a groupbox with given title message.


WGroupBox

public WGroupBox(java.lang.CharSequence title)
Creates a groupbox with given title message.

Calls this(title, (WContainerWidget)null)

Method Detail

getTitle

public WString getTitle()
Returns the title.


setTitle

public void setTitle(java.lang.CharSequence title)
Returns the title.


refresh

public void refresh()
Description copied from class: WWidget
Refresh the widget.

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.

Overrides:
refresh in class WWebWidget

propagateSetEnabled

protected void propagateSetEnabled(boolean enabled)
Description copied from class: WWidget
Propagates that a widget was enabled or disabled through children.

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.

Overrides:
propagateSetEnabled in class WInteractWidget