[hg] main-silver: #221427: Matching row doesn't work

  • From: Jaroslav Havlin < >
  • To:
  • Subject: [hg] main-silver: #221427: Matching row doesn't work
  • Date: Tue, 06 Nov 2012 12:06:55 -0800

changeset e0c601c961ba in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/e0c601c961ba
description:
        #221427: Matching row doesn't work

diffstat:

 db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java 
|  12 ++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (33 lines):

diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
@@ -57,10 +57,12 @@
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import javax.swing.DefaultRowSorter;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JTable;
 import javax.swing.JTextField;
+import javax.swing.RowFilter;
 import javax.swing.RowSorter;
 import javax.swing.SwingUtilities;
 import javax.swing.TransferHandler;
@@ -146,6 +148,16 @@
         return new StringFallbackRowSorter(this.getModel());
     }
 
+    @Override
+    @SuppressWarnings("unchecked")
+    public <R extends TableModel> void setRowFilter(RowFilter<? super R, ? 
super Integer> filter) {
+        if(getRowSorter() instanceof DefaultRowSorter) {
+            ((DefaultRowSorter) getRowSorter()).setRowFilter(filter);
+        } else {
+            super.setRowFilter(filter);
+        }
+    }
+
     public void createTableModel(List<Object[]> rows, final JXTableRowHeader 
rowHeader) {
         assert SwingUtilities.isEventDispatchThread() : "Must be called from 
AWT thread";  //NOI18N
         assert rows != null;

[hg] main-silver: #221427: Matching row doesn't work

Jaroslav Havlin 11/06/2012

Project Features

About this Project

DB was started in November 2009, is owned by Antonin Nebuzelsky, and has 113 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close