javax.swing.event.TableColumnModelListener Java Examples

The following examples show how to use javax.swing.event.TableColumnModelListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SorterTableColumnModel.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public void moveColumn(int fromIndex, int toIndex) {
    TableColumn from = columnList.get(fromIndex);
    TableColumn to = columnList.get(toIndex);

    columnList.set(fromIndex, to);
    to.setModelIndex(fromIndex);

    columnList.set(toIndex, from);
    from.setModelIndex(toIndex);

    orderUpdate();

    for (TableColumnModelListener w : new ArrayList<>(watchers)) {
        w.columnMoved(new TableColumnModelEvent(this, fromIndex, toIndex));
    }
}
 
Example #2
Source File: ByteViewerHeader.java    From ghidra with Apache License 2.0 4 votes vote down vote up
/**
 * Add a column model listener.
 */
public void addColumnModelListener(TableColumnModelListener l) {
	columnModel.addColumnModelListener(l);
}
 
Example #3
Source File: ByteViewerHeader.java    From ghidra with Apache License 2.0 4 votes vote down vote up
/**
 * Remove a column model listener.
 */
public void removeColumnModelListener(TableColumnModelListener l) {
	columnModel.removeColumnModelListener(l);
}
 
Example #4
Source File: SorterTableColumnModel.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void addColumnModelListener(TableColumnModelListener listener) {
    watchers.add(listener);
}
 
Example #5
Source File: SorterTableColumnModel.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void removeColumnModelListener(TableColumnModelListener listener) {
    watchers.remove(listener);
}
 
Example #6
Source File: ColumnModel.java    From BIMserver with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void addColumnModelListener(TableColumnModelListener x) {
}
 
Example #7
Source File: ColumnModel.java    From BIMserver with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void removeColumnModelListener(TableColumnModelListener x) {
}
 
Example #8
Source File: TableHelper.java    From CodenameOne with GNU General Public License v2.0 votes vote down vote up
public static PropertyChangeListener addColumnModelTracker(JTable p_Table,
      final TableColumnModelListener p_Listener) {
    PropertyChangeListener propListener = new PropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        TableColumnModel oldModel = (TableColumnModel) event.getOldValue();
        TableColumnModel newModel = (TableColumnModel) event.getNewValue();
        if (oldModel != null)
          oldModel.removeColumnModelListener(p_Listener);
        if (newModel != null)
          newModel.addColumnModelListener(p_Listener);
      }
    };
    p_Table.addPropertyChangeListener("columnModel", propListener);
    p_Table.getColumnModel().addColumnModelListener(p_Listener);
    return propListener;
  }