org.xwiki.gwt.wysiwyg.client.plugin.macro.input
Class ChoiceInput

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.xwiki.gwt.wysiwyg.client.plugin.macro.input.AbstractInput
                  extended by org.xwiki.gwt.wysiwyg.client.plugin.macro.input.ChoiceInput
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, HasFocus, HasValue

public class ChoiceInput
extends AbstractInput

A concrete input control that allows the user to choose one of the available options.

Version:
$Id: ChoiceInput.java 26786 2010-02-07 16:46:17Z mflorea $

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
ChoiceInput(com.google.gwt.user.client.ui.ListBox list)
          Creates a new choice input control that wraps the given ListBox widget.
 
Method Summary
 java.lang.String getValue()
          
protected  int indexOf(java.lang.String value)
          Searches for the given value in the list of options.
 void setFocus(boolean focused)
          Gives or takes the focus to/from this object.
 void setValue(java.lang.String value)
          Sets this object's value.
 
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

ChoiceInput

public ChoiceInput(com.google.gwt.user.client.ui.ListBox list)
Creates a new choice input control that wraps the given ListBox widget.

Parameters:
list - the list box widget to be wrapped
Method Detail

setFocus

public void setFocus(boolean focused)
Gives or takes the focus to/from this object. Only one object can have focus at a time.

Parameters:
focused - true to give the focus to this object, false to take it
See Also:
HasFocus.setFocus(boolean)

getValue

public java.lang.String getValue()

Returns:
this object's value
See Also:
HasValue.getValue()

setValue

public void setValue(java.lang.String value)
Sets this object's value.

Parameters:
value - a String representing a new value for this object
See Also:
HasValue.setValue(String)

indexOf

protected int indexOf(java.lang.String value)
Searches for the given value in the list of options.

Parameters:
value - the value to search for
Returns:
the index of the value in the list, if found, -1 otherwise


Copyright © 2004-2011 XWiki. All Rights Reserved.