Some updates for any interested parties, as this is going to be a particularly long development cycle:
First, stupid training wheels stuff. JTables need to be put into a JScrollPane or they won't display the header row. That alone probably cost me almost an hour of headache.
Next, I originally thought I was going to have to rewrite LockableListModel, the basis on which
all of kol session data is stored. Screw that, I just used a lightweight adapter to go from ListModel -> TableModel. Cool beans, done.
I soon realized that the "easy" method of enabling column sorting -
Code:
this.setAutoCreateRowSorter(true)
..is a 1.6 method. Bah. Fortunately, we've already imported the library for doing the sorting in 1.5 and below. Took another hour or two to figure out how to implement that properly.
The
biggest headache so far was figuring out how to implement my own comparator. Basically: columns sort fine when they're just strings, or just integers, but (no-sell) mixed with (37 meat) means you need to write your own comparator. Everybody's idea of a good time, I know. 84 hours later, I've made it here:
http://i63.photobucket.com/albums/h139/roippi/koltable1.jpg
Still TODO:
-rewrite all the ContextMenuListeners to work with JTable interface
-yes, all 12 of them
-and the mouseadapter. and the keyadapter
-I think it should work fine with the filter once I add one, but haven't tested that yet
-figure out how to pull in ListCellRendererFactory. Not sure how I'm going to do this yet. Notably: without this, nothing gets colorized.
-final polish: column sizing/font justification/etc
I plan on eventually committing this as a DEBUG option so that source-builders can have a first crack at it. After that, I'll tie it to a preference and probably make it opt-out. I know there's going to be someone who will prefer the old style JLists.