@Test public void testRemoveColumn() { final TableColumn nameColumn = createColumn("name"); EventList<TableColumn> columns = new BasicEventList<>(); columns.add(nameColumn); columns.add(createColumn("age")); DefaultTableColumnModel defaultModel = watcher.createDefaultModel(columns); EventTableColumnModel eventModel1 = watcher.createEventModel(columns); EventTableColumnModel eventModel2 = watcher.createEventModel(GlazedLists.eventList(columns)); assertModelEquals(eventModel1, defaultModel); assertModelEquals(eventModel2, defaultModel); assertModelEquals(eventModel1, eventModel2); assertEquals(3, nameColumn.getPropertyChangeListeners().length); columns.remove(0); defaultModel.removeColumn(nameColumn); eventModel2.removeColumn(nameColumn); assertModelEquals(eventModel1, defaultModel); assertModelEquals(eventModel2, defaultModel); assertModelEquals(eventModel1, eventModel2); assertEquals(0, nameColumn.getPropertyChangeListeners().length); watcher.assertFiredEventsAgreeAndClear(); }
@Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
EventTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, ListEventListener<T> { @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } } }
EventTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, ListEventListener<T> { @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } } EventTableColumnModel(EventList<T> source); }
EventTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, ListEventListener<T> { @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } } EventTableColumnModel(EventList<T> source); @Override void addColumn(TableColumn column); @Override void removeColumn(TableColumn column); @Override void moveColumn(int columnIndex, int newIndex); @Override void setColumnMargin(int newMargin); @Override int getColumnMargin(); @Override int getColumnCount(); @Override Enumeration<TableColumn> getColumns(); @Override int getColumnIndex(Object identifier); @Override TableColumn getColumn(int columnIndex); @Override int getColumnIndexAtX(int x); @Override int getTotalColumnWidth(); @Override void setColumnSelectionAllowed(boolean flag); @Override boolean getColumnSelectionAllowed(); @Override int[] getSelectedColumns(); @Override int getSelectedColumnCount(); @Override void setSelectionModel(ListSelectionModel newModel); @Override ListSelectionModel getSelectionModel(); @Override void addColumnModelListener(TableColumnModelListener listener); @Override void removeColumnModelListener(TableColumnModelListener listener); @Override void propertyChange(PropertyChangeEvent evt); @Override void valueChanged(ListSelectionEvent e); @Override void listChanged(ListEvent<T> listChanges); void dispose(); }
EventTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, ListEventListener<T> { @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } } EventTableColumnModel(EventList<T> source); @Override void addColumn(TableColumn column); @Override void removeColumn(TableColumn column); @Override void moveColumn(int columnIndex, int newIndex); @Override void setColumnMargin(int newMargin); @Override int getColumnMargin(); @Override int getColumnCount(); @Override Enumeration<TableColumn> getColumns(); @Override int getColumnIndex(Object identifier); @Override TableColumn getColumn(int columnIndex); @Override int getColumnIndexAtX(int x); @Override int getTotalColumnWidth(); @Override void setColumnSelectionAllowed(boolean flag); @Override boolean getColumnSelectionAllowed(); @Override int[] getSelectedColumns(); @Override int getSelectedColumnCount(); @Override void setSelectionModel(ListSelectionModel newModel); @Override ListSelectionModel getSelectionModel(); @Override void addColumnModelListener(TableColumnModelListener listener); @Override void removeColumnModelListener(TableColumnModelListener listener); @Override void propertyChange(PropertyChangeEvent evt); @Override void valueChanged(ListSelectionEvent e); @Override void listChanged(ListEvent<T> listChanges); void dispose();  }