All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.ComponentTable

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JTable
                                   |
                                   +----com.sgi.sysadm.ui.ComponentTable

public class ComponentTable
extends JTable
implements MouseListener, MouseMotionListener
A subclass of JTable that supports embedding JComponents into the table and sorting the table by clicking on a column header.

All the constructors are the same as JTable's.


Constructor Index

 o ComponentTable()
 o ComponentTable(int, int)
 o ComponentTable(Object[][], Object[])
 o ComponentTable(TableModel)
 o ComponentTable(TableModel, TableColumnModel)
 o ComponentTable(TableModel, TableColumnModel, ListSelectionModel)
 o ComponentTable(Vector, Vector)

Method Index

 o addNotify()
Override addNotify() in order to initialize table headers.
 o addTableSortRequestListener(TableSortRequestListener)
Adds a listener that will be notified when the user requests that a table be sorted on a particular column.
 o mouseClicked(MouseEvent)
 o mouseDragged(MouseEvent)
Called when the mouse is dragged over the table.
 o mouseEntered(MouseEvent)
Called when the mouse enters the table.
 o mouseExited(MouseEvent)
Called when the mouse leaves the table.
 o mouseMoved(MouseEvent)
Called when the mouse is moved over the table.
 o mousePressed(MouseEvent)
Called if the mouse is pressed over the table.
 o mouseReleased(MouseEvent)
Called if the mouse is released over the table.
 o removeTableSortRequestListener(TableSortRequestListener)
Removes a sort request listener
 o sizeColumnsToFit(boolean)
Called when we're resized to set the sizes of the columns to fit the table.

Constructors

 o ComponentTable
 public ComponentTable()
See Also:
JTable
 o ComponentTable
 public ComponentTable(int numColumns,
                       int numRows)
See Also:
JTable
 o ComponentTable
 public ComponentTable(Object data[][],
                       Object columnNames[])
See Also:
JTable
 o ComponentTable
 public ComponentTable(TableModel dm)
See Also:
JTable
 o ComponentTable
 public ComponentTable(TableModel dm,
                       TableColumnModel cm)
See Also:
JTable
 o ComponentTable
 public ComponentTable(TableModel dm,
                       TableColumnModel cm,
                       ListSelectionModel sm)
See Also:
JTable
 o ComponentTable
 public ComponentTable(Vector data,
                       Vector columnNames)
See Also:
JTable

Methods

 o addNotify
 public void addNotify()
Override addNotify() in order to initialize table headers. The goal is to align the headers with the columns underneath.

Overrides:
addNotify in class JTable
 o addTableSortRequestListener
 public void addTableSortRequestListener(TableSortRequestListener listener)
Adds a listener that will be notified when the user requests that a table be sorted on a particular column.

Parameters:
listener - The listener to add
 o removeTableSortRequestListener
 public void removeTableSortRequestListener(TableSortRequestListener listener)
Removes a sort request listener

Parameters:
listener - The listener to remove
 o mouseClicked
 public void mouseClicked(MouseEvent event)
See Also:
mouseClicked
 o mousePressed
 public void mousePressed(MouseEvent event)
Called if the mouse is pressed over the table. Finds the component (if any) over which the mouse was pressed and sends the event to that component.

See Also:
mousePressed
 o mouseReleased
 public void mouseReleased(MouseEvent event)
Called if the mouse is released over the table. Finds the component (if any) over which the mouse was released and sends the event to that component.

See Also:
mouseReleased
 o mouseEntered
 public void mouseEntered(MouseEvent event)
Called when the mouse enters the table. Currently ignored.

See Also:
mouseEntered
 o mouseExited
 public void mouseExited(MouseEvent event)
Called when the mouse leaves the table. Currently ignored.

See Also:
mouseExited
 o sizeColumnsToFit
 public void sizeColumnsToFit(boolean lastColumnOnly)
Called when we're resized to set the sizes of the columns to fit the table. Overridden to do nothing if width is less than 1 to avoid botched columns at initialization.

Overrides:
sizeColumnsToFit in class JTable
See Also:
sizeColumnsToFit
 o mouseDragged
 public void mouseDragged(MouseEvent event)
Called when the mouse is dragged over the table. Generates entered, exited, and dragged mouse events and sends them to the embedded components.

See Also:
mouseDragged
 o mouseMoved
 public void mouseMoved(MouseEvent event)
Called when the mouse is moved over the table. Generates entered, exited, and moved mouse events and sends them to the embedded components.

See Also:
mouseMoved

All Packages  Class Hierarchy  This Package  Previous  Next  Index