This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 195883
Collapse All | Expand All

(-)a/o.n.swing.outline/apichanges.xml (+15 lines)
Lines 108-113 Link Here
108
108
109
<changes>
109
<changes>
110
110
111
    <change id="fireQuickFilterChange">
112
      <api name="etable_outline"/>
113
      <summary>Ability to listen on changes of Quick Filter</summary>
114
      <version major="1" minor="13"/>
115
      <date day="2" month="3" year="2011"/>
116
      <author login="jtulach"/>
117
      <compatibility addition="yes" binary="compatible" deprecation="no"/>
118
      <description>
119
        <p>New property <a href="@TOP@/org/netbeans/swing/etable/ETable.html#PROP_QUICK_FILTER">PROP_QUICK_FILTER</a>
120
        is fired when quick filter is changed.
121
        </p>
122
      </description>
123
      <class package="org.netbeans.swing.etable" name="ETable"/>
124
      <issue number="666666"/>
125
    </change>
111
    <change id="nested_comparator">
126
    <change id="nested_comparator">
112
      <api name="etable_outline"/>
127
      <api name="etable_outline"/>
113
      <summary>Possibility to define comparator for sorting the rows</summary>
128
      <summary>Possibility to define comparator for sorting the rows</summary>
(-)a/o.n.swing.outline/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.swing.outline
2
OpenIDE-Module: org.netbeans.swing.outline
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/outline/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/outline/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.12
4
OpenIDE-Module-Specification-Version: 1.13
5
5
(-)a/o.n.swing.outline/src/org/netbeans/swing/etable/ETable.java (+8 lines)
Lines 134-139 Link Here
134
 * @author David Strupl
134
 * @author David Strupl
135
 */
135
 */
136
public class ETable extends JTable {
136
public class ETable extends JTable {
137
    /** Property that is fired when calling {@link #setQuickFilter(int, java.lang.Object)} or
138
     * {@link #unsetQuickFilter()}. 
139
     * @since 1.13
140
     */
141
    public static final String PROP_QUICK_FILTER = "quickFilter";
142
    
137
    
143
    
138
    /** Action key for up/down focus action */
144
    /** Action key for up/down focus action */
139
    private static final String ACTION_FOCUS_NEXT = "focusNext"; //NOI18N
145
    private static final String ACTION_FOCUS_NEXT = "focusNext"; //NOI18N
Lines 780-785 Link Here
780
        resetPermutation ();
786
        resetPermutation ();
781
        filteredRowCount = -1; // force to recompute the rowCount
787
        filteredRowCount = -1; // force to recompute the rowCount
782
        super.tableChanged(new TableModelEvent(getModel()));
788
        super.tableChanged(new TableModelEvent(getModel()));
789
        firePropertyChange(PROP_QUICK_FILTER, null, null);
783
    }
790
    }
784
791
785
    /**
792
    /**
Lines 812-817 Link Here
812
        filteredRowCount = -1;
819
        filteredRowCount = -1;
813
        resetPermutation ();
820
        resetPermutation ();
814
        super.tableChanged(new TableModelEvent(getModel()));
821
        super.tableChanged(new TableModelEvent(getModel()));
822
        firePropertyChange(PROP_QUICK_FILTER, null, null);
815
    }
823
    }
816
    
824
    
817
    /**
825
    /**
(-)a/o.n.swing.outline/test/unit/src/org/netbeans/swing/etable/ETableTest.java (+22 lines)
Lines 45-50 Link Here
45
45
46
import java.awt.event.InputEvent;
46
import java.awt.event.InputEvent;
47
import java.awt.event.KeyEvent;
47
import java.awt.event.KeyEvent;
48
import java.beans.PropertyChangeEvent;
49
import java.beans.PropertyChangeListener;
48
import java.util.Properties;
50
import java.util.Properties;
49
import javax.swing.table.DefaultTableModel;
51
import javax.swing.table.DefaultTableModel;
50
import javax.swing.table.TableColumn;
52
import javax.swing.table.TableColumn;
Lines 96-101 Link Here
96
        assertEquals("Sort reorder (3) not ok", 3, t.convertRowIndexToModel(0));
98
        assertEquals("Sort reorder (3) not ok", 3, t.convertRowIndexToModel(0));
97
        assertEquals("Sort reorder (4) not ok", 4, t.convertRowIndexToModel(5));
99
        assertEquals("Sort reorder (4) not ok", 4, t.convertRowIndexToModel(5));
98
    }
100
    }
101
    
102
    public void testFirePropertyChangeForQuickFilter() {
103
        ETable t = new ETable();
104
        class L implements PropertyChangeListener {
105
            int cnt;
106
            
107
            @Override
108
            public void propertyChange(PropertyChangeEvent evt) {
109
                assertEquals("quickFilter", evt.getPropertyName());
110
                cnt++;
111
            }
112
            
113
        }
114
        L listener = new L();
115
        t.addPropertyChangeListener(listener);
116
        t.setQuickFilter(1, new Object());
117
        assertEquals("One filter change", 1, listener.cnt);
118
        t.unsetQuickFilter();
119
        assertEquals("Second change", 2, listener.cnt);
120
    }
99
121
100
    
122
    
101
    /**
123
    /**

Return to bug 195883