org.xnap.gui.table
Class TableHeaderHandler

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.xnap.gui.table.TableHeaderHandler
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class TableHeaderHandler
extends java.awt.event.MouseAdapter
implements java.awt.event.MouseMotionListener

TableHeaderHandler class handles the mouse events invoked by clicking on the header portion of the JTable.


Constructor Summary
TableHeaderHandler(javax.swing.JTable jta, SortableModel stm, javax.swing.JPopupMenu jpm)
           
 
Method Summary
static TableHeaderHandler install(javax.swing.JTable jta)
          Installs listener.
static TableHeaderHandler install(javax.swing.JTable jta, javax.swing.JPopupMenu jpm)
           
static TableHeaderHandler install(javax.swing.JTable jta, javax.swing.JPopupMenu jpm, SortableModel stm)
          Installs a TableHeaderHandler to jta.
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void restoreSelections()
           
 void setListener(TableHeaderListener thl)
           
 void setTree(javax.swing.JTree jt)
           
 void showPopupMenu(java.awt.event.MouseEvent e)
          Displays the popup menu.
 void sortByColumn(int column)
           
 void storeSelections()
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableHeaderHandler

public TableHeaderHandler(javax.swing.JTable jta,
                          SortableModel stm,
                          javax.swing.JPopupMenu jpm)
Method Detail

install

public static TableHeaderHandler install(javax.swing.JTable jta,
                                         javax.swing.JPopupMenu jpm,
                                         SortableModel stm)
Installs a TableHeaderHandler to jta. The handler takes care of sorting and resizing.

The SortableTableModel parameter is needed for the JTreeTable, because it uses a TreeTableModelAdapter that wraps around the real TableModel.


install

public static TableHeaderHandler install(javax.swing.JTable jta,
                                         javax.swing.JPopupMenu jpm)

install

public static TableHeaderHandler install(javax.swing.JTable jta)
Installs listener.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

setListener

public void setListener(TableHeaderListener thl)

setTree

public void setTree(javax.swing.JTree jt)

showPopupMenu

public void showPopupMenu(java.awt.event.MouseEvent e)
Displays the popup menu.


sortByColumn

public void sortByColumn(int column)

storeSelections

public void storeSelections()

restoreSelections

public void restoreSelections()


Copyright © 2001-2005 XNap Team. All Rights Reserved.