public abstract class

LazyPanel

extends SimplePanel
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.Panel
         ↳ com.google.gwt.user.client.ui.SimplePanel
           ↳ com.google.gwt.user.client.ui.LazyPanel

Class Overview

Convenience class to help lazy loading. The bulk of a LazyPanel is not instantiated until setVisible(boolean)(true) or ensureWidget() is called.

Example

{@example com.google.gwt.examples.LazyPanelExample}

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
LazyPanel()
Public Methods
void ensureWidget()
Ensures that the widget has been created by calling createWidget() if getWidget() returns null.
void setVisible(boolean visible)
Sets whether this object is visible.
Protected Methods
abstract Widget createWidget()
Create the widget contained within the LazyPanel.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.SimplePanel
From class com.google.gwt.user.client.ui.Panel
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.AcceptsOneWidget
From interface com.google.gwt.user.client.ui.HasOneWidget
From interface com.google.gwt.user.client.ui.HasWidgets
From interface com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
From interface com.google.gwt.user.client.ui.IsWidget
From interface java.lang.Iterable

Public Constructors

public LazyPanel ()

Public Methods

public void ensureWidget ()

Ensures that the widget has been created by calling createWidget() if getWidget() returns null. Typically it is not necessary to call this directly, as it is called as a side effect of a setVisible(true) call.

public void setVisible (boolean visible)

Sets whether this object is visible.

Parameters
visible true to show the object, false to hide it

Protected Methods

protected abstract Widget createWidget ()

Create the widget contained within the LazyPanel.

Returns
  • the lazy widget