GWT Tk 0.2.3

asquare.gwt.tk.client.ui
Class BasicPanel

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 asquare.gwt.tk.client.ui.CComplexPanel
                      extended by asquare.gwt.tk.client.ui.BasicPanel
All Implemented Interfaces:
ControllerSupport, EventListener, HasWidgets, IndexedPanel

public class BasicPanel
extends CComplexPanel
implements IndexedPanel

A barebones ComplexPanel which allows specification of the root element and display style of added children.

See Also:
Inline formatting context

Field Summary
static String DISPLAY_BLOCK
          Specifies display:block style for added children.
static String DISPLAY_DEFAULT
          Do not specify a display style for added children.
static String DISPLAY_INHERIT
          Specifies display:inherit style for added children.
static String DISPLAY_INLINE
          Specifies display:inline style for added children.
static String ELEMENT_DEFAULT
          The default element (DIV), if no element is specified.
 
Constructor Summary
BasicPanel()
          Constructs a panel based on a DIV element and default children display property.
BasicPanel(Element element)
          Constructs a panel based on the specified element and the default display style.
BasicPanel(Element element, String childrenDisplay)
          Constructs a panel based on the specified element and display style.
BasicPanel(String element)
          Constructs a panel based on the specified element and the default display style.
BasicPanel(String element, String childrenDisplay)
          Constructs a panel based on the specified element and display style.
 
Method Summary
 void add(Widget w)
          Adds a widget to this panel.
 String getChildrenDisplay()
          Gets the display style value which will be applied to added children.
 Widget getWidget(int index)
           
 int getWidgetCount()
          Get the number of widgets in this panel.
 int getWidgetIndex(Widget child)
           
 void insert(Widget w, int beforeIndex)
          Inserts a widget at the specified index.
 boolean remove(int index)
           
 void setChildrenDisplay(String childrenDisplay)
          Sets the display style value which will be applied to added children.
 void setId(String id)
          Sets a unique id for referencing this specific panel.
 
Methods inherited from class asquare.gwt.tk.client.ui.CComplexPanel
addController, createControllers, getController, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeController, setControllers, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, getChildren, insert, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, clear, disown
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT_DEFAULT

public static final String ELEMENT_DEFAULT
The default element (DIV), if no element is specified.

See Also:
Constant Field Values

DISPLAY_DEFAULT

public static final String DISPLAY_DEFAULT
Do not specify a display style for added children.


DISPLAY_BLOCK

public static final String DISPLAY_BLOCK
Specifies display:block style for added children.

See Also:
Constant Field Values

DISPLAY_INLINE

public static final String DISPLAY_INLINE
Specifies display:inline style for added children.

See Also:
Constant Field Values

DISPLAY_INHERIT

public static final String DISPLAY_INHERIT
Specifies display:inherit style for added children.

By default the display style is not inherited.

See Also:
Constant Field Values
Constructor Detail

BasicPanel

public BasicPanel()
Constructs a panel based on a DIV element and default children display property.


BasicPanel

public BasicPanel(Element element)
Constructs a panel based on the specified element and the default display style.

Parameters:
element - a DOM element

BasicPanel

public BasicPanel(String element)
Constructs a panel based on the specified element and the default display style.

Parameters:
element - a html element tag

BasicPanel

public BasicPanel(String element,
                  String childrenDisplay)
Constructs a panel based on the specified element and display style.

Parameters:
element - a html element tag
childrenDisplay - a css display style value to apply to added children

BasicPanel

public BasicPanel(Element element,
                  String childrenDisplay)
Constructs a panel based on the specified element and display style.

Parameters:
element - a DOM element
childrenDisplay - a css display style value to apply to added children
Method Detail

getChildrenDisplay

public String getChildrenDisplay()
Gets the display style value which will be applied to added children.

Returns:
a css display style value or null if none specified

setChildrenDisplay

public void setChildrenDisplay(String childrenDisplay)
Sets the display style value which will be applied to added children.

Parameters:
childrenDisplay - a css display style value to apply to added children

getWidget

public Widget getWidget(int index)
Specified by:
getWidget in interface IndexedPanel

getWidgetIndex

public int getWidgetIndex(Widget child)
Specified by:
getWidgetIndex in interface IndexedPanel

add

public void add(Widget w)
Adds a widget to this panel. If a display style has been specified it will be applied to the child.

Specified by:
add in interface HasWidgets
Overrides:
add in class Panel

insert

public void insert(Widget w,
                   int beforeIndex)
Inserts a widget at the specified index.

Parameters:
w - a widget
beforeIndex - the index before which w will be inserted
Throws:
IndexOutOfBoundsException - if beforeIndex is less than 0 or greater than the current widget count

remove

public boolean remove(int index)
Specified by:
remove in interface IndexedPanel

getWidgetCount

public int getWidgetCount()
Get the number of widgets in this panel.

Specified by:
getWidgetCount in interface IndexedPanel

setId

public void setId(String id)
Sets a unique id for referencing this specific panel.

Parameters:
id - a unique id
See Also:
DomUtil.setId(com.google.gwt.user.client.ui.UIObject, String)

GWT Tk 0.2.3

© 2007 Mat Gessel