Package javax.swing

Examples of javax.swing.RowSorter


    try
    {
      if (column == 0)
      {
        final RepositoryTableModel tableModel = (RepositoryTableModel) table.getModel();
        final RowSorter rowSorter = table.getRowSorter();
        final FileObject e;
        if (rowSorter != null)
        {
          e = tableModel.getElementForRow(rowSorter.convertRowIndexToModel(row));
        }
        else
        {
          e = tableModel.getElementForRow(row);
        }
View Full Code Here


            }

            // Stuff a variable into the client property of this renderer
            // indicating the sort order, so that different rendering can be
            // done for the header based on sorted state.
            RowSorter                                   rs       = table == null ? null : table.getRowSorter();
            java.util.List<? extends RowSorter.SortKey> sortKeys = rs == null ? null : rs.getSortKeys();

            if (sortKeys != null && sortKeys.size() > 0 && sortKeys.get(0).getColumn() == table.convertColumnIndexToModel(column)) {
                switch (sortKeys.get(0).getSortOrder()) {

                case ASCENDING:
View Full Code Here

    public Class<?> getColumnClass(int column) {
        return ((EasyTableColumn<V>) getColumnModel().getColumn(column)).getValueClass();
    }

    public int getRowCount() {
        RowSorter sorter = getRowSorter();
        if (sorter != null) {
            return sorter.getViewRowCount();
        }
        return getViewDatas().size();
    }
View Full Code Here

     * of RuntimeExceptions when the filter is applied.
     */
    @SuppressWarnings("unchecked")
    public final void setRowFilter(RowFilter<? extends TableModel, Integer> filter) {
        this.rowFilter = filter;
        RowSorter sorter = getRowSorter();
        if (sorter instanceof DefaultRowSorter) {
            ((DefaultRowSorter) sorter).setRowFilter(filter);
        }
    }
View Full Code Here

     * @return boolean - whether the column is sorted or not.
     */
    public static boolean isColumnSorted(JTable table, int column) {
        boolean isSorted = false;
        final int modelColumn = table.convertColumnIndexToModel(column);
        RowSorter sorter = table.getRowSorter();
        if (sorter != null) {
            List<? extends SortKey> sortKeys = sorter.getSortKeys();
            for (SortKey sortKey : sortKeys) {
                if (sortKey.getColumn() == modelColumn) {
                    isSorted = true;
                    break;
                }
View Full Code Here

  /**
   * @see {@link javax.swing.JTable#convertRowIndexToView(int)}
   */
  public int convertRowIndexToView(int modelRowIndex)
  {
    RowSorter sorter = getRowSorter();
    if (sorter != null)
    {
      return sorter.convertRowIndexToView(modelRowIndex);
    }
    return modelRowIndex;
  }
View Full Code Here

  /**
   * @see {@link javax.swing.JTable#convertRowIndexToModel(int)}
   */
  public int convertRowIndexToModel(int viewRowIndex)
  {
    RowSorter sorter = getRowSorter();
    if (sorter != null)
    {
      return sorter.convertRowIndexToModel(viewRowIndex);
    }
    return viewRowIndex;
  }
View Full Code Here

TOP

Related Classes of javax.swing.RowSorter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.