@Override public void removeColumnModelListener(TableColumnModelListener x) { delegate.removeColumnModelListener(x); }
@Override public void mouseReleased(MouseEvent e) { table.getColumnModel().removeColumnModelListener(tcml); } @Override
/** * Reset the TableColumnManager to only manage the TableColumns that are * currently visible in the table. * * Generally this method should only be invoked by the TableColumnManager * when the TableModel of the table is changed. */ public void reset() { table.getColumnModel().removeColumnModelListener(this); columnModel = table.getColumnModel(); columnModel.addColumnModelListener(this); // Keep a duplicate TableColumns for managing hidden TableColumns int count = columnModel.getColumnCount(); allColumns = new ArrayList<>(count); for (int i = 0; i < count; i++) { allColumns.add(columnModel.getColumn(i)); } }
((TableColumnModel) oldVal).removeColumnModelListener(colListener);
/** * Binds this preference object to synchronize its state with a given table component, * allowing to specify an initial offset compared to the stored position. * * @param table * @param minSizes * @param maxSizes * @param defaultSizes */ public void bind( final JTable table, Map<Integer, Integer> minSizes, Map<Integer, Integer> maxSizes, Map<Integer, Integer> defaultSizes) { this.table = table; this.columnCount = table.getColumnCount(); this.currentWidth = new int[columnCount]; table.getColumnModel().removeColumnModelListener(listener); updateTable(minSizes, maxSizes, defaultSizes); table.getColumnModel().addColumnModelListener(listener); }
/** * Unregister all the listeners set in the <code>registerToTableColumns(JTable)</code> method. * * @param table * the table no more using this model. * @see #registerToTableColumns */ public void unregisterFormTableColumns(JTable table) { TableColumnModel cm = table.getColumnModel(); cm.removeColumnModelListener(columnModelListener); int len = cm.getColumnCount(); for (int i = 0; i < len; i++) { TableColumn col = cm.getColumn(i); if (col != null) { TableCellRenderer headerRenderer = col.getHeaderRenderer(); if (headerRenderer instanceof SortHeaderRenderer) { SortHeaderRenderer sorterRenderer = (SortHeaderRenderer) headerRenderer; sorterRenderer.setSortModel(null); } } } JTableHeader tableHeader = table.getTableHeader(); tableHeader.removeMouseListener(tableHeaderListener); tableHeaders.remove(tableHeader); }
/** * Hide a column from view in the table. * * @param column * the TableColumn to be removed from the TableColumnModel of the * table */ public void hideColumn(TableColumn column) { if (columnModel.getColumnCount() == 1) { return; } // Ignore changes to the TableColumnModel made by the TableColumnManager columnModel.removeColumnModelListener(this); columnModel.removeColumn(column); columnModel.addColumnModelListener(this); }
TableColumnModelListener listener = map.get(targetTable); targetModel.removeColumnModelListener(listener);
TableColumnModelListener listener = map.get(targetTable); targetModel.removeColumnModelListener(listener);
@Override public void propertyChange(final PropertyChangeEvent evt) { Object newValue = evt.getNewValue(); Object oldValue = evt.getOldValue(); if (newValue instanceof JTableHeader && oldValue instanceof JTableHeader) { JTableHeader newModel = (JTableHeader) newValue; JTableHeader oldModel = (JTableHeader) oldValue; oldModel.removeMouseListener(this); newModel.addMouseListener(this); } if (newValue instanceof TableColumnModel && oldValue instanceof TableColumnModel) { TableColumnModel newModel = (TableColumnModel) newValue; TableColumnModel oldModel = (TableColumnModel) oldValue; oldModel.removeColumnModelListener(this); newModel.addColumnModelListener(this); } if (newValue instanceof TableModel && oldValue instanceof TableModel) { TableModel newModel = (TableModel) newValue; TableModel oldModel = (TableModel) oldValue; oldModel.removeTableModelListener(this); newModel.addTableModelListener(this); } }
protected void uninstallListeners() { super.uninstallListeners(); // Remove sorting information - even if we only // switch TinyLaF themes, we cannot preserve state handler.removeSortingInformation(); header.removeMouseListener(handler); header.removeMouseMotionListener(handler); header.getColumnModel().removeColumnModelListener(handler); }
TableColumnModel targetModel = targetTable.getColumnModel(); TableColumnModelListener listener = tableToColModelListener.get(targetTable); targetModel.removeColumnModelListener(listener); try { for (int i = 0; i < sourceModel.getColumnCount(); i++) {
/** * @see AbstractIconFeedback#detach() */ @Override public void detach() { if (table != null) { table.removeComponentListener(cellTracker); table.removePropertyChangeListener("columnModel", cellTracker); if (table.getColumnModel() != null) { table.getColumnModel().removeColumnModelListener(cellTracker); } table.removePropertyChangeListener("sorter", cellTracker); table.removePropertyChangeListener("rowSorter", cellTracker); if (table.getRowSorter() != null) { table.getRowSorter().removeRowSorterListener(cellTracker); } } super.detach(); }
/** * Show a hidden column in the table. The column will be positioned at its * proper place in the view of the table. * * @param column * the TableColumn to be shown. */ private void showColumn(TableColumn column) { // Ignore changes to the TableColumnModel made by the TableColumnManager columnModel.removeColumnModelListener(this); // Add the column to the end of the table columnModel.addColumn(column); // Move the column to its position before it was hidden. // (Multiple columns may be hidden so we need to find the first // visible column before this column so the column can be moved // to the appropriate position) int position = allColumns.indexOf(column); int from = columnModel.getColumnCount() - 1; int to = 0; for (int i = position - 1; i > -1; i--) { try { TableColumn visibleColumn = allColumns.get(i); to = columnModel.getColumnIndex(visibleColumn.getHeaderValue()) + 1; break; } catch (IllegalArgumentException e) { } } columnModel.moveColumn(from, to); columnModel.addColumnModelListener(this); }
/** * Adjusts internal state after table's column model property has changed. * Handles cleanup of listeners to the old/new columnModel (Note, that * it listens to the column model only if it can control column visibility). * Updates content of popup. * * @param oldModel the old <code>TableColumnModel</code> we had been listening to. */ protected void updateFromColumnModelChange(TableColumnModel oldModel) { if (oldModel != null) { oldModel.removeColumnModelListener(columnModelListener); } populatePopup(); if (canControl()) { table.getColumnModel().addColumnModelListener(getColumnModelListener()); } }
/** * Adjusts internal state after table's column model property has changed. * Handles cleanup of listeners to the old/new columnModel (Note, that * it listens to the column model only if it can control column visibility). * Updates content of popup. * * @param oldModel the old <code>TableColumnModel</code> we had been listening to. */ protected void updateFromColumnModelChange(TableColumnModel oldModel) { if (oldModel != null) { oldModel.removeColumnModelListener(columnModelListener); } populatePopup(); if (canControl()) { table.getColumnModel().addColumnModelListener(getColumnModelListener()); } }
/** * Adjusts internal state after table's column model property has changed. * Handles cleanup of listeners to the old/new columnModel (Note, that * it listens to the column model only if it can control column visibility). * Updates content of popup. * * @param oldModel the old <code>TableColumnModel</code> we had been listening to. */ protected void updateFromColumnModelChange(TableColumnModel oldModel) { if (oldModel != null) { oldModel.removeColumnModelListener(columnModelListener); } populatePopup(); if (canControl()) { table.getColumnModel().addColumnModelListener(getColumnModelListener()); } }
/** * Adjusts internal state after table's column model property has changed. * Handles cleanup of listeners to the old/new columnModel (Note, that * it listens to the column model only if it can control column visibility). * Updates content of popup. * * @param oldModel the old <code>TableColumnModel</code> we had been listening to. */ protected void updateFromColumnModelChange(TableColumnModel oldModel) { if (oldModel != null) { oldModel.removeColumnModelListener(columnModelListener); } populatePopup(); if (canControl()) { table.getColumnModel().addColumnModelListener(getColumnModelListener()); } }
/** * Adjusts internal state after table's column model property has changed. * Handles cleanup of listeners to the old/new columnModel (Note, that * it listens to the column model only if it can control column visibility). * Updates content of popup. * * @param oldModel the old <code>TableColumnModel</code> we had been listening to. */ protected void updateFromColumnModelChange(TableColumnModel oldModel) { if (oldModel != null) { oldModel.removeColumnModelListener(columnModelListener); } populatePopup(); if (canControl()) { table.getColumnModel().addColumnModelListener(getColumnModelListener()); } }
outline.getColumnModel().addColumnModelListener(listener); } else { outline.getColumnModel().removeColumnModelListener(listener);