Skip to main content

[FYI] Another go to make JXTableHeader/ColumnHeaderRenderer respect LF specifics

No replies
Anonymous

The issues concerned:

https://swingx.dev.java.net/issues/show_bug.cgi?id=193
https://jdnc.dev.java.net/issues/show_bug.cgi?id=169

Well, ehem, I promised to not touch it again (after all, Mustang will
handle it once we switch to a 1.6-targeted version of swingx) - but
recently I wanted to show-off a bit with how snuggly SwingX can look and
feel and draw sneers ("hooo-booo - the XP-rollover is missing, typical
java" etc etc...)

So I tried to track the issue. At it's base is a certain suboptimal (but
probably nothing that can be changed) behaviour in XP where the ui
delegate installs a custom per-header-instance renderer to enable the
rollover effects. In these delegates, the default renderer as defined by
tableHeader.createDefaultRenderer is replaced. (the suboptimal is
twofold: a) default renderer creation is smeared over several places and
b) the default renderer is no longer shareable)

As a consequence, the columnHeaderRenderer - which provides the
sort-icons - has to be wrapped around the per-instance ui default
renderer. This is now done in tableHeader.updateUI. The wrapping needs
to be renewed after each super.updateUI. Unfortunately, that's not
enough: to guarantee proper cleanup by the ui delegate, the wrapped
renderer needs to be restored _before_ calling super.updateUI

It's a potentially risky change - so the before/afer versions of
header/renderer are tagged. Tests are passing, though, and the LF
switching demo doesn't seem to bark. Please let me know if there are any
unexpected [*] issues introduced by this - how's the behaviour in Mac?

[*] I might expect problems when using the ColumnHeaderRenderer on a
per-column basis (f.i for custom alignment) - because I did nothing to
verify that these aren't effected ;-)

Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net