Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Suggestion regarding ColumnHideShowLayer.saveState()
Suggestion regarding ColumnHideShowLayer.saveState() [message #1016545] Wed, 06 March 2013 20:47 Go to next message
Patrick Rusk is currently offline Patrick RuskFriend
Messages: 35
Registered: June 2012
In ColumnHideShowLayer, the implementation of {save,load}State() is as follows:
public void saveState(String prefix, Properties properties) {
    if (hiddenColumnIndexes.size() > 0) {
        StringBuilder strBuilder = new StringBuilder();
        for (Integer index : hiddenColumnIndexes) {
        properties.setProperty(prefix + PERSISTENCE_KEY_HIDDEN_COLUMN_INDEXES, strBuilder.toString());
    super.saveState(prefix, properties);

public void loadState(String prefix, Properties properties) {
    String property = properties.getProperty(prefix + PERSISTENCE_KEY_HIDDEN_COLUMN_INDEXES);
    if (property != null) {
        StringTokenizer tok = new StringTokenizer(property, ","); //$NON-NLS-1$
        while (tok.hasMoreTokens()) {
            String index = tok.nextToken();
    super.loadState(prefix, properties);

This has the effect of not saying anything about the visibility of columns unless at least one is hidden. I am finding this unfortunate, because I am implementing tabs along the bottom (like in Excel) for swapping between configurations. It works beautifully for most things, but not column visibility.

Actually, the sort settings have the same issue. If there is no sort, no property is written out regarding sorts.

It's as though when saving the state of a grid with no hidden or sorted columns, it is saying, "I don't know whether any columns were hidden or sorted, go with what you currently have". I think it would be better for it to say -- via empty properties -- "I can affirm that when this was saved, there were no hidden or sorted columns".
Re: Suggestion regarding ColumnHideShowLayer.saveState() [message #1016553 is a reply to message #1016545] Wed, 06 March 2013 21:18 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2772
Registered: July 2012
Senior Member
Previous Topic:want two TreeCheckBoxPainters in a single cell
Next Topic:Implementing IUniqueIndexLayer by a CompositeLayer
Goto Forum:

Current Time: Thu Jan 23 04:22:45 GMT 2020

Powered by FUDForum. Page generated in 0.02728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top