multivalent.std

Class TableSort

public class TableSort extends Behavior

Sort structural table at given column, heuristically determining data type. Assume HTML/CALS-style table (row major; TABLE tag with THEAD, TBODYs, and TFOOT as children, and TRs as their children). Relies on HTML parser normalizing table by filling in cells not explicit in rowspan or colspan, though painting and formatting will still be weird if these are around. Unlike most behaviors, which work on all document types, TableSort works only on flowed documents.

To do: generalize to range of lines, as tables aren't used for tabular information much, as least in HTML.

Version: $Revision: 1.3 $ $Date: 2003/06/02 06:00:49 $

Field Summary
static StringMSG_ASCENDING
Sort table in ascending order.
static StringMSG_DESCENDING
Sort table in descending order.
static StringMSG_SORT
Sort table in ascending order, or reverse order if already sorted in ascending order.
Method Summary
booleansemanticEventAfter(SemanticEvent se, String msg)
booleansemanticEventBefore(SemanticEvent se, String msg)
Since not all man page references are recognizable as such, have docpopup choice to treat current word as man page ref.
voidsortTable(Object colin, int direction)

Field Detail

MSG_ASCENDING

public static final String MSG_ASCENDING
Sort table in ascending order.

"tableSortAscending": arg= Node column-to-sort

MSG_DESCENDING

public static final String MSG_DESCENDING
Sort table in descending order.

"tableSortDescending": arg= Node column-to-sort

MSG_SORT

public static final String MSG_SORT
Sort table in ascending order, or reverse order if already sorted in ascending order.

"tableSort": arg= Node column-to-sort

Method Detail

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se, String msg)

semanticEventBefore

public boolean semanticEventBefore(SemanticEvent se, String msg)
Since not all man page references are recognizable as such, have docpopup choice to treat current word as man page ref.

sortTable

public void sortTable(Object colin, int direction)

Parameters: colin some node within column to sort direction: -1=descending order, 1=ascending order, 0=ascending but descending if already in ascending.