FileDocCategorySizeDatePackage
SchoolCalendarWidget.javaAPI DocExample4743Mon Aug 27 20:11:36 BST 2007com.google.gwt.sample.dynatable.client

SchoolCalendarWidget

public class SchoolCalendarWidget extends com.google.gwt.user.client.ui.Composite
A Composite widget that abstracts a DynaTableWidget and a data provider tied to the <@link SchoolCalendarService> RPC endpoint.

Fields Summary
private final CalendarProvider
calProvider
private final boolean[]
daysFilter
private final DynaTableWidget
dynaTable
private com.google.gwt.user.client.Command
pendingRefresh
Constructors Summary
public SchoolCalendarWidget(int visibleRows)


     
    String[] columns = new String[] {"Name", "Description", "Schedule"};
    String[] styles = new String[] {"name", "desc", "sched"};
    dynaTable = new DynaTableWidget(calProvider, columns, styles, visibleRows);
    initWidget(dynaTable);
  
Methods Summary
protected booleangetDayIncluded(int day)

    return daysFilter[day];
  
protected voidonLoad()

    dynaTable.refresh();
  
protected voidsetDayIncluded(int day, boolean included)

    if (daysFilter[day] == included) {
      // No change.
      //
      return;
    }

    daysFilter[day] = included;
    if (pendingRefresh == null) {
      pendingRefresh = new Command() {
        public void execute() {
          pendingRefresh = null;
          dynaTable.refresh();
        }
      };
      DeferredCommand.addCommand(pendingRefresh);
    }