Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6309686

Specification for javax.swing.DefaultRowSorter is not clear enough

XMLWordPrintable

    • b53
    • generic
    • generic

      1) In the class description there is written:
       "*If the underlying model structure changes (the modelStructureChanged method is invoked) the following are reset to their default values: Comparators by column, current sort order, and whether each column is sortable.* To find the default Comparators, see the concrete implementation (for example, TableRowSorter). The default sort order is unsorted (the same as the model), and columns are sortable by default.

      *If the underlying model structure changes (the modelStructureChanged method is invoked) the following are reset to their default values: Comparators by column, current sort order and whether a column is sortable.*"
        - the sentence is repeated.

      2) In the class description there is written:
       "Sorting is done by way of a Comparator that you can specify using the setComparator method. If a Comparator has not been specified a Collator is used on the results of calling toString on the underlying objects."

      The similar situation is in TableRowSorte:
      "5.Otherwise use a Collator on the results from calling toString on the objects."

       -The question is: what Collator is used by default? From src code it is clear, that Collator.getInstance() is used. It would be nice to indicate.
       It is also would be desirable to note, that null can't be returned by method getComparator().

      3) Method useToString(int column):
       It would be nice to note that under Model.getStringValueAt and Model.getValueAt is implied DefaultRowSorter.Model implementation which is returned by getModel() method.

      4) Method sort():
      It is not specified how *null* is sorting by this method?

            svioletsunw Scott Violet (Inactive)
            ynovozhi Yulia Novozhilova (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: