/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(int columnIndex) { TableColumn column = getColumn(columnIndex); if (column instanceof TableColumnExt) { return (TableColumnExt) column; } return null; }
/** * Update internal state after the visibility of the column * was changed to visible. The given column is assumed to * be contained in this model. * * @param col the column which was made visible. */ protected void moveToVisible(TableColumnExt col) { isVisibilityChange = true; // two step process: first add at end of columns // then move to "best" position relative to where it // was before hiding. super.addColumn(col); // this is analogous to the proposed fix in #253-swingx // but uses the currentColumns as reference. Integer addIndex = currentColumns.indexOf(col); for (int i = 0; i < (getColumnCount() - 1); i++) { TableColumn tableCol = getColumn(i); int actualPosition = currentColumns.indexOf(tableCol); if (actualPosition > addIndex) { super.moveColumn(getColumnCount() - 1, i); break; } } isVisibilityChange = false; }
/** * Update internal state after the visibility of the column * was changed to visible. The given column is assumed to * be contained in this model. * * @param col the column which was made visible. */ protected void moveToVisible(TableColumnExt col) { isVisibilityChange = true; // two step process: first add at end of columns // then move to "best" position relative to where it // was before hiding. super.addColumn(col); // this is analogous to the proposed fix in #253-swingx // but uses the currentColumns as reference. Integer addIndex = currentColumns.indexOf(col); for (int i = 0; i < (getColumnCount() - 1); i++) { TableColumn tableCol = getColumn(i); int actualPosition = currentColumns.indexOf(tableCol); if (actualPosition > addIndex) { super.moveColumn(getColumnCount() - 1, i); break; } } isVisibilityChange = false; }
/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(int columnIndex) { TableColumn column = getColumn(columnIndex); if (column instanceof TableColumnExt) { return (TableColumnExt) column; } return null; }
/** * Update internal state after the visibility of the column * was changed to visible. The given column is assumed to * be contained in this model. * * @param col the column which was made visible. */ protected void moveToVisible(TableColumnExt col) { isVisibilityChange = true; // two step process: first add at end of columns // then move to "best" position relative to where it // was before hiding. super.addColumn(col); // this is analogous to the proposed fix in #253-swingx // but uses the currentColumns as reference. Integer addIndex = currentColumns.indexOf(col); for (int i = 0; i < (getColumnCount() - 1); i++) { TableColumn tableCol = getColumn(i); int actualPosition = currentColumns.indexOf(tableCol); if (actualPosition > addIndex) { super.moveColumn(getColumnCount() - 1, i); break; } } isVisibilityChange = false; }
/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(int columnIndex) { TableColumn column = getColumn(columnIndex); if (column instanceof TableColumnExt) { return (TableColumnExt) column; } return null; }
/** * Update internal state after the visibility of the column * was changed to visible. The given column is assumed to * be contained in this model. * * @param col the column which was made visible. */ protected void moveToVisible(TableColumnExt col) { isVisibilityChange = true; // two step process: first add at end of columns // then move to "best" position relative to where it // was before hiding. super.addColumn(col); // this is analogous to the proposed fix in #253-swingx // but uses the currentColumns as reference. Integer addIndex = currentColumns.indexOf(col); for (int i = 0; i < (getColumnCount() - 1); i++) { TableColumn tableCol = getColumn(i); int actualPosition = currentColumns.indexOf(tableCol); if (actualPosition > addIndex) { super.moveColumn(getColumnCount() - 1, i); break; } } isVisibilityChange = false; }
/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(int columnIndex) { TableColumn column = getColumn(columnIndex); if (column instanceof TableColumnExt) { return (TableColumnExt) column; } return null; }
/** * Update internal state after the visibility of the column * was changed to visible. The given column is assumed to * be contained in this model. * * @param col the column which was made visible. */ protected void moveToVisible(TableColumnExt col) { col.putClientProperty(IGNORE_EVENT, Boolean.TRUE); // two step process: first add at end of columns // then move to "best" position relative to where it // was before hiding. super.addColumn(col); // this is analogous to the proposed fix in #253-swingx // but uses the currentColumns as reference. Integer addIndex = currentColumns.indexOf(col); for (int i = 0; i < (getColumnCount() - 1); i++) { TableColumn tableCol = getColumn(i); int actualPosition = currentColumns.indexOf(tableCol); if (actualPosition > addIndex) { super.moveColumn(getColumnCount() - 1, i); break; } } col.putClientProperty(IGNORE_EVENT, null); }
/** * {@inheritDoc} */ public TableColumnExt getColumnExt(int columnIndex) { TableColumn column = getColumn(columnIndex); if (column instanceof TableColumnExt) { return (TableColumnExt) column; } return null; }
/** * hot fix for #157: listeners that are aware of * the possible existence of invisible columns * should check if the received columnAdded originated * from moving a column from invisible to visible. * * @param newIndex the toIndex of the columnEvent * @return true if the column was moved to visible */ public boolean isAddedFromInvisibleEvent(int newIndex) { if (!(getColumn(newIndex) instanceof TableColumnExt)) return false; return Boolean.TRUE.equals(((TableColumnExt) getColumn(newIndex)).getClientProperty(IGNORE_EVENT)); }