/** * Sets the comparator to use for this column. * <code>JXTable</code> sorting api respects this property by passing it on * to the <code>SortController</code>. * * @param comparator a custom comparator to use in interactive * sorting. * @see #getComparator * @see org.jdesktop.swingx.sort.SortController * @see org.jdesktop.swingx.decorator.SortKey */ public void setComparator(Comparator<?> comparator) { Comparator<?> old = getComparator(); this.comparator = comparator; firePropertyChange("comparator", old, getComparator()); }
/** * Sets the comparator to use for this column. * <code>JXTable</code> sorting api respects this property by passing it on * to the <code>SortController</code>. * * @param comparator a custom comparator to use in interactive * sorting. * @see #getComparator * @see org.jdesktop.swingx.sort.SortController * @see org.jdesktop.swingx.decorator.SortKey */ public void setComparator(Comparator<?> comparator) { Comparator<?> old = getComparator(); this.comparator = comparator; firePropertyChange("comparator", old, getComparator()); }
/** * Sets the comparator to use for this column. * <code>JXTable</code> sorting api respects this property by passing it on * to the <code>SortController</code>. * * @param comparator a custom comparator to use in interactive * sorting. * @see #getComparator * @see org.jdesktop.swingx.sort.SortController * @see org.jdesktop.swingx.decorator.SortKey */ public void setComparator(Comparator<?> comparator) { Comparator<?> old = getComparator(); this.comparator = comparator; firePropertyChange("comparator", old, getComparator()); }
/** * Sets the comparator to use for this column. * <code>JXTable</code> sorting api respects this property by passing it on * to the <code>SortController</code>. * * @param comparator a custom comparator to use in interactive * sorting. * @see #getComparator * @see org.jdesktop.swingx.sort.SortController * @see org.jdesktop.swingx.decorator.SortKey */ public void setComparator(Comparator<?> comparator) { Comparator<?> old = getComparator(); this.comparator = comparator; firePropertyChange("comparator", old, getComparator()); }
/** * Sets the comparator to use for this column. * <code>JXTable</code> sorting api respects this property by passing it on * to the <code>SortController</code>. * * @param comparator a custom comparator to use in interactive * sorting. * @see #getComparator * @see org.jdesktop.swingx.decorator.SortController * @see org.jdesktop.swingx.decorator.SortKey */ public void setComparator(Comparator comparator) { Comparator old = getComparator(); this.comparator = comparator; firePropertyChange("comparator", old, getComparator()); }
/** * * Toggles the sort order of the column at columnIndex. * <p> * The exact behaviour is defined by the SortController's toggleSortOrder * implementation. Typically a unsorted column is sorted in ascending order, * a sorted column's order is reversed. * <p> * Respects the tableColumnExt's sortable and comparator properties: routes * the column's comparator to the SortController and does nothing if * !isSortable(column). * <p> * * PRE: 0 <= columnIndex < getColumnCount() * * @param columnIndex the columnIndex in view coordinates. * */ public void toggleSortOrder(int columnIndex) { if (!isSortable(columnIndex)) return; SortController controller = getSortController(); if (controller != null) { TableColumnExt columnExt = getColumnExt(columnIndex); controller.toggleSortOrder(convertColumnIndexToModel(columnIndex), columnExt != null ? columnExt.getComparator() : null); } }
SortKey sortKey = new SortKey(sortOrder, convertColumnIndexToModel(columnIndex), columnExt != null ? columnExt.getComparator() : null); sortController.setSortKeys(Collections.singletonList(sortKey));
/** * {@inheritDoc} <p> * * Overridden to propagate sort-related column properties to the SortController and * to update string representation of column.<p> * * PENDING JW: check correct update on visibility change!<p> * PENDING JW: need cleanup of string rep after column removed (if it's a real remove) */ @Override public void columnAdded(TableColumnModelEvent e) { super.columnAdded(e); // PENDING JW: check for visibility event? TableColumn column = getColumn(e.getToIndex()); updateStringValueForColumn(column, column.getCellRenderer()); if (ignoreAddColumn) return; updateSortableAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).isSortable() : true); updateComparatorAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).getComparator() : null); }
/** * {@inheritDoc} <p> * * Overridden to propagate sort-related column properties to the SortController and * to update string representation of column.<p> * * PENDING JW: check correct update on visibility change!<p> * PENDING JW: need cleanup of string rep after column removed (if it's a real remove) */ @Override public void columnAdded(TableColumnModelEvent e) { super.columnAdded(e); // PENDING JW: check for visibility event? TableColumn column = getColumn(e.getToIndex()); updateStringValueForColumn(column, column.getCellRenderer()); if (ignoreAddColumn) return; updateSortableAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).isSortable() : true); updateComparatorAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).getComparator() : null); }
/** * {@inheritDoc} <p> * * Overridden to propagate sort-related column properties to the SortController and * to update string representation of column.<p> * * PENDING JW: check correct update on visibility change!<p> * PENDING JW: need cleanup of string rep after column removed (if it's a real remove) */ @Override public void columnAdded(TableColumnModelEvent e) { super.columnAdded(e); // PENDING JW: check for visibility event? TableColumn column = getColumn(e.getToIndex()); updateStringValueForColumn(column, column.getCellRenderer()); if (ignoreAddColumn) return; updateSortableAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).isSortable() : true); updateComparatorAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).getComparator() : null); }
/** * {@inheritDoc} <p> * * Overridden to propagate sort-related column properties to the SortController and * to update string representation of column.<p> * * PENDING JW: check correct update on visibility change!<p> * PENDING JW: need cleanup of string rep after column removed (if it's a real remove) */ @Override public void columnAdded(TableColumnModelEvent e) { super.columnAdded(e); // PENDING JW: check for visibility event? TableColumn column = getColumn(e.getToIndex()); updateStringValueForColumn(column, column.getCellRenderer()); if (ignoreAddColumn) return; updateSortableAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).isSortable() : true); updateComparatorAfterColumnChanged(column, column instanceof TableColumnExt ? ((TableColumnExt) column).getComparator() : null); }
/** * Propagates sort-related properties from table/columns to the sorter if it * is of type SortController, does nothing otherwise. * */ protected void configureSorterProperties() { // need to hack: if a structureChange is the result of a setModel // the rowsorter is not yet updated if (ignoreAddColumn || (!getControlsSorterProperties())) return; getSortController().setStringValueProvider(getStringValueRegistry()); // configure from table properties getSortController().setSortable(sortable); getSortController().setSortsOnUpdates(sortsOnUpdates); getSortController().setSortOrderCycle(getSortOrderCycle()); // configure from column properties List<TableColumn> columns = getColumns(true); for (TableColumn tableColumn : columns) { int modelIndex = tableColumn.getModelIndex(); getSortController().setSortable(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).isSortable() : true); getSortController().setComparator(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).getComparator() : null); } }
/** * Propagates sort-related properties from table/columns to the sorter if it * is of type SortController, does nothing otherwise. * */ protected void configureSorterProperties() { // need to hack: if a structureChange is the result of a setModel // the rowsorter is not yet updated if (ignoreAddColumn || (!getControlsSorterProperties())) return; getSortController().setStringValueProvider(getStringValueRegistry()); // configure from table properties getSortController().setSortable(sortable); getSortController().setSortsOnUpdates(sortsOnUpdates); getSortController().setSortOrderCycle(getSortOrderCycle()); // configure from column properties List<TableColumn> columns = getColumns(true); for (TableColumn tableColumn : columns) { int modelIndex = tableColumn.getModelIndex(); getSortController().setSortable(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).isSortable() : true); getSortController().setComparator(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).getComparator() : null); } }
/** * Propagates sort-related properties from table/columns to the sorter if it * is of type SortController, does nothing otherwise. * */ protected void configureSorterProperties() { // need to hack: if a structureChange is the result of a setModel // the rowsorter is not yet updated if (ignoreAddColumn || (!getControlsSorterProperties())) return; getSortController().setStringValueProvider(getStringValueRegistry()); // configure from table properties getSortController().setSortable(sortable); getSortController().setSortsOnUpdates(sortsOnUpdates); getSortController().setSortOrderCycle(getSortOrderCycle()); // configure from column properties List<TableColumn> columns = getColumns(true); for (TableColumn tableColumn : columns) { int modelIndex = tableColumn.getModelIndex(); getSortController().setSortable(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).isSortable() : true); getSortController().setComparator(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).getComparator() : null); } }
/** * Propagates sort-related properties from table/columns to the sorter if it * is of type SortController, does nothing otherwise. * */ protected void configureSorterProperties() { // need to hack: if a structureChange is the result of a setModel // the rowsorter is not yet updated if (ignoreAddColumn || (!getControlsSorterProperties())) return; getSortController().setStringValueProvider(getStringValueRegistry()); // configure from table properties getSortController().setSortable(sortable); getSortController().setSortsOnUpdates(sortsOnUpdates); getSortController().setSortOrderCycle(getSortOrderCycle()); // configure from column properties List<TableColumn> columns = getColumns(true); for (TableColumn tableColumn : columns) { int modelIndex = tableColumn.getModelIndex(); getSortController().setSortable(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).isSortable() : true); getSortController().setComparator(modelIndex, tableColumn instanceof TableColumnExt ? ((TableColumnExt) tableColumn).getComparator() : null); } }
setVisible(original.isVisible()); setSortable(original.isSortable()); setComparator(original.getComparator()); copyClientPropertiesFrom(original);
setVisible(original.isVisible()); setSortable(original.isSortable()); setComparator(original.getComparator()); copyClientPropertiesFrom(original);
setVisible(original.isVisible()); setSortable(original.isSortable()); setComparator(original.getComparator()); copyClientPropertiesFrom(original);
setVisible(original.isVisible()); setSortable(original.isSortable()); setComparator(original.getComparator()); copyClientPropertiesFrom(original);
setVisible(original.isVisible()); setSortable(original.isSortable()); setComparator(original.getComparator()); copyClientPropertiesFrom(original);