|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.cafesip.gwtcomp.client.ui.EditableList
public class EditableList
A panel for an editable list that allows the user to add elements to a list and remove elements from the list. This composite consists of the following widgets:
CSS Style Rules:
Screen-Shots:
In the above screen-shot, the top row contains the text box for the user to enter a new element to be added to the list and the Add button that when clicked adds the text box contents to the list. The second row contains the list of elements itself and the Remove button. The user may select one or more elements from the list and click the Remove button which causes the selected element(s) to be removed from the list.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
EditableList()
An empty constructor for this class. |
|
EditableList(TextBox newElement,
Button addButton,
ListBox list,
Button removeButton)
A constructor for this class. |
|
| Method Summary | |
|---|---|
void |
allowDuplicates(boolean allowDuplicates)
Sets whether or not validation when done by this widget should allow duplicate entries in the list. |
void |
allowEmptyList(boolean allowEmptyList)
Sets whether or not validation when done by this widget should allow the user to remove all of the elements from the list. |
boolean |
duplicatesAllowed()
Returns whether or not validation when done by this widget would allow duplicate entries in the list. |
boolean |
emptyListAllowed()
Returns whether or not validation when done by this widget would allow the user to remove all of the elements from the list. |
String |
getErrorMessagePrefix()
Returns the error message prefix string that is output along with validation error(s). |
ArrayList<String> |
getList()
Returns the contents of the ListBox. |
MessageBar |
getMessageBar()
Returns the MessageBar as set by a previous call to setMessageBar() or null if setMessageBar() has not been called. |
TextBox |
getNewElement()
Returns the TextBox widget where the user types in a new element to add to the list. |
boolean |
listContains(String element)
Call this method to find out if the list contains the given element. |
void |
onClick(ClickEvent event)
|
void |
onKeyDown(Widget sender,
char keyCode,
int modifiers)
|
void |
onKeyPress(Widget sender,
char keyCode,
int modifiers)
|
void |
onKeyUp(KeyUpEvent event)
|
void |
onKeyUp(Widget sender,
char keyCode,
int modifiers)
|
void |
setErrorMessagePrefix(String errorMessagePrefix)
Sets the error message prefix string to be output along with validation error(s) when this widget performs Add/Remove button validation. |
void |
setList(ArrayList<String> elements)
Set the contents of the ListBox. |
void |
setMessageBar(MessageBar messageBar)
Sets the MessageBar for use by this widget's validation. |
| 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 |
|---|
addDomHandler, addHandler, 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, 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 |
| Constructor Detail |
|---|
public EditableList()
public EditableList(TextBox newElement,
Button addButton,
ListBox list,
Button removeButton)
newElement - the TextBox for entering a new element to be added to the listaddButton - the Button that when clicked adds the TextBox contents to the
listlist - the ListBox containing the current list of elementsremoveButton - the Button that when clicked removes the selected list
element(s) from the list| Method Detail |
|---|
public void onKeyDown(Widget sender,
char keyCode,
int modifiers)
public void onKeyPress(Widget sender,
char keyCode,
int modifiers)
public void onKeyUp(Widget sender,
char keyCode,
int modifiers)
public boolean listContains(String element)
element - the element of interest
public void setList(ArrayList<String> elements)
elements - ArrayList of String to set the list contents to.public ArrayList<String> getList()
public TextBox getNewElement()
public MessageBar getMessageBar()
public void setMessageBar(MessageBar messageBar)
messageBar - The messageBar to set.public String getErrorMessagePrefix()
public void setErrorMessagePrefix(String errorMessagePrefix)
errorMessagePrefix - The errorMessagePrefix to set.public boolean duplicatesAllowed()
public void allowDuplicates(boolean allowDuplicates)
allowDuplicates - true if duplicate elements in the list should be allowed,
false otherwise.public boolean emptyListAllowed()
public void allowEmptyList(boolean allowEmptyList)
allowEmptyList - true if the user should be allowed to remove all of the
elements from the list, false otherwise.public void onClick(ClickEvent event)
onClick in interface ClickHandlerpublic void onKeyUp(KeyUpEvent event)
onKeyUp in interface KeyUpHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||