org.archiviststoolkit.mydomain
Class DomainTableWorkSurface

java.lang.Object
  extended by org.archiviststoolkit.mydomain.DomainTableWorkSurface
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener, WorkSurface

public class DomainTableWorkSurface
extends java.lang.Object
implements WorkSurface, java.awt.event.MouseListener, java.awt.event.ActionListener

A worksurface which can display a domain table.


Nested Class Summary
(package private)  class DomainTableWorkSurface.LookupWorkerRunnable
           
 
Field Summary
(package private)  org.hibernate.Session longSessionForPrinting
           
(package private)  int rowCount
           
 
Constructor Summary
DomainTableWorkSurface(java.lang.Class clazz, java.lang.String name, javax.swing.Icon icon)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
          do something useful when an event occurs.
 void addToResultSet(DomainObject domainObject)
           
 void closeLongSessionForPrinting()
           
 void exportEAD()
           
 void exportMARC()
           
 java.lang.Class getClazz()
           
 javax.swing.JComponent getComponent()
          Get the underlying component for this worksurface.
 javax.swing.Icon getIcon()
          Get the icon associated with this worksurface.
 java.lang.String getName()
          Get the name of this worksurface.
 ConcreteAction getNewAction()
          get the action which creates.
 java.util.Collection getResultSet()
           
 java.util.ArrayList<DomainObject> getResultSetForPrinting(InfiniteProgressPanel progressPanel, ATReport report)
           
 int getSelectedRowCount()
           
 javax.swing.JTable getTable()
          Get the JTable used for this worksurface.
 DomainTableFormat getTableFormat()
           
 java.lang.String getTooltip()
          Get the tooltip string for this worksurface.
 void merge()
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Deals with a double click and therefore edit event on the table.
 void mouseEntered(java.awt.event.MouseEvent e)
          mouse has entered the component.
 void mouseExited(java.awt.event.MouseEvent e)
          mouse has left the component.
 void mousePressed(java.awt.event.MouseEvent evt)
          called when the mouse is pressed.
 void mouseReleased(java.awt.event.MouseEvent evt)
          called when the mouse is released.
 void onDelete()
           
 void onFindAll()
           
 void onInsert()
          on insert display a blank editor and insert the results.
 void onRemoveGroup(int[] selectedIndexes)
          onRemoveGroup delete a specific domain object.
 void onSearch()
           
 void onUpdate()
          onUpdate show the appropriate editor.
 void updateColumns()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longSessionForPrinting

org.hibernate.Session longSessionForPrinting

rowCount

int rowCount
Constructor Detail

DomainTableWorkSurface

public DomainTableWorkSurface(java.lang.Class clazz,
                              java.lang.String name,
                              javax.swing.Icon icon)
Constructor.

Parameters:
clazz - the domain model class
name - the name of this worksurface
icon - the icon of this worksurface
Method Detail

getNewAction

public final ConcreteAction getNewAction()
get the action which creates.

Returns:
the action

mousePressed

public final void mousePressed(java.awt.event.MouseEvent evt)
called when the mouse is pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - the mouse event

mouseReleased

public final void mouseReleased(java.awt.event.MouseEvent evt)
called when the mouse is released.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
evt - the mouse event

mouseClicked

public final void mouseClicked(java.awt.event.MouseEvent e)
Deals with a double click and therefore edit event on the table.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseEntered

public final void mouseEntered(java.awt.event.MouseEvent e)
mouse has entered the component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - the event

mouseExited

public final void mouseExited(java.awt.event.MouseEvent e)
mouse has left the component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - the event

getTable

public final javax.swing.JTable getTable()
Get the JTable used for this worksurface.

Returns:
the JTable

getIcon

public final javax.swing.Icon getIcon()
Get the icon associated with this worksurface.

Specified by:
getIcon in interface WorkSurface
Returns:
icon the icon

getName

public final java.lang.String getName()
Get the name of this worksurface.

Specified by:
getName in interface WorkSurface
Returns:
the name

getComponent

public final javax.swing.JComponent getComponent()
Get the underlying component for this worksurface.

Specified by:
getComponent in interface WorkSurface
Returns:
the root component

getTooltip

public final java.lang.String getTooltip()
Get the tooltip string for this worksurface.

Specified by:
getTooltip in interface WorkSurface
Returns:
the tooltip

actionPerformed

public final void actionPerformed(java.awt.event.ActionEvent actionEvent)
do something useful when an event occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
actionEvent - the event to process

onDelete

public void onDelete()

onUpdate

public final void onUpdate()
onUpdate show the appropriate editor.


onRemoveGroup

public final void onRemoveGroup(int[] selectedIndexes)
onRemoveGroup delete a specific domain object.

Parameters:
selectedIndexes - the indexes of the domain objects

onInsert

public final void onInsert()
on insert display a blank editor and insert the results.


addToResultSet

public void addToResultSet(DomainObject domainObject)

onSearch

public final void onSearch()

onFindAll

public final void onFindAll()

getResultSet

public java.util.Collection getResultSet()

getResultSetForPrinting

public java.util.ArrayList<DomainObject> getResultSetForPrinting(InfiniteProgressPanel progressPanel,
                                                                 ATReport report)
                                                          throws PersistenceException,
                                                                 LookupException,
                                                                 UnsupportedClassException
Throws:
PersistenceException
LookupException
UnsupportedClassException

getSelectedRowCount

public int getSelectedRowCount()

closeLongSessionForPrinting

public void closeLongSessionForPrinting()

getTableFormat

public DomainTableFormat getTableFormat()

getClazz

public java.lang.Class getClazz()

updateColumns

public void updateColumns()

exportMARC

public void exportMARC()

exportEAD

public void exportEAD()

merge

public void merge()