Java Code Examples for javax.swing.event.TableColumnModelListener

The following examples show how to use javax.swing.event.TableColumnModelListener. These examples are extracted from open source projects. 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
@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 Project: ghidra   Source File: ByteViewerHeader.java    License: 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 Project: ghidra   Source File: ByteViewerHeader.java    License: 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
@Override
public void addColumnModelListener(TableColumnModelListener listener) {
    watchers.add(listener);
}
 
Example 5
@Override
public void removeColumnModelListener(TableColumnModelListener listener) {
    watchers.remove(listener);
}
 
Example 6
Source Project: BIMserver   Source File: ColumnModel.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void addColumnModelListener(TableColumnModelListener x) {
}
 
Example 7
Source Project: BIMserver   Source File: ColumnModel.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void removeColumnModelListener(TableColumnModelListener x) {
}
 
Example 8
Source Project: CodenameOne   Source File: TableHelper.java    License: 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;
  }