to.etc.domui.component.tbl
Class ListShuttle

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.Div
                  extended by to.etc.domui.component.tbl.ListShuttle
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, ITableModelListener<java.lang.Object>, INodeErrorDelegate, IDraggable, IDropTargetable

public class ListShuttle
extends Div
implements ITableModelListener<java.lang.Object>

The ListShuttle component contains a SOURCE list and a TARGET list, and allows the user to "shuttle" elements from the SOURCE list to the TARGET list, and v.v. In addition the target list can be ordered, if necessary.

Author:
Frits Jalvingh Created on Nov 5, 2008

Constructor Summary
ListShuttle()
           
 
Method Summary
 void createContent()
           
 IShuttleModel<?,?> getModel()
          Get the model for this thingy.
 INodeContentRenderer<java.lang.Object> getSourceRenderer()
           
 java.lang.Class<? extends INodeContentRenderer<?>> getSourceRendererClass()
           
 INodeContentRenderer<java.lang.Object> getTargetRenderer()
           
 java.lang.Class<? extends INodeContentRenderer<?>> getTargetRendererClass()
           
 boolean isOrderable()
          Is this set to be orderable?
 void modelChanged(ITableModel<java.lang.Object> model)
          The source model has changed.
 void rowAdded(ITableModel<java.lang.Object> model, int index, java.lang.Object value)
          A row was moved (back) to the source model: change it.
 void rowDeleted(ITableModel<java.lang.Object> model, int index, java.lang.Object value)
          Called after a row has been deleted.
 void rowModified(ITableModel<java.lang.Object> model, int index, java.lang.Object value)
          Called after a row has been changed.
 void setModel(IShuttleModel<?,?> model)
          Set the model to use for the shuttle.
 void setOrderable(boolean orderable)
          When set (and the model supports it) this shows ordering buttons at the right of the target shuttle, allowing the content to be moved up- and downwards.
 void setSourceRenderer(INodeContentRenderer<java.lang.Object> sourceRenderer)
           
 void setSourceRendererClass(java.lang.Class<? extends INodeContentRenderer<?>> sourceRendererClass)
           
 void setTargetRenderer(INodeContentRenderer<java.lang.Object> targetRenderer)
           
 void setTargetRendererClass(java.lang.Class<? extends INodeContentRenderer<?>> targetRendererClass)
           
 
Methods inherited from class to.etc.domui.dom.html.Div
afterCreateContent, componentHandleWebAction, fadeIn, fadeOut, getCustomUpdatesCallJS, getDragHandler, getDropBody, getDropHandler, getDropMode, getReturnPressed, setDragHandler, setDropBody, setDropHandler, setReturnPressed, slideDown, slideUp, tb, visit
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, acceptRequestParameter, addCssClass, addGlobalMessage, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, findComponentBundle, getActualID, getAllocationTracepoint, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, hasError, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalOnValueChanged, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetLogAllocations, internalSetTag, isBuilt, isFocusRequested, isStretchHeight, onAddedToPage, onBeforeFullRender, onForceRebuild, onHeaderContributors, onRemoveFromPage, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setStretchHeight, setTestID, setTitle, setUserObject, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListShuttle

public ListShuttle()
Method Detail

createContent

public void createContent()
                   throws java.lang.Exception
Overrides:
createContent in class NodeBase
Throws:
java.lang.Exception

getModel

public IShuttleModel<?,?> getModel()
Get the model for this thingy.

Returns:

setModel

public void setModel(IShuttleModel<?,?> model)
Set the model to use for the shuttle. If the model changes or one of the component models has changed this will cause a redraw.

Parameters:
model -

modelChanged

public void modelChanged(ITableModel<java.lang.Object> model)
The source model has changed. Rebuild the entire component.

Specified by:
modelChanged in interface ITableModelListener<java.lang.Object>
See Also:
ITableModelListener.modelChanged(to.etc.domui.component.tbl.ITableModel)

rowAdded

public void rowAdded(ITableModel<java.lang.Object> model,
                     int index,
                     java.lang.Object value)
              throws java.lang.Exception
A row was moved (back) to the source model: change it.

Specified by:
rowAdded in interface ITableModelListener<java.lang.Object>
Throws:
java.lang.Exception
See Also:
ITableModelListener.rowAdded(to.etc.domui.component.tbl.ITableModel, int, java.lang.Object)

rowDeleted

public void rowDeleted(ITableModel<java.lang.Object> model,
                       int index,
                       java.lang.Object value)
                throws java.lang.Exception
Description copied from interface: ITableModelListener
Called after a row has been deleted.

Specified by:
rowDeleted in interface ITableModelListener<java.lang.Object>
index - The index of the deleted row in the table.
value - The deleted value.
Throws:
java.lang.Exception

rowModified

public void rowModified(ITableModel<java.lang.Object> model,
                        int index,
                        java.lang.Object value)
                 throws java.lang.Exception
Description copied from interface: ITableModelListener
Called after a row has been changed.

Specified by:
rowModified in interface ITableModelListener<java.lang.Object>
Throws:
java.lang.Exception

getSourceRenderer

public INodeContentRenderer<java.lang.Object> getSourceRenderer()

setSourceRenderer

public void setSourceRenderer(INodeContentRenderer<java.lang.Object> sourceRenderer)

getTargetRenderer

public INodeContentRenderer<java.lang.Object> getTargetRenderer()

setTargetRenderer

public void setTargetRenderer(INodeContentRenderer<java.lang.Object> targetRenderer)

isOrderable

public boolean isOrderable()
Is this set to be orderable?

Returns:

getSourceRendererClass

public java.lang.Class<? extends INodeContentRenderer<?>> getSourceRendererClass()

setSourceRendererClass

public void setSourceRendererClass(java.lang.Class<? extends INodeContentRenderer<?>> sourceRendererClass)

getTargetRendererClass

public java.lang.Class<? extends INodeContentRenderer<?>> getTargetRendererClass()

setTargetRendererClass

public void setTargetRendererClass(java.lang.Class<? extends INodeContentRenderer<?>> targetRendererClass)

setOrderable

public void setOrderable(boolean orderable)
When set (and the model supports it) this shows ordering buttons at the right of the target shuttle, allowing the content to be moved up- and downwards.

Parameters:
orderable -