com.github.gwtbootstrap.client.ui.base
Class HtmlWidget

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.google.gwt.user.client.ui.HTMLPanel
                      extended by com.github.gwtbootstrap.client.ui.base.HtmlWidget
All Implemented Interfaces:
HasStyle, IsResponsive, HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>
Direct Known Subclasses:
AlertBase, ControlGroup, Controls, Footer, FormLabel, Legend, Paragraph, Well

public class HtmlWidget
extends HTMLPanel
implements HasStyle, IsResponsive

Widget with support for HTML.

When extendind this class, the child class should always expose a constructor with a String argument. This argument is HTML text. The constructor is used by the HTMLPanelParser to parse UiBinder XML.

Child Class Constructor Example

 public ChildPanel extends HtmlWidget {
     public ChildPanel(String html) {
         super("label", html); //"label" is the HTML tag used for the child class.
     }
 }
 

Since:
2.0.4.0
Author:
ohashi keisuke

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected HtmlWidget(String tag)
          Creates an empty widget.
  HtmlWidget(String tag, String html)
          Creates an HTML panel whose root element has the given tag, and with the specified HTML contents.
 
Method Summary
 void addStyle(Style style)
          Adds the provided style to the widget.
 void removeStyle(Style style)
          Removes the provided style from the widget.
 void setHideOn(Device device)
          Sets the kind of device, this widget is hidden on.
 void setShowOn(Device device)
          Sets the kind of device, this widget is shown on.
 void setStyle(Style style)
          Replaces the widet's style with the provided one.
 
Methods inherited from class com.google.gwt.user.client.ui.HTMLPanel
add, add, add, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, createUniqueId, getElementById, wrap
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlWidget

protected HtmlWidget(String tag)
Creates an empty widget.

Parameters:
tag - the tag of the root element

HtmlWidget

public HtmlWidget(String tag,
                  String html)
Creates an HTML panel whose root element has the given tag, and with the specified HTML contents. Any element within this HTML that has a specified id can contain a child widget.

Parameters:
tag - the tag of the root element
html - the panel's HTML
Method Detail

setShowOn

public void setShowOn(Device device)
Sets the kind of device, this widget is shown on.

The widget is not shown on any other device.

Only works if responsive design is turned on!

Specified by:
setShowOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setHideOn(Device)

setHideOn

public void setHideOn(Device device)
Sets the kind of device, this widget is hidden on.

The widget is not hidden on any other device.

Only works if responsive design is turned on!

Specified by:
setHideOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setShowOn(Device)

setStyle

public void setStyle(Style style)
Replaces the widet's style with the provided one.

Specified by:
setStyle in interface HasStyle
Parameters:
style - the style to be applied to the Widget.

addStyle

public void addStyle(Style style)
Adds the provided style to the widget.

Specified by:
addStyle in interface HasStyle
Parameters:
style - the style to be added to the Widget.

removeStyle

public void removeStyle(Style style)
Removes the provided style from the widget.

Specified by:
removeStyle in interface HasStyle
Parameters:
style - the style to be removed from the Widget.


Copyright © 2012 gwtbootstrap. All Rights Reserved.