GWT Tk 0.2.3

asquare.gwt.tk.client.ui
Class DropDownPanel

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.DropDownPanel
All Implemented Interfaces:
ControllerSupport, EventListener, HasWidgets

public class DropDownPanel
extends CComplexPanel

A panel that consists of a hideable content DIV and an optional header DIV. By default, the user can click the header to show/hide the content. The panel is closed initially. It can be opened & closed with setOpen(boolean).

Usage Notes

CSS Style Rules


Nested Class Summary
static class DropDownPanel.OpenerController
           
 
Field Summary
static String PROPERTY_INTERACTIVE
           
static String PROPERTY_OPEN
           
 
Constructor Summary
DropDownPanel()
          Constructs an empty panel.
DropDownPanel(Widget w, String text, boolean asHTML)
          Constructs a new panel, adding a widget to the content area and optionally setting the header.
 
Method Summary
 void add(Widget w)
          Adds a widget to the panel.
 void addDropDownListener(DropDownListener listener)
          Add a listener to be notified when the content DIV is shown/hidden.
protected  List createHeaderControllers()
           
 boolean hasHeader()
          Has the header been specified?
 boolean isInteractive()
          Will clicking in the header will toggle the content DIV?
 boolean isOpen()
          Is the content DIV currently visible?
 boolean remove(Widget w)
           
 void removeDropDownListener(DropDownListener listener)
           
 void setHeaderText(String text, boolean asHTML)
          Sets the text in the header DIV.
 void setInteractive(boolean interactive)
          Sets whether clicking in the header will toggle the content DIV.
 void setOpen(boolean open)
          Sets the visibility of the content DIV.
 void toggleOpen()
          Toggles the visibility of the content DIV.
 
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
 
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

PROPERTY_OPEN

public static final String PROPERTY_OPEN
See Also:
Constant Field Values

PROPERTY_INTERACTIVE

public static final String PROPERTY_INTERACTIVE
See Also:
Constant Field Values
Constructor Detail

DropDownPanel

public DropDownPanel()
Constructs an empty panel. You can customize it later with add(Widget) and setHeaderText(String, boolean).


DropDownPanel

public DropDownPanel(Widget w,
                     String text,
                     boolean asHTML)
Constructs a new panel, adding a widget to the content area and optionally setting the header.

Parameters:
w - the widget to be added, or null
text - the header text associated with this widget, or null
asHTML - true to treat the specified text as HTML. Ignored if text is null.
Method Detail

createHeaderControllers

protected List createHeaderControllers()

addDropDownListener

public void addDropDownListener(DropDownListener listener)
Add a listener to be notified when the content DIV is shown/hidden.


removeDropDownListener

public void removeDropDownListener(DropDownListener listener)

add

public void add(Widget w)
Adds a widget to the panel. Only one widget may be added.

Specified by:
add in interface HasWidgets
Overrides:
add in class Panel
Parameters:
w - the widget to be added

hasHeader

public boolean hasHeader()
Has the header been specified?

Returns:
false if no header

setHeaderText

public void setHeaderText(String text,
                          boolean asHTML)
Sets the text in the header DIV. Creates the header if necessary. Removes the header if null;

Parameters:
text - the text to be associated with it, or null to remove the header
asHTML - true to treat the specified text as HTML

remove

public boolean remove(Widget w)
Specified by:
remove in interface HasWidgets
Overrides:
remove in class ComplexPanel

setOpen

public void setOpen(boolean open)
Sets the visibility of the content DIV.

Parameters:
open - true to show the content DIV

isOpen

public boolean isOpen()
Is the content DIV currently visible?


toggleOpen

public void toggleOpen()
Toggles the visibility of the content DIV.


isInteractive

public boolean isInteractive()
Will clicking in the header will toggle the content DIV?

Returns:
true if header click processing is enabled

setInteractive

public void setInteractive(boolean interactive)
Sets whether clicking in the header will toggle the content DIV.

Parameters:
interactive - true to enable header click processing

GWT Tk 0.2.3

© 2007 Mat Gessel