org.fopps.ui
Class TableListController

java.lang.Object
  |
  +--org.fopps.ui.TableListController
All Implemented Interfaces:
ContainerSelectable, Controller, java.util.EventListener, java.awt.ItemSelectable, javax.swing.event.ListSelectionListener, javax.swing.event.TableModelListener
Direct Known Subclasses:
ConfigurationTableListController

public abstract class TableListController
extends java.lang.Object
implements javax.swing.event.TableModelListener, javax.swing.event.ListSelectionListener, ContainerSelectable, Controller

Syncs a list with entries and a dependend table. Allows only single selection.


Constructor Summary
TableListController(EnhancedTable pTable, EnhancedList pList)
          Constructor for TableListController.
 
Method Summary
 void addItemListener(java.awt.event.ItemListener pListener)
          Adds a new item listener
 EnhancedList getList()
          Returns the list instance
 java.lang.Object getSelectedObject()
          Convenience method
 java.lang.Object[] getSelectedObjects()
          Returns the currently selected object in the list.
 EnhancedTable getTable()
          Returns the table instance
 ViewActionReceiver[] getViews()
          Returns the corresponding view(s) of the controller
abstract  void itemDeselected(java.lang.Object pSelectedObject)
          Called if an item in the list was deselected.
abstract  void itemSelected(java.lang.Object pSelectedObject, int pIndex)
          Called if an item in the list was selected.
 void notifyListeners(java.awt.event.ItemEvent pEvent)
          Notifies all item listeners
 void removeAllItemListener()
          Removes all item listeners
 void removeItemListener(java.awt.event.ItemListener pListener)
          Removes a item listener
abstract  void setContainer(ProjectContainer pContainer)
          Sets the container
 void tableChanged(javax.swing.event.TableModelEvent e)
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableListController

public TableListController(EnhancedTable pTable,
                           EnhancedList pList)
Constructor for TableListController.

Method Detail

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
See Also:
ListSelectionListener.valueChanged(ListSelectionEvent)

itemSelected

public abstract void itemSelected(java.lang.Object pSelectedObject,
                                  int pIndex)
Called if an item in the list was selected. Please note, that the list model in this context only allows single selection.

Parameters:
pSelectedObject - Selected item in list
pIndex - Index of item.

itemDeselected

public abstract void itemDeselected(java.lang.Object pSelectedObject)
Called if an item in the list was deselected.

Parameters:
pSelectedObject - Deselected item in list

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Specified by:
tableChanged in interface javax.swing.event.TableModelListener
See Also:
TableModelListener.tableChanged(TableModelEvent)

getSelectedObject

public final java.lang.Object getSelectedObject()
Convenience method


getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Returns the currently selected object in the list. If no item is selected, an empty list is returned

Specified by:
getSelectedObjects in interface java.awt.ItemSelectable
See Also:
ItemSelectable.getSelectedObjects()

getList

public final EnhancedList getList()
Returns the list instance


getTable

public final EnhancedTable getTable()
Returns the table instance


getViews

public ViewActionReceiver[] getViews()
Returns the corresponding view(s) of the controller

Specified by:
getViews in interface Controller

addItemListener

public void addItemListener(java.awt.event.ItemListener pListener)
Adds a new item listener

Specified by:
addItemListener in interface java.awt.ItemSelectable
Parameters:
pListener - Listener to add

removeItemListener

public void removeItemListener(java.awt.event.ItemListener pListener)
Removes a item listener

Specified by:
removeItemListener in interface java.awt.ItemSelectable
Parameters:
pListener - Listener to remove

removeAllItemListener

public void removeAllItemListener()
Removes all item listeners


notifyListeners

public void notifyListeners(java.awt.event.ItemEvent pEvent)
Notifies all item listeners


setContainer

public abstract void setContainer(ProjectContainer pContainer)
Description copied from interface: ContainerSelectable
Sets the container

Specified by:
setContainer in interface ContainerSelectable


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.