org.xnap.commons.gui.table
Class TableLayout

java.lang.Object
  extended by org.xnap.commons.gui.table.TableLayout

public class TableLayout
extends Object

TODO update documentation TODO squig don't make TableSorter a requirement, maybe have a general table layout and a more specific SortableTableLayout subclass? TableHeaderHandler class handles the mouse events invoked by clicking on the header portion of the JTable. TODO setter for maintain sort order TODO call stopCellEditing() whenever neccessary


Nested Class Summary
protected  class TableLayout.EventHandler
           
 
Constructor Summary
TableLayout(JTable table)
           
TableLayout(JTable table, TableSorter sorter)
           
 
Method Summary
 void addTableLayoutListener(TableLayoutListener l)
           
 TableColumn getColumnAt(int index)
           
 int getColumnCount()
           
 int getColumnIndex(String identifier)
           
 Iterator<TableColumn> getColumns()
           
 JPopupMenu getHeaderPopupMenu()
           
 boolean getMaintainSortOrder()
           
 int getSortedColumn()
           
 SortableModel.Order getSortOrder()
           
 JTable getTable()
           
 int getVisibleColumnsCount()
           
 boolean isColumnVisible(int index)
           
 void removeTableLayoutListener(TableLayoutListener l)
           
 void restoreSelections()
           
 void setAllColumnsVisible(boolean visible)
           
 void setColumnName(int index, String name)
           
 void setColumnNames(String[] columnNames)
           
 void setColumnProperties(int index, String key)
           
 void setColumnProperties(int index, String key, int width)
           
 void setColumnsVisible(String[] columns)
           
 void setColumnVisible(int index, boolean visible)
           
 void setMaintainSortOrder(boolean maintainSortOrder)
           
 void setTree(JTree jt)
           
 void showPopupMenu(MouseEvent e)
          Displays the popup menu.
 void sortByColumn(int modelIndex, SortableModel.Order sortOrder, boolean revert)
           
 void stopCellEditing()
           
 void storeSelections()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLayout

public TableLayout(JTable table)

TableLayout

public TableLayout(JTable table,
                   TableSorter sorter)
Method Detail

addTableLayoutListener

public void addTableLayoutListener(TableLayoutListener l)

getColumnAt

public TableColumn getColumnAt(int index)

getColumnCount

public int getColumnCount()

getColumnIndex

public int getColumnIndex(String identifier)

getColumns

public Iterator<TableColumn> getColumns()

getMaintainSortOrder

public boolean getMaintainSortOrder()

getSortedColumn

public int getSortedColumn()

getTable

public JTable getTable()

getHeaderPopupMenu

public JPopupMenu getHeaderPopupMenu()

getVisibleColumnsCount

public int getVisibleColumnsCount()

isColumnVisible

public boolean isColumnVisible(int index)

getSortOrder

public SortableModel.Order getSortOrder()

removeTableLayoutListener

public void removeTableLayoutListener(TableLayoutListener l)

restoreSelections

public void restoreSelections()

setAllColumnsVisible

public void setAllColumnsVisible(boolean visible)

setColumnNames

public void setColumnNames(String[] columnNames)

setColumnName

public void setColumnName(int index,
                          String name)

setColumnProperties

public void setColumnProperties(int index,
                                String key)

setColumnProperties

public void setColumnProperties(int index,
                                String key,
                                int width)

setColumnVisible

public void setColumnVisible(int index,
                             boolean visible)

setColumnsVisible

public void setColumnsVisible(String[] columns)

setMaintainSortOrder

public void setMaintainSortOrder(boolean maintainSortOrder)

setTree

public void setTree(JTree jt)

showPopupMenu

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


sortByColumn

public void sortByColumn(int modelIndex,
                         SortableModel.Order sortOrder,
                         boolean revert)

storeSelections

public void storeSelections()

stopCellEditing

public void stopCellEditing()


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.