Class DisclosurePanel

All Implemented Interfaces:
HasAttachHandlers, HasCloseHandlers<DisclosurePanel>, HasOpenHandlers<DisclosurePanel>, HasHandlers, EventListener, FiresDisclosureEvents, HasAnimation, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IsRenderable, IsWidget, Iterable<Widget>

A widget that consists of a header and a content panel that discloses the content when a user clicks on the header.

CSS Style Rules

.gwt-DisclosurePanel
the panel's primary style
.gwt-DisclosurePanel-open
dependent style set when panel is open
.gwt-DisclosurePanel-closed
dependent style set when panel is closed

The header and content sections can be easily selected using css with a child selector:
.gwt-DisclosurePanel-open .header { ... }

Use in UiBinder Templates

DisclosurePanel elements in UiBinder templates can have one widget child and one of two types of header elements. A <g:header> element can hold text (not html), or a <g:customHeader> element can hold a widget. (Note that the tags of the header elements are not capitalized. This is meant to signal that the header is not a runtime object, and so cannot have a ui:field attribute.)

For example:

 <g:DisclosurePanel>
   <g:header>Text header</g:header>
   <g:Label>Widget body</g:Label>
 </g:DisclosurePanel>

 <g:DisclosurePanel>
   <g:customHeader>
     <g:Label>Widget header</g:Label>
   </g:customHeader>
   <g:Label>Widget body</g:Label>
 </g:DisclosurePanel>
 
  • Constructor Details

    • DisclosurePanel

      public DisclosurePanel()
      Creates an empty DisclosurePanel that is initially closed.
    • DisclosurePanel

      @Deprecated public DisclosurePanel(DisclosurePanelImages images, String headerText, boolean isOpen)
      Creates a DisclosurePanel with the specified header text, an initial open/close state and a bundle of images to be used in the default header widget.
      Parameters:
      images - a bundle that provides disclosure panel specific images
      headerText - the text to be displayed in the header
      isOpen - the initial open/close state of the content panel
    • DisclosurePanel

      public DisclosurePanel(ImageResource openImage, ImageResource closedImage, String headerText)
      Creates a DisclosurePanel with the specified header text, an initial open/close state and a bundle of images to be used in the default header widget.
      Parameters:
      openImage - the open state image resource
      closedImage - the closed state image resource
      headerText - the text to be displayed in the header
    • DisclosurePanel

      public DisclosurePanel(String headerText)
      Creates a DisclosurePanel that will be initially closed using the specified text in the header.
      Parameters:
      headerText - the text to be displayed in the header
    • DisclosurePanel

      @Deprecated public DisclosurePanel(String headerText, boolean isOpen)
      Creates a DisclosurePanel with the specified header text and an initial open/close state.
      Parameters:
      headerText - the text to be displayed in the header
      isOpen - the initial open/close state of the content panel
    • DisclosurePanel

      @Deprecated public DisclosurePanel(Widget header)
      Creates a DisclosurePanel that will be initially closed using a widget as the header.
      Parameters:
      header - the widget to be used as a header
    • DisclosurePanel

      @Deprecated public DisclosurePanel(Widget header, boolean isOpen)
      Creates a DisclosurePanel using a widget as the header and an initial open/close state.
      Parameters:
      header - the widget to be used as a header
      isOpen - the initial open/close state of the content panel
  • Method Details