eas of sorting Interface

KDTable itself does not currently support sorting functionality, but provides the sort of interface, users can achieve the sort function by implementing this interface (ISortManager). At the same time provides a simple implementation KDTable KDTSortManager, class completed row of display capable of recording sequences, and automatically adjust the header (e.g., up or down arrow on the display), the user simply extend and override the class methods, i.e. You may complete implementation of sorting.
Example
 SM = new new KDTSortManager (Table)
 {
     public void Sort (colIndex, int, int SortType)
     {
        super.sort (colIndex,, SortType);
        IF (SortType == KDTSortManager.SORT_ASCEND)
        {
            // the TODO: Action do your here Wallpaper
            the System.out .println ( "COL:" + + colIndex, "the ASCEND");
        }
        the else
        {
            // the TODO: Action here Wallpaper do your
            System.out.println ( "COL:" + + colIndex, "DESCEND");
        }
     }
 };
 this.table.addKDTMouseListener(new KDTMouseListener()
 {
     public void tableClicked(KDTMouseEvent e)
     {
        if (e.getClickCount() == 2)
        {
            sm.sort(e.getColIndex());
        }
     }
});

Guess you like

Origin www.cnblogs.com/luojiabao/p/10964416.html
EAS