org.onebusaway.webapp.gwt.common.widgets
Class CheckBoxListWidget

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.Composite
              extended by org.onebusaway.webapp.gwt.common.widgets.CheckBoxListWidget
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class CheckBoxListWidget
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.HasClickHandlers

This Widget displays a list of items, each with a checkbox next to it in order to allow the user to deselect ("delete") items. Also, items in the list can be given a disabled styling. A given ID is automatically de-duped so it cannot appear more than once. NOTE: The user should define CSS for the following style classes: CheckBoxListWidget CheckBoxListWidgetItem CheckBoxListWidgetItemDisabled (required to support disabled items)


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CheckBoxListWidget(Comparator<String> sorter, int maxColumnSize)
          Construct with specifier sorter (may be null)
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
          So that you can add handlers that do additional action after someone has clicked a checkbox.
 void addItem(String label, String id)
          Add an item to the list
 Collection<String> getAllIds()
          Get all IDs regardless of state.
 List<String> getIds()
          Returns checked, enabled IDs
 List<String> getNonDeletedIds()
          Returns checked (enabled and disabled) IDs
 void setDeleted(String id, boolean deleted)
           
 void setEnabled(String id, boolean enabled)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

CheckBoxListWidget

public CheckBoxListWidget(Comparator<String> sorter,
                          int maxColumnSize)
Construct with specifier sorter (may be null)

Method Detail

addClickHandler

public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
So that you can add handlers that do additional action after someone has clicked a checkbox.

Specified by:
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers

addItem

public void addItem(String label,
                    String id)
Add an item to the list


getIds

public List<String> getIds()
Returns checked, enabled IDs


getNonDeletedIds

public List<String> getNonDeletedIds()
Returns checked (enabled and disabled) IDs


getAllIds

public Collection<String> getAllIds()
Get all IDs regardless of state.


setEnabled

public void setEnabled(String id,
                       boolean enabled)

setDeleted

public void setDeleted(String id,
                       boolean deleted)


Copyright © 2011 OneBusAway. All Rights Reserved.