to.etc.domui.component.tbl
Interface IShuttleModel<S,T>

Type Parameters:
S - The type of the elements in the SOURCE model.
T - The type of the elements in the TARGET model.
All Known Subinterfaces:
IMovableShuttleModel<S,T>

public interface IShuttleModel<S,T>

The data model for a ListShuttle. This is a compound model which contains related TableModels, one for the SOURCE list and one for the TARGET list. It is the responsibility of this model's implementation to ensure that an item that is present in the SOURCE list is NOT PRESENT in the TARGET list and vice versa!!

The two Model implementations *must* implement proper model change events for changes to the model, since those events are used by the ListShuttle to update the UI(!). Using the default implementations for the ITableModel interface ensures that event handling is proper.

Author:
Frits Jalvingh Created on Nov 6, 2008

Method Summary
 ITableModel<S> getSourceModel()
          Get the model for the SOURCE side of the shuttle.
 ITableModel<T> getTargetModel()
          Get the model for the TARGET side of the shuttle.
 void moveSourceToTarget(int six, int tix)
          This gets called when items are moved by the user from SOURCE to TARGET.
 void moveTargetToSource(int tix)
          This gets called when items are moved by the user from TARGET to SOURCE.
 

Method Detail

getSourceModel

ITableModel<S> getSourceModel()
Get the model for the SOURCE side of the shuttle. For a single IShuttleModel, this gets called only once; the result is cached within the ListShuttle. If this model is replaced you MUST set a new IShuttleModel onto the ListShuttle to make it recognise that the underlying model has changed. In addition, this model has a relationship with the TargetModel; properly maintaining that relationship is the responsibility of the model implementer!!

Returns:

getTargetModel

ITableModel<T> getTargetModel()
Get the model for the TARGET side of the shuttle. For a single IShuttleModel, this gets called only once; the result is cached within the ListShuttle. If this model is replaced you MUST set a new IShuttleModel onto the ListShuttle to make it recognise that the underlying model has changed. In addition, this model has a relationship with the SourceModel; properly maintaining that relationship is the responsibility of the model implementer!!

Returns:

moveSourceToTarget

void moveSourceToTarget(int six,
                        int tix)
                        throws java.lang.Exception
This gets called when items are moved by the user from SOURCE to TARGET. This method MUST update both the target model and the source model to reflect that change, and it must cause the appropriate model events to be sent. This usually entails deleting a record from source and adding it to target. If the model that the item moves to is sorted it is the responsibility of the model to insert the added item at the correct location, and to send the event for that location.

Parameters:
six -
tix -
Throws:
java.lang.Exception

moveTargetToSource

void moveTargetToSource(int tix)
                        throws java.lang.Exception
This gets called when items are moved by the user from TARGET to SOURCE. This method MUST update both the target model and the source model to reflect that change, and it must cause the appropriate model events to be sent. This usually entails deleting a record from target and adding it back to source. If the model that the item moves to is sorted it is the responsibility of the model to insert the added item at the correct location, and to send the event for that location.

Parameters:
tix -
Throws:
java.lang.Exception