org.oddjob.arooa.design.view.multitype
Class MultiTypeDesignModel

java.lang.Object
  extended by org.oddjob.arooa.design.view.multitype.AbstractMultiTypeModel
      extended by org.oddjob.arooa.design.view.multitype.MultiTypeDesignModel
All Implemented Interfaces:
MultiTypeModel

public class MultiTypeDesignModel
extends AbstractMultiTypeModel

The model for a MultiTypeTable created from a property.

Author:
rob

Field Summary
static QTag NULL_TAG
           
 
Constructor Summary
MultiTypeDesignModel(MultiTypeTable viewModel)
          Constructor.
 
Method Summary
 void createRow(Object creator, int rowIndex)
          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 removeRow(int rowIndex)
          Remove a row.
 void swapRow(int from, int direction)
          Swap two rows.
 
Methods inherited from class org.oddjob.arooa.design.view.multitype.AbstractMultiTypeModel
addMultiTypeListener, fireRowChanged, fireRowInserted, fireRowRemoved, removeMultiTypeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_TAG

public static final QTag NULL_TAG
Constructor Detail

MultiTypeDesignModel

public MultiTypeDesignModel(MultiTypeTable viewModel)
Constructor.

Parameters:
viewModel - The model.
Method Detail

getTypeOptions

public Object[] getTypeOptions()
Description copied from interface: MultiTypeModel
Get the options that are the type. These will be the elements supported by a property.

Returns:
The options. Never null.

getDeleteOption

public Object getDeleteOption()
Description copied from interface: MultiTypeModel
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

public int getRowCount()
Description copied from interface: MultiTypeModel
The number of rows.

Returns:
The number of rows.

createRow

public void createRow(Object creator,
                      int rowIndex)
Description copied from interface: MultiTypeModel
Create a row.

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

getRow

public MultiTypeRow getRow(int index)
Description copied from interface: MultiTypeModel
Get a row.

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

removeRow

public void removeRow(int rowIndex)
Description copied from interface: MultiTypeModel
Remove a row.

Parameters:
rowIndex - The index of the row.

swapRow

public void swapRow(int from,
                    int direction)
Description copied from interface: MultiTypeModel
Swap two rows.

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