org.cafesip.gwtcomp.client.utils
Class StringComparator
java.lang.Object
org.cafesip.gwtcomp.client.utils.StringComparator
- All Implemented Interfaces:
- java.util.Comparator<com.google.gwt.user.client.ui.Widget[]>
public class StringComparator
- extends java.lang.Object
- implements java.util.Comparator<com.google.gwt.user.client.ui.Widget[]>
A convenience class for the
SuperTableProperty. The SuperTable
supports sorting of columns but you have to provide the comparator. This is a
ready-made comparator class that you can use to compare columns that are of
the type GWT Label or HTML and needs a simple string comparison. The string
comparison is case-sensitive.
|
Constructor Summary |
StringComparator(int col,
boolean ascending)
A constructor for this class. |
|
Method Summary |
int |
compare(com.google.gwt.user.client.ui.Widget[] o1,
com.google.gwt.user.client.ui.Widget[] o2)
|
protected static java.lang.String |
convertToText(com.google.gwt.user.client.ui.Widget w)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
StringComparator
public StringComparator(int col,
boolean ascending)
- A constructor for this class.
- Parameters:
col - Specifies the column index in the table (whether it is column
0, 1 , 2 etc.)ascending - true if ascending comparator, false if this is a descending
comparator.
compare
public int compare(com.google.gwt.user.client.ui.Widget[] o1,
com.google.gwt.user.client.ui.Widget[] o2)
- Specified by:
compare in interface java.util.Comparator<com.google.gwt.user.client.ui.Widget[]>
convertToText
protected static java.lang.String convertToText(com.google.gwt.user.client.ui.Widget w)
http://www.cafesip.org