GWT Tk 0.2.3

asquare.gwt.tk.client.ui
Class CComplexPanel

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
All Implemented Interfaces:
ControllerSupport, EventListener, HasWidgets
Direct Known Subclasses:
BasicPanel, DropDownPanel, GlassPanel

public class CComplexPanel
extends ComplexPanel
implements ControllerSupport

A panel base class which allows multiple children and supports pluggable controllers.

See Also:
Controller

Constructor Summary
CComplexPanel(Element element)
          Creates a CComplexPanel based on the specified element.
CComplexPanel(Element element, List controllers)
          Creates a CComplexPanel based on the specified element.
 
Method Summary
 Widget addController(Controller controller)
          Adds a controller to process events on this widget.
protected  List createControllers()
          A factory method which gives subclasses the opportunity to override default controller creation.
 Controller getController(Class id)
          Gets a controller with the specified id.
protected  void onAttach()
           
 void onBrowserEvent(Event event)
           
protected  void onDetach()
           
protected  void onLoad()
           
protected  void onUnload()
          This method is called just before the widget is detached from the browser's document.
 Widget removeController(Controller controller)
          Removes a controller
 void setControllers(List controllers)
          Sets the controllers which will process events on this widget.
 void sinkEvents(int eventBits)
           
 void unsinkEvents(int eventBits)
           
 
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
add, 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
 

Constructor Detail

CComplexPanel

public CComplexPanel(Element element)
Creates a CComplexPanel based on the specified element.

Throws:
IllegalArgumentException - if element is null

CComplexPanel

public CComplexPanel(Element element,
                     List controllers)
Creates a CComplexPanel based on the specified element. Pass a value for controllers if you wish to avoid controller creation via createControllers(). Otherwise pass null.

Parameters:
controllers - a list of 0 or more controllers, or null
Throws:
IllegalArgumentException - if element is null
Method Detail

createControllers

protected List createControllers()
A factory method which gives subclasses the opportunity to override default controller creation.

Returns:
a List with 0 or more controllers, or null

getController

public Controller getController(Class id)
Description copied from interface: ControllerSupport
Gets a controller with the specified id. The id is often an interface or base class, as controllers can have multiple implementations. Used to modify the behavior of existing widgets.

Specified by:
getController in interface ControllerSupport
Parameters:
id - a Class identifying the type of controller to get
Returns:
the first controller matching the id, or null

addController

public Widget addController(Controller controller)
Description copied from interface: ControllerSupport
Adds a controller to process events on this widget. Multiple controllers may be added.

Specified by:
addController in interface ControllerSupport
Parameters:
controller - a controller to add
Returns:
the widget this call was made on (for convenience)

removeController

public Widget removeController(Controller controller)
Description copied from interface: ControllerSupport
Removes a controller

Specified by:
removeController in interface ControllerSupport
Parameters:
controller - a controller to remove
Returns:
the widget this call was made on (for convenience)

setControllers

public void setControllers(List controllers)
Description copied from interface: ControllerSupport
Sets the controllers which will process events on this widget. Clears out the current controllers, if any. When the widget is added to the DOM, received events will be delegated to each controller which declares the event's type via getEventBits().

Specified by:
setControllers in interface ControllerSupport
Parameters:
controllers - a list of 0 or more controllers, or null

sinkEvents

public void sinkEvents(int eventBits)
Overrides:
sinkEvents in class UIObject

unsinkEvents

public void unsinkEvents(int eventBits)
Overrides:
unsinkEvents in class UIObject

onAttach

protected void onAttach()
Overrides:
onAttach in class Panel

onDetach

protected void onDetach()
Overrides:
onDetach in class Panel

onLoad

protected void onLoad()
Overrides:
onLoad in class Widget

onUnload

protected void onUnload()
This method is called just before the widget is detached from the browser's document.


onBrowserEvent

public void onBrowserEvent(Event event)
Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Widget

GWT Tk 0.2.3

© 2007 Mat Gessel