de.jaret.util.ui.table.util
Class AbstractSelectionProvider

java.lang.Object
  extended by de.jaret.util.ui.table.util.AbstractSelectionProvider
All Implemented Interfaces:
IJaretTableSelectionModelListener, org.eclipse.jface.viewers.ISelectionProvider
Direct Known Subclasses:
DefaultSelectionProvider

public abstract class AbstractSelectionProvider
extends java.lang.Object
implements org.eclipse.jface.viewers.ISelectionProvider, IJaretTableSelectionModelListener

Abstract base for an ISelectionProvider based on a jaret Table.

Version:
$Id: AbstractSelectionProvider.java 183 2007-01-08 01:02:17Z olk $
Author:
Peter Kliem

Field Summary
protected  java.util.List<org.eclipse.jface.viewers.ISelectionChangedListener> _selectionChangeListeners
          list of ISelection listeners
protected  JaretTable _table
          jaret table the selection provider listens to.
 
Constructor Summary
AbstractSelectionProvider(JaretTable table)
          Contruct an abstract selection provider.
 
Method Summary
 void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
          
 void cellSelectionAdded(IJaretTableCell cell)
          Called whenever a cell has been added to a selection.
 void cellSelectionRemoved(IJaretTableCell cell)
          Called whenever a cell has been removed from the selection.
 void columnSelectionAdded(IColumn column)
          Called whenever a column has been added to a selection.
 void columnSelectionRemoved(IColumn column)
          Called whenever a column has been removed from the selection.
protected abstract  org.eclipse.jface.viewers.ISelection getISelection()
          Override this method to return an ISelectiobn appropriate for the intended use.
 org.eclipse.jface.viewers.ISelection getSelection()
           Retrieve an IStructuredSelection of the current selection (will contain rows, columns and cells).
 void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
          
 void rowSelectionAdded(IRow row)
          Called whenever a row has been added to a selection.
 void rowSelectionRemoved(IRow row)
          Called whenever a row has been removed from the selection.
protected abstract  void setISelection(org.eclipse.jface.viewers.ISelection selection)
          Override this method to set a selection on the table based on an ISelection.
 void setSelection(org.eclipse.jface.viewers.ISelection selection)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_table

protected JaretTable _table
jaret table the selection provider listens to.


_selectionChangeListeners

protected java.util.List<org.eclipse.jface.viewers.ISelectionChangedListener> _selectionChangeListeners
list of ISelection listeners. *

Constructor Detail

AbstractSelectionProvider

public AbstractSelectionProvider(JaretTable table)
Contruct an abstract selection provider.

Parameters:
table - JaretTable to listen to
Method Detail

addSelectionChangedListener

public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)

Specified by:
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider

removeSelectionChangedListener

public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)

Specified by:
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection)

Specified by:
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Retrieve an IStructuredSelection of the current selection (will contain rows, columns and cells).

Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider

getISelection

protected abstract org.eclipse.jface.viewers.ISelection getISelection()
Override this method to return an ISelectiobn appropriate for the intended use.

Returns:
ISelection

setISelection

protected abstract void setISelection(org.eclipse.jface.viewers.ISelection selection)
Override this method to set a selection on the table based on an ISelection.

Parameters:
selection - ISelection to be set.

rowSelectionAdded

public void rowSelectionAdded(IRow row)
Called whenever a row has been added to a selection.

Specified by:
rowSelectionAdded in interface IJaretTableSelectionModelListener
Parameters:
row - row added.

rowSelectionRemoved

public void rowSelectionRemoved(IRow row)
Called whenever a row has been removed from the selection.

Specified by:
rowSelectionRemoved in interface IJaretTableSelectionModelListener
Parameters:
row - row removed.

cellSelectionAdded

public void cellSelectionAdded(IJaretTableCell cell)
Called whenever a cell has been added to a selection.

Specified by:
cellSelectionAdded in interface IJaretTableSelectionModelListener
Parameters:
cell - cell added

cellSelectionRemoved

public void cellSelectionRemoved(IJaretTableCell cell)
Called whenever a cell has been removed from the selection.

Specified by:
cellSelectionRemoved in interface IJaretTableSelectionModelListener
Parameters:
cell - cell removed

columnSelectionAdded

public void columnSelectionAdded(IColumn column)
Called whenever a column has been added to a selection.

Specified by:
columnSelectionAdded in interface IJaretTableSelectionModelListener
Parameters:
column - column added

columnSelectionRemoved

public void columnSelectionRemoved(IColumn column)
Called whenever a column has been removed from the selection.

Specified by:
columnSelectionRemoved in interface IJaretTableSelectionModelListener
Parameters:
column - column removed


Copyright © 2012. All Rights Reserved.