Java Doc for FilteredTableModel.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » gui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jEdit » org.gjt.sp.jedit.gui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.table.AbstractTableModel
      org.gjt.sp.jedit.gui.FilteredTableModel

FilteredTableModel
abstract public class FilteredTableModel extends AbstractTableModel implements TableModelListener(Code)
This TableModel delegates another model to add some filtering features to any JTable. To use it you must implement the abstract method passFilter(). This method is called for each row, and must return true if the row should be visible, and false otherwise. It is also possible to override the method prepareFilter() that allow you to transform the filter String. Usually you can return it as lowercase

Here is an example of how to use it extracted from the InstallPanel PluginTableModel tableModel = new PluginTableModel(); filteredTableModel = new FilteredTableModel(tableModel) { public String prepareFilter(String filter) { return filter.toLowerCase(); }

public boolean passFilter(int row, String filter) { String pluginName = (String) delegated.getValueAt(row, 1); return pluginName.toLowerCase().contains(filter); } }; table = new JTable(filteredTableModel); filteredTableModel.setTable(table); It is not mandatory but highly recommended to give the JTable instance to the model in order to keep the selection after the filter has been updated
author:
   Shlomy Reinstein
author:
   Matthieu Casanova
version:
   $Id: Buffer.java 8190 2006-12-07 07:58:34Z kpouer $
since:
   jEdit 4.3pre11



Field Summary
protected  Edelegated
     The delegated table model.

Constructor Summary
protected  FilteredTableModel(E delegated)
    

Method Summary
public  ClassgetColumnClass(int columnIndex)
    
public  intgetColumnCount()
    
public  StringgetColumnName(int columnIndex)
    
public  EgetDelegated()
    
public  intgetInternal2ExternalRow(int internalRowIndex)
     Converts a row index from the delegated table model into a row index of the JTable.
public  intgetRowCount()
    
public  intgetTrueRow(int rowIndex)
     Converts a row index from the JTable to an internal row index from the delegated model.
public  ObjectgetValueAt(int rowIndex, int columnIndex)
    
public  booleanisCellEditable(int rowIndex, int columnIndex)
    
abstract public  booleanpassFilter(int row, String filter)
     This callback indicates if a row passes the filter.
public  StringprepareFilter(String filter)
    
public  voidsetDelegated(E delegated)
    
public  voidsetFilter(String filter)
    
public  voidsetTable(JTable table)
     Set the JTable that uses this model.
public  voidsetValueAt(Object aValue, int rowIndex, int columnIndex)
    
public  voidtableChanged(TableModelEvent e)
     This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.

Field Detail
delegated
protected E delegated(Code)
The delegated table model.




Constructor Detail
FilteredTableModel
protected FilteredTableModel(E delegated)(Code)




Method Detail
getColumnClass
public Class getColumnClass(int columnIndex)(Code)



getColumnCount
public int getColumnCount()(Code)



getColumnName
public String getColumnName(int columnIndex)(Code)



getDelegated
public E getDelegated()(Code)



getInternal2ExternalRow
public int getInternal2ExternalRow(int internalRowIndex)(Code)
Converts a row index from the delegated table model into a row index of the JTable.
Parameters:
  internalRowIndex - the internal row index the table row index or -1 if this row is not visible



getRowCount
public int getRowCount()(Code)



getTrueRow
public int getTrueRow(int rowIndex)(Code)
Converts a row index from the JTable to an internal row index from the delegated model.
Parameters:
  rowIndex - the row index the row index in the delegated model



getValueAt
public Object getValueAt(int rowIndex, int columnIndex)(Code)



isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)(Code)



passFilter
abstract public boolean passFilter(int row, String filter)(Code)
This callback indicates if a row passes the filter.
Parameters:
  row - the row number the delegate row count
Parameters:
  filter - the filter string true if the row must be visible



prepareFilter
public String prepareFilter(String filter)(Code)



setDelegated
public void setDelegated(E delegated)(Code)



setFilter
public void setFilter(String filter)(Code)



setTable
public void setTable(JTable table)(Code)
Set the JTable that uses this model. It is used to restore the selection after the filter has been applied If it is null,
Parameters:
  table - the table that uses the model



setValueAt
public void setValueAt(Object aValue, int rowIndex, int columnIndex)(Code)



tableChanged
public void tableChanged(TableModelEvent e)(Code)
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.



Fields inherited from javax.swing.table.AbstractTableModel
protected EventListenerList listenerList(Code)(Java Doc)

Methods inherited from javax.swing.table.AbstractTableModel
public void addTableModelListener(TableModelListener l)(Code)(Java Doc)
public int findColumn(String columnName)(Code)(Java Doc)
public void fireTableCellUpdated(int row, int column)(Code)(Java Doc)
public void fireTableChanged(TableModelEvent e)(Code)(Java Doc)
public void fireTableDataChanged()(Code)(Java Doc)
public void fireTableRowsDeleted(int firstRow, int lastRow)(Code)(Java Doc)
public void fireTableRowsInserted(int firstRow, int lastRow)(Code)(Java Doc)
public void fireTableRowsUpdated(int firstRow, int lastRow)(Code)(Java Doc)
public void fireTableStructureChanged()(Code)(Java Doc)
public Class getColumnClass(int columnIndex)(Code)(Java Doc)
public String getColumnName(int column)(Code)(Java Doc)
public T[] getListeners(Class<T> listenerType)(Code)(Java Doc)
public TableModelListener[] getTableModelListeners()(Code)(Java Doc)
public boolean isCellEditable(int rowIndex, int columnIndex)(Code)(Java Doc)
public void removeTableModelListener(TableModelListener l)(Code)(Java Doc)
public void setValueAt(Object aValue, int rowIndex, int columnIndex)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.