Skip to main content

Preserve ColumnControl settings

6 replies [Last post]
szd116
Offline
Joined: 2012-01-05
Points: 0

Hello everyone,
any idea on how to preserve columnCoontrol settings ? for example, if I unchecked a few columns from the column control and exit out, the next time when I bring up the app, how can the columns remain unchecked/hidden ?

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
szd116
Offline
Joined: 2012-01-05
Points: 0

I tried to serialize the object to my hard disk and here's what i'm getting:

writing aborted; java.io.NotSerializableException: org.jdesktop.swingx.decorator.CompoundHighlighter

If I change JXtable to Jtable everything works and the preference gets preserved very well.
Any ideas ?

Thank you.

szd116
Offline
Joined: 2012-01-05
Points: 0

since then i haven been trying to serialize tableModel, columnTableModel and ColumnControlButton none worked. So looks like swingX doesn't support serialization very well. can someone provide a different approach to preserve settings for ColumnControl ?

Thank you.

martinm1000
Offline
Joined: 2003-06-12
Points: 0

I think there was something called XProperties for JXTable and its columns. I'm not sure of the state of that code, but I will have to implement it soon, my users also want better column control visibility and save/restore.

kleopatra
Offline
Joined: 2003-06-11
Points: 0

thanks for jumping in (notification here is .... suboptimal)

The XProperties are in my incubator, in the appframework package/s and works in the context of saf/bsaf. It's not officially supported but reasonably stable (biased me :-)

Beware: as of jdk7 the XMLEncoder actually _is_ non-static, that is the comment of its essentially static scope is wrong. Note to myself: should update some day

Cheers
Jeanette

martinm1000
Offline
Joined: 2003-06-12
Points: 0

No problem. I just changed from the original AppFramework to BSAF 1.9, and I will try myself to make the column configuration save and restore with your code eventually. So what do you mean for jdk7 ? Will I get package names stuff in the XML or something like that ? Personally I prefer xstream for serialization, but its another library to bring along...

szd116
Offline
Joined: 2012-01-05
Points: 0

Thank you for the hint. I will look it up.