com.extjs.gxt.ui.client.widget.form
Class DualListField<D extends ModelData>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.form.Field<D>
                      extended by com.extjs.gxt.ui.client.widget.form.MultiField<Field<?>>
                          extended by com.extjs.gxt.ui.client.widget.form.DualListField<D>
Type Parameters:
D - the model type
All Implemented Interfaces:
Observable, 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 DualListField<D extends ModelData>
extends MultiField<Field<?>>

Combines two list fields and allows selections to be moved between fields either using buttons or by dragging and dropping selections.


Nested Class Summary
 class DualListField.DualListFieldMessages
          The dual list field messages.
static class DualListField.Mode
          The DND mode enumeration.
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.form.Field
Field.FieldImages, Field.FieldMessages
 
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
protected  IconButton allLeft
           
protected  IconButton allRight
           
protected  AdapterField buttonAdapter
           
protected  VerticalPanel buttonBar
           
protected  IconButton down
           
protected  ListField<D> fromField
           
protected  IconButton left
           
protected  DualListField.Mode mode
           
protected  IconButton right
           
protected  ListViewDragSource sourceFromField
           
protected  ListViewDragSource sourceToField
           
protected  ListViewDropTarget targetFromField
           
protected  ListViewDropTarget targetToField
           
protected  ListField<D> toField
           
protected  IconButton up
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.form.MultiField
fields, lc, orientation, spacing, validator
 
Fields inherited from class com.extjs.gxt.ui.client.widget.form.Field
autoValidate, emptyText, errorIcon, fieldStyle, focusStyle, focusValue, forceInvalidText, hasFocus, images, invalidStyle, messages, name, originalValue, preventMark, propertyEditor, readOnly, readOnlyFieldStyle, validationDelay, validationTask, value
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DualListField()
           
 
Method Summary
 java.lang.String getDNDGroup()
          Returns the DND group name.
 ListViewDragSource getDragSourceFromField()
          Returns the from field's drag source instance.
 ListViewDragSource getDragSourceToField()
          Returns the to field's drag source instance.
 ListViewDropTarget getDropTargetFromField()
          Returns the from field's drop target instance.
 ListViewDropTarget getDropTargetToField()
          Returns the to field's drop target instance.
 ListField<D> getFromField()
          Returns the from list field.
 ListField<D> getFromList()
          Returns the from list field.
 DualListField.DualListFieldMessages getMessages()
          Returns the field's messages.
 DualListField.Mode getMode()
          Returns the list field's mode.
 ListField<D> getToField()
          Return the to list field.
 ListField<D> getToList()
          Returns the to list field.
protected  void initButtons()
           
 boolean isEnableDND()
          Returns true if drag and drop is enabled.
protected  void onButtonAllLeft(IconButtonEvent be)
           
protected  void onButtonAllRight(IconButtonEvent be)
           
protected  void onButtonDown(IconButtonEvent be)
           
protected  void onButtonLeft(IconButtonEvent be)
           
protected  void onButtonRight(IconButtonEvent be)
           
protected  void onButtonUp(IconButtonEvent be)
           
protected  void onFocus(ComponentEvent ce)
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void onResize(int width, int height)
          Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.
 void setDNDGroup(java.lang.String group)
          Sets the drag and drop group name.
 void setEnableDND(boolean enableDND)
          True to allow selections to be dragged and dropped between lists (defaults to true).
 void setMode(DualListField.Mode mode)
          Specifies if selections are either inserted or appended when moving between lists.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.MultiField
add, clear, doAttachChildren, doDetachChildren, get, getAll, getInputEl, getOrientation, getSpacing, getValidator, isResizeFields, isValid, notifyHide, notifyShow, onBrowserEvent, onComponentEvent, onDisable, onEnable, reset, setOrientation, setReadOnly, setResizeFields, setSpacing, setValidator, validateValue
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.Field
addInputStyleName, addKeyListener, afterRender, alignErrorIcon, clearInvalid, createComponentEvent, findLabelElement, fireChangeEvent, fireKey, focus, forceInvalid, getAutoValidate, getEmptyText, getErrorMessage, getFieldLabel, getImages, getLabelSeparator, getLabelStyle, getMessageTarget, getName, getOriginalValue, getPropertyEditor, getRawValue, getStyleEl, getValidateOnBlur, getValidationDelay, getValue, initValue, isDirty, isFireChangeEventOnSetValue, isHideLabel, isInEditor, isReadOnly, isValid, markInvalid, onBlur, onClick, onDetach, onHide, onKeyDown, onKeyPress, onKeyUp, onShow, removeInputStyleName, removeKeyListener, setAutoValidate, setEmptyText, setFieldLabel, setFireChangeEventOnSetValue, setHideLabel, setImages, setInEditor, setInputStyleAttribute, setLabelSeparator, setLabelStyle, setMessages, setMessageTarget, setName, setOriginalValue, setPropertyEditor, setRawValue, setTabIndex, setValidateOnBlur, setValidationDelay, setValue, updateOriginalValue, validate, validate
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, onAttach, onDetachHelper, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buttonAdapter

protected AdapterField buttonAdapter

buttonBar

protected VerticalPanel buttonBar

fromField

protected ListField<D extends ModelData> fromField

mode

protected DualListField.Mode mode

toField

protected ListField<D extends ModelData> toField

sourceFromField

protected ListViewDragSource sourceFromField

sourceToField

protected ListViewDragSource sourceToField

targetFromField

protected ListViewDropTarget targetFromField

targetToField

protected ListViewDropTarget targetToField

left

protected IconButton left

right

protected IconButton right

allLeft

protected IconButton allLeft

allRight

protected IconButton allRight

up

protected IconButton up

down

protected IconButton down
Constructor Detail

DualListField

public DualListField()
Method Detail

getDNDGroup

public java.lang.String getDNDGroup()
Returns the DND group name.

Returns:
the group name

getDragSourceFromField

public ListViewDragSource getDragSourceFromField()
Returns the from field's drag source instance.

Returns:
the drag source

getDragSourceToField

public ListViewDragSource getDragSourceToField()
Returns the to field's drag source instance.

Returns:
the drag source

getDropTargetFromField

public ListViewDropTarget getDropTargetFromField()
Returns the from field's drop target instance.

Returns:
the drag source

getDropTargetToField

public ListViewDropTarget getDropTargetToField()
Returns the to field's drop target instance.

Returns:
the drag source

getFromField

public ListField<D> getFromField()
Returns the from list field.

Returns:
the from list field

getFromList

public ListField<D> getFromList()
Returns the from list field.

Returns:
the field

getMessages

public DualListField.DualListFieldMessages getMessages()
Description copied from class: Field
Returns the field's messages.

Overrides:
getMessages in class Field<Field<?>>
Returns:
the messages

getMode

public DualListField.Mode getMode()
Returns the list field's mode.

Returns:
the mode

getToField

public ListField<D> getToField()
Return the to list field.

Returns:
the to list field

getToList

public ListField<D> getToList()
Returns the to list field.

Returns:
the field

initButtons

protected void initButtons()

isEnableDND

public boolean isEnableDND()
Returns true if drag and drop is enabled.

Returns:
true if drag and drop is enabled

onButtonAllLeft

protected void onButtonAllLeft(IconButtonEvent be)

onButtonAllRight

protected void onButtonAllRight(IconButtonEvent be)

onButtonDown

protected void onButtonDown(IconButtonEvent be)

onButtonLeft

protected void onButtonLeft(IconButtonEvent be)

onButtonRight

protected void onButtonRight(IconButtonEvent be)

onButtonUp

protected void onButtonUp(IconButtonEvent be)

onFocus

protected void onFocus(ComponentEvent ce)
Overrides:
onFocus in class Field<Field<?>>

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class MultiField<Field<?>>
Parameters:
target - the target element
index - the insert location

onResize

protected void onResize(int width,
                        int height)
Description copied from class: BoxComponent
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.

Overrides:
onResize in class MultiField<Field<?>>
Parameters:
width - the width
height - the height

setDNDGroup

public void setDNDGroup(java.lang.String group)
Sets the drag and drop group name. A group name will be generated if none is specified.

Parameters:
group - the group name

setEnableDND

public void setEnableDND(boolean enableDND)
True to allow selections to be dragged and dropped between lists (defaults to true).

Parameters:
enableDND - true to enable drag and drop

setMode

public void setMode(DualListField.Mode mode)
Specifies if selections are either inserted or appended when moving between lists.

Parameters:
mode - the mode