org.oddjob.arooa.design.view.multitype
Interface MultiTypeModel

All Known Implementing Classes:
AbstractMultiTypeModel, MultiTypeDesignModel

public interface MultiTypeModel

The model used to provide data to a MultiTypeTableWidget and process changes from the view.

Author:
rob

Method Summary
 void addMultiTypeListener(MultiTypeListener listener)
          Add a listener that will receive notification of changes to this model.
 void createRow(Object creator, int row)
          Create a row.
 Object getDeleteOption()
          Get the option that causes a row to be deleted.
 MultiTypeRow getRow(int index)
          Get a row.
 int getRowCount()
          The number of rows.
 Object[] getTypeOptions()
          Get the options that are the type.
 void removeMultiTypeListener(MultiTypeListener listener)
          Remove a listener.
 void removeRow(int index)
          Remove a row.
 void swapRow(int from, int direction)
          Swap two rows.
 

Method Detail

addMultiTypeListener

void addMultiTypeListener(MultiTypeListener listener)
Add a listener that will receive notification of changes to this model.

Parameters:
listener - The listener.

removeMultiTypeListener

void removeMultiTypeListener(MultiTypeListener listener)
Remove a listener.

Parameters:
listener - The listener.

getTypeOptions

Object[] getTypeOptions()
Get the options that are the type. These will be the elements supported by a property.

Returns:
The options. Never null.

getDeleteOption

Object getDeleteOption()
Get the option that causes a row to be deleted. This must be the same instance each time because the widget uses == to compere the value to this.

Returns:
The delete object.

getRowCount

int getRowCount()
The number of rows.

Returns:
The number of rows.

createRow

void createRow(Object creator,
               int row)
Create a row.

Parameters:
creator - The thing that drives the creation. Either a new element type or the name of a variable.
row - The row being created.

getRow

MultiTypeRow getRow(int index)
Get a row.

Parameters:
index - The index of the row.
Returns:
A row.

removeRow

void removeRow(int index)
Remove a row.

Parameters:
index - The index of the row.

swapRow

void swapRow(int from,
             int direction)
Swap two rows.

Parameters:
from - The row from.
direction - The direction of the swap, +1 or -1.