Examples of SortKey


Examples of javax.swing.RowSorter.SortKey

        // bloody hack: get primary SortKey and
        // check if there's a column with it available
        RowSorter<?> controller = getRowSorter();
        if (controller != null) {
            // PENDING JW: must use RowSorter?
            SortKey sortKey = SortUtils.getFirstSortingKey(controller
                    .getSortKeys());
            if (sortKey != null) {
                int sorterColumn = sortKey.getColumn();
                List<TableColumn> columns = getColumns(true);
                for (Iterator<TableColumn> iter = columns.iterator(); iter
                        .hasNext();) {
                    TableColumn column = iter.next();
                    if (column.getModelIndex() == sorterColumn) {
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

        RowSorter<? extends TableModel> sorter = table.getRowSorter();
        List<? extends SortKey> keys = sorter.getSortKeys();
        int index = -1;
        SortOrder order = SortOrder.ASCENDING;
        if (!keys.isEmpty()) {
            SortKey key = keys.get(0);
            index = key.getColumn();
            order = key.getSortOrder();
        }
        prefs.putInt    (INDEX, index);
        prefs.putEnum(ORDER, order);
    }
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

      if ((sortKeys1 == null) || (sortKeys2 == null))
        return false;
      if (size1 != size2)
        return false;
      for (int i = 0; i < size1; i++) {
        SortKey sortKey1 = sortKeys1.get(i);
        SortKey sortKey2 = sortKeys2.get(i);
        if ((sortKey1.getColumn() != sortKey2.getColumn())
            || (sortKey1.getSortOrder() != sortKey2.getSortOrder())) {
          return false;
        }
      }
      return true;
    }
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

      if (sortKeys == null) {
        oldSortKeys = null;
      } else {
        oldSortKeys = new ArrayList<SortKey>();
        for (SortKey sortKey : sortKeys) {
          SortKey copy = new SortKey(sortKey.getColumn(),
              sortKey.getSortOrder());
          oldSortKeys.add(copy);
        }
      }
      syncSelection(isDifferentSorter);
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

      @Override
      public int compare(Integer a, Integer b) {
        return a-b;
      }
    });
    sorter.setSortKeys(Arrays.asList(new SortKey[]{new SortKey(1, SortOrder.DESCENDING)}));
    leaderTable.setRowSorter(sorter);

    add(new JLabelBold("Leaderboard"), BorderLayout.NORTH);
    add(new JScrollPane(leaderTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
  }
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

    }

    public SortStatus getSortStatus() {
        List<? extends SortKey> sortKeys = getRowSorter().getSortKeys();
        if (sortKeys.size() == 1) {
            SortKey key = sortKeys.get(0);
            OperationLogTableColumn column = (OperationLogTableColumn) ((OperationLogTableModel) getModel())
                            .getColumnDescriptor(key.getColumn());
            return new SortStatus(column, key.getSortOrder());
        }
        return null;
    }
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

  {
    if (table.getRowSorter() != null && table.getRowSorter().getSortKeys() != null
        && table.getRowSorter().getSortKeys().size() > 0
        && ((SortKey)table.getRowSorter().getSortKeys().get(0)).getColumn() == columnIndex)
    {
      SortKey sortKey = (SortKey)table.getRowSorter().getSortKeys().get(0);
      if (sortKey.getSortOrder() == SortOrder.ASCENDING)
      {
        return ARROW_UP;
      }
      else if (sortKey.getSortOrder() == SortOrder.DESCENDING)
      {
        return ARROW_DOWN;
      }
      else
      {
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.controls.SortKey

            request.removeControl( ctrl );
        }

        PROVIDER_LOG
            .debug( "Adding sort control to sort the entries by entryDn attribute to preserve order of insertion" );
        SortKey sk = new SortKey( SchemaConstants.ENTRY_DN_AT );
        // matchingrule for "entryDn"
        sk.setMatchingRuleId( "2.5.13.1" );
        sk.setReverseOrder( true );

        ctrl = new SortRequestControlImpl();
        ctrl.addSortKey( sk );

        request.addControl( ctrl );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.controls.SortKey

        req.setScope( SearchScope.SUBTREE );
        req.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
        // the ENTRY_DN_AT must be in the attribute list, otherwise sorting fails
        req.addAttributes( SchemaConstants.ENTRY_DN_AT );

        SortKey sk = new SortKey( SchemaConstants.ENTRY_DN_AT, "2.5.13.1" );
        SortRequest ctrl = new SortRequestControlImpl();
        ctrl.addSortKey( sk );
        req.addControl( ctrl );

        OperationManager operationManager = directoryService.getOperationManager();
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.controls.SortKey

            req.setScope( SearchScope.SUBTREE );
            req.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
            // the ENTRY_DN_AT must be in the attribute list, otherwise sorting fails
            req.addAttributes( SchemaConstants.ENTRY_DN_AT );

            SortKey sk = new SortKey( SchemaConstants.ENTRY_DN_AT, "2.5.13.1" );

            SortRequest ctrl = new SortRequestControlImpl();
            ctrl.addSortKey( sk );
            req.addControl( ctrl );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.