@Test public void testNoThreadProxyingDesired() { final JLabel jamesLabel = new JLabel("James"); final EventList<JLabel> source = new BasicEventList<>(); source.add(jamesLabel); final TableFormat<JLabel> tableFormat = new LabelTableFormat(); final EventTableModel<JLabel> labelModelWithProxy = new EventTableModel<>(source, tableFormat); assertNotNull(labelModelWithProxy.swingThreadSource); assertSame(labelModelWithProxy.source, labelModelWithProxy.swingThreadSource); assertEquals(1, labelModelWithProxy.getRowCount()); assertEquals("James", labelModelWithProxy.getValueAt(0, 0)); assertSame(jamesLabel, labelModelWithProxy.getElementAt(0)); assertTrue(labelModelWithProxy.isCellEditable(0, 0)); labelModelWithProxy.setValueAt("Thanks Holger", 0, 0); assertEquals("Thanks Holger", labelModelWithProxy.getValueAt(0, 0)); labelModelWithProxy.dispose(); assertNull(labelModelWithProxy.swingThreadSource); assertNull(labelModelWithProxy.source); jamesLabel.setText("James"); final NoProxyingEventTableModel<JLabel> labelModelNoProxy = new NoProxyingEventTableModel<>(source, tableFormat); assertNull(labelModelNoProxy.swingThreadSource); assertSame(labelModelNoProxy.source, source); assertEquals(1, labelModelNoProxy.getRowCount()); assertEquals("James", labelModelNoProxy.getValueAt(0, 0)); assertSame(jamesLabel, labelModelNoProxy.getElementAt(0)); assertTrue(labelModelNoProxy.isCellEditable(0, 0)); labelModelNoProxy.setValueAt("Thanks Holger", 0, 0); assertEquals("Thanks Holger", labelModelNoProxy.getValueAt(0, 0)); labelModelNoProxy.dispose(); assertNull(labelModelNoProxy.swingThreadSource); assertNull(labelModelNoProxy.swingThreadSource); assertNull(labelModelNoProxy.source); }
@Override public void dispose() { if (swingThreadSource != null) { swingThreadSource.dispose(); } swingThreadSource = null; super.dispose(); }
EventTableModel extends DefaultEventTableModel<E> { @Override public void dispose() { if (swingThreadSource != null) { swingThreadSource.dispose(); } swingThreadSource = null; super.dispose(); } }
EventTableModel extends DefaultEventTableModel<E> { @Override public void dispose() { if (swingThreadSource != null) { swingThreadSource.dispose(); } swingThreadSource = null; super.dispose(); } @Deprecated  EventTableModel(EventList<E> source, TableFormat<? super E> tableFormat); @Deprecated  EventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable); }
EventTableModel extends DefaultEventTableModel<E> { @Override public void dispose() { if (swingThreadSource != null) { swingThreadSource.dispose(); } swingThreadSource = null; super.dispose(); } @Deprecated  EventTableModel(EventList<E> source, TableFormat<? super E> tableFormat); @Deprecated  EventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable); @Override void dispose(); }
EventTableModel extends DefaultEventTableModel<E> { @Override public void dispose() { if (swingThreadSource != null) { swingThreadSource.dispose(); } swingThreadSource = null; super.dispose(); } @Deprecated  EventTableModel(EventList<E> source, TableFormat<? super E> tableFormat); @Deprecated  EventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable); @Override void dispose();  }