de.jaret.util.ui.table.model
Class JaretTableSelectionModelImpl

java.lang.Object
  extended by de.jaret.util.ui.table.model.JaretTableSelectionModelImpl
All Implemented Interfaces:
IJaretTableSelectionModel

public class JaretTableSelectionModelImpl
extends java.lang.Object
implements IJaretTableSelectionModel

Implementation of the JaretTableSelectionModel.

Version:
$Id: JaretTableSelectionModelImpl.java 180 2007-01-07 18:44:01Z olk $
Author:
Peter Kliem

Field Summary
protected  boolean _cellSelectioAllowed
          true for allowance of single cell selection.
protected  boolean _fullColumnSelectionAllowed
          true for allowance of full column selection.
protected  boolean _fullRowSelectionAllowed
          true for allowance of full row selection.
protected  java.util.List<IJaretTableSelectionModelListener> _listeners
          listeners to inform.
protected  boolean _multipleSelectionAllowed
          true if multiple selection of more than one elemnt is allowed.
protected  boolean _onlyRowSelectionAllowed
          true if only row selections are allowed.
protected  IJaretTableSelection _selection
          the selection data store.
 
Constructor Summary
JaretTableSelectionModelImpl()
           
 
Method Summary
 void addSelectedCell(IJaretTableCell cell)
          Add a cell to the selection.
 void addSelectedColumn(IColumn column)
          Add a column to the selection.
 void addSelectedRow(IRow row)
          Add a row to the selection.
 void addTableSelectionModelListener(IJaretTableSelectionModelListener jtsm)
          Add a listener to listen to changes of the selection.
 void clearSelection()
          Clear the selection.
 IJaretTableSelection getSelection()
          retrieve the selected elements in the tabel selection structure.
 boolean isCellSelectionAllowed()
          
 boolean isFullColumnSelectionAllowed()
          Check whether full column selection is allowed.
 boolean isFullRowSelectionAllowed()
          Check whether full row selection is allowed.
 boolean isMultipleSelectionAllowed()
          Retrieve allowance for multiple elements selectable.
 boolean isOnlyRowSelectionAllowed()
          Check whether only row selection is allowed.
 void removeTableSelectionModelListener(IJaretTableSelectionModelListener jtsm)
          Remove a listener.
 void remSelectedCell(IJaretTableCell cell)
          Remove a cell from the selection.
 void remSelectedColumn(IColumn column)
          Remove a column from the selection.
 void remSelectedRow(IRow row)
          Remove a row from the selection.
 void setCellSelectionAllowed(boolean allowed)
          Set allowance for single cell selections.
 void setFullColumnSelectionAllowed(boolean allowed)
          Set the allowance for full column selection.
 void setFullRowSelectionAllowed(boolean allowed)
          Set the allowance for full row selection.
 void setMultipleSelectionAllowed(boolean allowed)
          Set the allowance for multiple selection.
 void setOnlyRowSelectionAllowed(boolean allowed)
          If set to true only row selection is allowed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_listeners

protected java.util.List<IJaretTableSelectionModelListener> _listeners
listeners to inform.


_fullRowSelectionAllowed

protected boolean _fullRowSelectionAllowed
true for allowance of full row selection.


_fullColumnSelectionAllowed

protected boolean _fullColumnSelectionAllowed
true for allowance of full column selection.


_cellSelectioAllowed

protected boolean _cellSelectioAllowed
true for allowance of single cell selection.


_multipleSelectionAllowed

protected boolean _multipleSelectionAllowed
true if multiple selection of more than one elemnt is allowed.


_onlyRowSelectionAllowed

protected boolean _onlyRowSelectionAllowed
true if only row selections are allowed.


_selection

protected IJaretTableSelection _selection
the selection data store.

Constructor Detail

JaretTableSelectionModelImpl

public JaretTableSelectionModelImpl()
Method Detail

clearSelection

public void clearSelection()
Clear the selection.

Specified by:
clearSelection in interface IJaretTableSelectionModel

isFullRowSelectionAllowed

public boolean isFullRowSelectionAllowed()
Check whether full row selection is allowed.

Specified by:
isFullRowSelectionAllowed in interface IJaretTableSelectionModel
Returns:
true if full row selection is allowed.

setFullRowSelectionAllowed

public void setFullRowSelectionAllowed(boolean allowed)
Set the allowance for full row selection.

Specified by:
setFullRowSelectionAllowed in interface IJaretTableSelectionModel
Parameters:
allowed - true for allowed

isFullColumnSelectionAllowed

public boolean isFullColumnSelectionAllowed()
Check whether full column selection is allowed.

Specified by:
isFullColumnSelectionAllowed in interface IJaretTableSelectionModel
Returns:
true if full column selection is allowed.

setFullColumnSelectionAllowed

public void setFullColumnSelectionAllowed(boolean allowed)
Set the allowance for full column selection.

Specified by:
setFullColumnSelectionAllowed in interface IJaretTableSelectionModel
Parameters:
allowed - true for allowed

isCellSelectionAllowed

public boolean isCellSelectionAllowed()

Specified by:
isCellSelectionAllowed in interface IJaretTableSelectionModel
Returns:
true if selection of single cells is allowed

setCellSelectionAllowed

public void setCellSelectionAllowed(boolean allowed)
Set allowance for single cell selections.

Specified by:
setCellSelectionAllowed in interface IJaretTableSelectionModel
Parameters:
allowed - true for allowed

isMultipleSelectionAllowed

public boolean isMultipleSelectionAllowed()
Retrieve allowance for multiple elements selectable.

Specified by:
isMultipleSelectionAllowed in interface IJaretTableSelectionModel
Returns:
true if multiple elemets should be selectable

setMultipleSelectionAllowed

public void setMultipleSelectionAllowed(boolean allowed)
Set the allowance for multiple selection.

Specified by:
setMultipleSelectionAllowed in interface IJaretTableSelectionModel
Parameters:
allowed - true for allowed

addSelectedRow

public void addSelectedRow(IRow row)
Add a row to the selection.

Specified by:
addSelectedRow in interface IJaretTableSelectionModel
Parameters:
row - element to be added to the selection

remSelectedRow

public void remSelectedRow(IRow row)
Remove a row from the selection.

Specified by:
remSelectedRow in interface IJaretTableSelectionModel
Parameters:
row - element to be removed from the selection

addSelectedColumn

public void addSelectedColumn(IColumn column)
Add a column to the selection.

Specified by:
addSelectedColumn in interface IJaretTableSelectionModel
Parameters:
column - element to be added to the selection

remSelectedColumn

public void remSelectedColumn(IColumn column)
Remove a column from the selection.

Specified by:
remSelectedColumn in interface IJaretTableSelectionModel
Parameters:
column - element to be removed from the selection

addSelectedCell

public void addSelectedCell(IJaretTableCell cell)
Add a cell to the selection.

Specified by:
addSelectedCell in interface IJaretTableSelectionModel
Parameters:
cell - element to be added to the selection

remSelectedCell

public void remSelectedCell(IJaretTableCell cell)
Remove a cell from the selection.

Specified by:
remSelectedCell in interface IJaretTableSelectionModel
Parameters:
cell - element to be removed from the selection

getSelection

public IJaretTableSelection getSelection()
retrieve the selected elements in the tabel selection structure.

Specified by:
getSelection in interface IJaretTableSelectionModel
Returns:
selected elements

addTableSelectionModelListener

public void addTableSelectionModelListener(IJaretTableSelectionModelListener jtsm)
Add a listener to listen to changes of the selection.

Specified by:
addTableSelectionModelListener in interface IJaretTableSelectionModel
Parameters:
jtsm - listener

removeTableSelectionModelListener

public void removeTableSelectionModelListener(IJaretTableSelectionModelListener jtsm)
Remove a listener.

Specified by:
removeTableSelectionModelListener in interface IJaretTableSelectionModel
Parameters:
jtsm - listener to be removed

isOnlyRowSelectionAllowed

public boolean isOnlyRowSelectionAllowed()
Check whether only row selection is allowed.

Specified by:
isOnlyRowSelectionAllowed in interface IJaretTableSelectionModel
Returns:
true if only rows should be selectable

setOnlyRowSelectionAllowed

public void setOnlyRowSelectionAllowed(boolean allowed)
If set to true only row selection is allowed.

Specified by:
setOnlyRowSelectionAllowed in interface IJaretTableSelectionModel
Parameters:
allowed - true for only row selection


Copyright © 2012. All Rights Reserved.