Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » A selection model that preserves selection during resort?
A selection model that preserves selection during resort? [message #1334044] Mon, 05 May 2014 11:09 Go to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Using org.eclipse.nebula.widgets.nattable.selection.SelectionModel causes the wrong cells to be selected after a sort. org.eclipse.nebula.widgets.nattable.selection.RowSelectionPreserver is depreacated and says that one should use org.eclipse.nebula.widgets.nattable.selection.RowSelectionModel to preserve the selected row when the underlying data changes or column is sorted.

However RowSelectionModel does not fit the bill if you want to be able to select individual cells, rather than complete rows. So a new variant of org.eclipse.nebula.widgets.nattable.selection.SelectionModel is needed that remembers which cells on which rows are selected, so that the selection is still valid after a sort.

Is there such a sort model? Is it a bug that SelectionModel does not preserve selection on sort? Should SelectionModel be modified or should a new selection model be created (RowPreserveringSelectionModel<R>)?
Re: A selection model that preserves selection during resort? [message #1334252 is a reply to message #1334044] Mon, 05 May 2014 13:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Hi,

Quote:
Is there such a sort model?


None I am aware of.

Quote:
Is it a bug that SelectionModel does not preserve selection on sort?


No. If you take a look at the RowSelectionModel you will find out that the selection can be preserved because it is possible to identify the row via id and therefore the selection can be set after reordering. For a single cell there is no such id in the current architecture. On sort you are changing the structure, and therefore the cell that was selected before is now at another position. We will see how we can solve this in the next architecture.

Quote:
Should SelectionModel be modified or should a new selection model be created?


That depends on the solution you will find. Smile
If you find a solution that does the trick in the current architecture and is generic enough to work in all the different scenarios, go ahead and contribute. I would love to see such a SelectionModel.
If you find a solution that works in your case but not in other scenarios it would be better to create a new one. If it works fine you can also contribute so others can use it too.

I'm not sure if this is what you are searching for, but in this topic there was some discussion about the selection removal on structural changes and how to avoid that. But probably this is not what you are searching for, as you want the selection to move with the sorting and you don't have the issue that the selection disappears as far as I understand.

http://www.eclipse.org/forums/index.php/t/457074/feed.php?mode=m&th=457074&basic=1

Greez,
Dirk
Re: A selection model that preserves selection during resort? [message #1343062 is a reply to message #1334252] Fri, 09 May 2014 05:59 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
We have created a selection model (org.eclipse.nebula.widgets.nattable.selection.ISelectionModel) which preserves the selection of a specific row after the sort order has changed.

But our problem is now with the tabulate order of the table. The Selection Layer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) has a selection anchor and a last selected cell, these are only based on simple coordinates and are constructed outside the sort model. And therefore are not preserved, thus when you tab, you end up on the pre-sort row position.

We have confirmed that this problem still exist if we use the built-in row selection model (org.eclipse.nebula.widgets.nattable.selection.RowSelectionModel), which is row-id bound.

Is this a known bug and in the pipe to get fixed?
Is there any idea of a workaround?

One idea of a solution could be to move the responsibilty of managing and owning the anchor/lastSelectedCell from the selection layer into ISelectionModel.
This is not our workaround, and we cant really see any workarounds.

[Updated on: Fri, 09 May 2014 06:00]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1343292 is a reply to message #1343062] Fri, 09 May 2014 08:13 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Quote:
Is this a known bug and in the pipe to get fixed?


No it is not a known bug and therefore not in any pipe.

Also note that we just released 1.1 http://www.eclipse.org/forums/index.php/t/725979/

Quote:
One idea of a solution could be to move the responsibilty of managing and owning the anchor/lastSelectedCell from the selection layer into ISelectionModel.


That would mean to change the API of ISelectionModel, which I don't would like to see because of the state of NatTable 1.x architecture.

Quote:
Is there any idea of a workaround?


Not sure at the moment as it doesn't seem to be trivial. We would need to investigate further on that, but we first would need to set the priority for such an issue. Check our post for the 1.1 release to get sure about our priorities and how you could convince us to change our priorities.
Re: A selection model that preserves selection during resort? [message #1343731 is a reply to message #1343292] Fri, 09 May 2014 12:32 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
We can't find any discussion on priorities or on the topic on how we can convince you. Can you direct us to where that is discussed?

Do you think this is a bug? Should we report it as a bug? If so, where? What priority should we give that bug if we report it?

We have another proposal:
1. Add new interface

  /**
   * Selection model that holds two pieces of anchor: the selection anchor and last
   * selected cell, in order to correct them after the sort order of the underlying data has changed.
   */
  public interface IAnchorSelectionModel extends ISelectionModel {
    /**
     * Retrieves the position coordinates of selectionAnchor
     */
    PositionCoordinate getSelectionAnchor();

    /**
     * Retrieves the position coordinates of the last selected cell
     */
    PositionCoordinate getLastSelectedCell();

    /**
     * Corrects the coordinates of the selection anchor and the last
     * selected cell. Takes resorting into account, by finding the new
     * coordinates depending on stored ID:s
     */
    void updateAnchors();
  }

2. Modify SelectionLayer doCommand(ILayerCommand) to update the anchors upon StructuralRefreshCommand and VisualRefreshCommand:

  @Override
  public boolean doCommand(ILayerCommand command) {
    ....
    } else if (command instanceof StructuralRefreshCommand && command.convertToTargetLayer(this)) {
      if(selectionModel instanceof IAnchorSelectionModel) {
        ((IAnchorSelectionModel) selectionModel).updateAnchors();
      }
    } else if (command instanceof VisualRefreshCommand && command.convertToTargetLayer(this)) {
      if(selectionModel instanceof IAnchorSelectionModel) {
        ((IAnchorSelectionModel) selectionModel).updateAnchors();
      }
    }
    return super.doCommand(command);
  }

3. Modify SelectionLayer constructor:

  public SelectionLayer(IUniqueIndexLayer underlyingLayer, ISelectionModel selectionModel,
     boolean useDefaultConfiguration, boolean registerDefaultEventHandler) {
         .....
         this.selectionModel = selectionModel != null ? selectionModel : new SelectionModel(this);
         if(selectionModel instanceof IAnchorSelectionModel) {
           lastSelectedCell = ((IAnchorSelectionModel) selectionModel).getLastSelectedCell();
           selectionAnchor = ((IAnchorSelectionModel) selectionModel).getSelectionAnchor();
         } else {
           lastSelectedCell = new PositionCoordinate(this, NO_SELECTION, NO_SELECTION);
           selectionAnchor = new PositionCoordinate(this, NO_SELECTION, NO_SELECTION);
         }
         .....
       }


We are happy to implement and contribute this to version 1.1.x. We know this will not affect any existing code since our proposal effectively adds a new mode to SelectionLayer, and the existing uses of SelectionLayer will still use the old mode.


Re: A selection model that preserves selection during resort? [message #1343914 is a reply to message #1343731] Fri, 09 May 2014 14:17 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Quote:
We have another proposal:


Oh, scratch the details of that proposal; we found some issues with it. Currently redrafting it; we intend to get back with a revised proposal next week. But, please do answer the following questions:

Quote:
We can't find any discussion on priorities or on the topic on how we can convince you. Can you direct us to where that is discussed?

Do you think this is a bug? Should we report it as a bug? If so, where? What priority should we give that bug if we report it?

Re: A selection model that preserves selection during resort? [message #1344085 is a reply to message #1343914] Fri, 09 May 2014 15:57 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Hi,

You have either the choice to let me take a look at this in detail and implement some solution. But as I'm a consultant and we said that 1.x is frozen, I would ask for sponsoring.

The other way is the way you seem to have chosen already. Implement a suitable solution and contribute. Smile
I have written a contribution guide to help you with this. Please check our website.

In short, file a bug via Bugzilla, implement a solution and contribute via Gerrit so I can review it. If your patch is OK I will pull it to the NatTable repo and you will at least have a working snapshot until we think about a bug fix release.

Of course I am happy to help with the contribution! Just take care about backwards compatibility and feel free to ask any questions.

Greez,
Dirk
Re: A selection model that preserves selection during resort? [message #1349241 is a reply to message #1344085] Mon, 12 May 2014 05:45 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
(removing duplicate post)

[Updated on: Mon, 12 May 2014 06:57]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1349359 is a reply to message #1349241] Mon, 12 May 2014 06:54 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
(removing duplicate post)

[Updated on: Mon, 12 May 2014 06:57]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1349368 is a reply to message #1334044] Mon, 12 May 2014 06:56 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk Fauth wrote on Fri, 09 May 2014 11:57

Hi,
Implement a suitable solution and contribute. Smile
I have written a contribution guide to help you with this. Please check our website.

In short, file a bug via Bugzilla, implement a solution and contribute via Gerrit so I can review it. If your patch is OK I will pull it to the NatTable repo and you will at least have a working snapshot until we think about a bug fix release.


Great, I will do so. Which web site is that? There are a few. Where is the contribution gude? I found a nebula contribution guide (https://wiki.eclipse.org/Nebula/Contributions), but no nattable contribution guide. It is a bit unclear (is it the same eg?). Do you have a link to the website and do you have a link to the nattable contribution guide?

I searched for 'contribution guide' on http://www.eclipse.org/nattable/ ...
Re: A selection model that preserves selection during resort? [message #1349512 is a reply to message #1349368] Mon, 12 May 2014 08:18 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
It can be found on the NatTable website in the documentation section.

http://www.eclipse.org/nattable/documentation.php?page=contribution_guide
Re: A selection model that preserves selection during resort? [message #1351675 is a reply to message #1349512] Tue, 13 May 2014 05:40 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
BTW: I created an error report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=434608
Re: A selection model that preserves selection during resort? [message #1357247 is a reply to message #1351675] Thu, 15 May 2014 12:35 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Hello Markus,

what is the status of your proposal/workaround? I'm facing a similar problem in my project. The requirement is to preserve the selected cells through the following operations:

- sorting
- filtering
- tree node collapse/expand
- columng group collapse/expand

Losing the selection of any cell is only allowed if the cell is no more visible (lays whitin a collapsed row/column or filtered out).

What was the problem with your proposal in the above post?

thanks,
Istvan

[Updated on: Thu, 15 May 2014 12:36]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1366915 is a reply to message #1357247] Mon, 19 May 2014 14:41 Go to previous messageGo to next message
Jonas Hugo is currently offline Jonas HugoFriend
Messages: 7
Registered: May 2014
Junior Member
This is now our suggestion to a solution to the anchor/lastSelectedCell problem.

Dirk would you please review are ideas on a solution to the anchor problem after sort.
To clarify our problem see image: index.php/fa/18121/0/

Introduction of a new Interface: IAnchorSelectionModel extends ISelectionModel (See attached UML)
index.php/fa/18120/0/
To support new sorted positions of the anchors (Normal Anchor and LastSelectedCell).
This interface is optional. When it exists, SelectionLayer will go in to a different "mode".

SelectionLayer to be Modified: (Se attached Pseudo-UML)
For methods that modify the anchor/lastSelectedCell: if selectionModel is of type IAnchorSelectionModel then update models anchors (updateAnchor, updateLastSelected)
When Table gets a Refresh command: if selectionModel is of type IAnchorSelectionModel then fetch real anchor positions from IAnchorSelectionModel. (getAnchor, getLastSelected)

We have not succeeded in listening on the refresh command/event (VisualRefreshCommand) from the SelectionLayer. Do you have a suggestion on how to do that?
Our idea is to only request the anchor's real row-position when the data has changed in the table (sort/ filter/ data-modification)
  • Attachment: IMAG0194.jpg
    (Size: 69.04KB, Downloaded 252 times)
  • Attachment: IMAG0195.jpg
    (Size: 58.04KB, Downloaded 248 times)

[Updated on: Wed, 21 May 2014 06:56]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1366916 is a reply to message #1357247] Mon, 19 May 2014 14:43 Go to previous messageGo to next message
Jonas Hugo is currently offline Jonas HugoFriend
Messages: 7
Registered: May 2014
Junior Member
Istvan Meszaros wrote on Thu, 15 May 2014 08:35

what is the status of your proposal/workaround? I'm facing a similar problem in my project. The requirement is to preserve the selected cells through the following operations:

- sorting
- filtering
- tree node collapse/expand
- columng group collapse/expand


Our selection model implementation is only designed for the resorting of rows. So it will support sorting and filtering, but not, we think, tree node collapse or columng group collapse.


Istvan Meszaros wrote on Thu, 15 May 2014 08:35

What was the problem with your proposal in the above post?


We had no problems in implementing a row sort selection model (that allows for indivdual cells of each row to be selected), but the anchor and last selected cell properties of SelectionLayer were coordinate based and managed by SelectionLayer rather than row ID based and managed by the selection model. Our solution proposal (posted just now, waiting moderation) modifies that.
Re: A selection model that preserves selection during resort? [message #1368570 is a reply to message #1366916] Tue, 20 May 2014 07:16 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Nice idea, but I would modify it a bit for a better API and understandable process. This has of course impact on the API, but in that case it seems to me better.

Try the following:

1. Change the visibility of lastSelectedCell, selectionAnchor, lastSelectedRegion from protected to private
2. Update every reference (in SelectionLayer and other selection related classes) to the corresponding getters (which is a way better API than directly operating on the members themselves)
3. In case the ISelectionModel is of type IAnchorSelectionModel, the getters will return the values from there instead of the local members.

I haven't tested this, but for me this seems to be a better approach than listening to various events and call an update.

In terms of backwards compatibility maybe we should not change the visibility of the fields in the end, as there are users out there that extended SelectionLayer and an API change would cause a minor release instead of a bugfix release. But to find the necessary places to change the implementation, it might be a good way to start and to be sure nothing is missed.

Greez,
Dirk

P.S. could you please try to configure the images so they are not expanding the whole page?
Re: A selection model that preserves selection during resort? [message #1371297 is a reply to message #1366915] Wed, 21 May 2014 09:55 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Hello Jonas,

thanks for the info!

Jonas Hugo wrote on Mon, 19 May 2014 10:41
We have not succeeded in listening on the refresh command/event (VisualRefreshCommand) from the SelectionLayer. Do you have a suggestion on how to do that?
Our idea is to only request the anchor's real row-position when the data has changed in the table (sort/ filter/ data-modification)


I tried to look after this problem earlier and i bumped into the same problem. My thinking was the following:

If i had a way to capture the event when the structure of rows/columns is about to change, i could record the coordinates of selected cells in "domain measures" like the domain object and column names.

Then i would catch the event that is fired after the structural change was done, and based on the recorded coordinates i would restore the cell selection.
Re: A selection model that preserves selection during resort? [message #1373696 is a reply to message #1371297] Thu, 22 May 2014 09:29 Go to previous messageGo to next message
Jonas Hugo is currently offline Jonas HugoFriend
Messages: 7
Registered: May 2014
Junior Member
Your solution is clearly a better one. We have tried it and it works good.

So we have now cloned the NatTable repo from git, according to the contribution-guide.
And started to implement a patch with the real solution.

We have a question about source-code formatter. Which one should we use, we can't find one that matches the code that's already in the repo?

/ Jonas & Markus

[Updated on: Thu, 22 May 2014 09:33]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1373714 is a reply to message #1373696] Thu, 22 May 2014 09:38 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Hello Jonas,

i'm glad to hear you like my idea Smile although unfortunately i could not yet implement it myself.

Looking forward to your patch! Smile

thanks,
Istvan
Re: A selection model that preserves selection during resort? [message #1373777 is a reply to message #1373714] Thu, 22 May 2014 10:14 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Quote:
We have a question about source-code formatter. Which one should we use, we can't find one that matches the code that's already in the repo?


The source code formatter that is added is outdated for a while. And I hadn't got time to create a new one and reformat everything. So simply skip the automatic formatting and try to format the code that it looks readable. Smile

I will need to create and apply a formatter in the future.

When using Gerrit you will see in the review the differences. If you see differences that are only formatting differences, try to avoid them, like trailing whitespaces, new lines and such things.

Sorry for that, but there is too much other work.
Re: A selection model that preserves selection during resort? [message #1373924 is a reply to message #1373777] Thu, 22 May 2014 11:37 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Istvan Meszaros wrote on Thu, 22 May 2014 05:38

i'm glad to hear you like my idea Smile although unfortunately i could not yet implement it myself.


No, that is not what Jonas and I intended with our last comment here. Instead we referred to the inspection comment from Dirk. (Istvan: We have not (not yet) analyzed your problem or solution.)
Re: A selection model that preserves selection during resort? [message #1373950 is a reply to message #1373924] Thu, 22 May 2014 11:52 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Oh, i see! But Jonas replied directly to my comment.. Sorry for the misunderstanding Smile
Re: A selection model that preserves selection during resort? [message #1383648 is a reply to message #1373950] Mon, 26 May 2014 13:16 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk, will you please review our contribution?
https://git.eclipse.org/r/27287

best regards, Jonas & Markus

BTW we gave the new interface another, better, name: IMarkerSelectionModel instead of IAnchorSelectionModel.
Re: A selection model that preserves selection during resort? [message #1383915 is a reply to message #1383648] Tue, 27 May 2014 07:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
That's great! I will check the contribution the next days. What I have seen already is that you have some trailing whitespaces in the code. AFAIK this is because of a bug in Kepler where there is a trailing whitespace added in Javadoc for empty lines. It should be fixed in Luna. It would be nice if you could fix that.

Did you commit via EGit or via command line? I thought I added .gitattributes to handle the trailing whitespaces. But maybe they only handle the line separators. Not sure, but you should be able to let Git handle the trailing whitespaces.

You can see this when checking the differences in Gerrit.
Re: A selection model that preserves selection during resort? [message #1383922 is a reply to message #1383915] Tue, 27 May 2014 08:37 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Hello Markus and Jonas,

i tested your solution, it works perfectly for me and solves all of my problems too. Thanks for your contribution!
Re: A selection model that preserves selection during resort? [message #1383925 is a reply to message #1383915] Tue, 27 May 2014 08:42 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk Fauth wrote on Tue, 27 May 2014 03:50
That's great! I will check the contribution the next days.

Good!

Dirk Fauth wrote on Tue, 27 May 2014 03:50
What I have seen already is that you have some trailing whitespaces in the code.

I will fix it. I understand that the best way is to amend the contribution with a patch set (?).

Dirk Fauth wrote on Tue, 27 May 2014 03:50
Did you commit via EGit or via command line?

We did it using command line git.
Re: A selection model that preserves selection during resort? [message #1383927 is a reply to message #1383925] Tue, 27 May 2014 08:59 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Markus Wahl wrote on Tue, 27 May 2014 04:42

Dirk Fauth wrote on Tue, 27 May 2014 03:50
What I have seen already is that you have some trailing whitespaces in the code.

I will fix it. I understand that the best way is to amend the contribution with a patch set (?).


But I am uncertain on how to do that. https://git.eclipse.org/r/27287 does contain some links to the patch set:


  1. checkout: git fetch git://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable refs/changes/87/27287/1 && git checkout FETCH_HEAD
  2. pull: git pull git://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable refs/changes/87/27287/1
  3. cherry-pick: git fetch git://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable refs/changes/87/27287/1 && git cherry-pick FETCH_HEAD
  4. patch: git fetch git://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable refs/changes/87/27287/1 && git format-patch -1 --stdout FETCH_HEAD


But none of these works without an existing local git clone. Should I create a fresh clone from ssh://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable.git using:
git clone ssh://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable.git
and then apply the pull command on that?

[Updated on: Tue, 27 May 2014 09:02]

Report message to a moderator

Re: A selection model that preserves selection during resort? [message #1383932 is a reply to message #1383927] Tue, 27 May 2014 09:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
You can simply work on the checked out code and use amend to your last commit. This way the same commit id is used and the patch will be added as new patch set to the existing Gerrit ticket.
Re: A selection model that preserves selection during resort? [message #1383964 is a reply to message #1383932] Tue, 27 May 2014 13:43 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
OK, trailing spaces removed now (in patch set 2)!
Re: A selection model that preserves selection during resort? [message #1385090 is a reply to message #1383964] Wed, 04 June 2014 09:37 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk, we have amended with a patch set 3 were we have corrected according some of the review comments. We would like some clarification on two of the review comments though, before correcting them as well. Please see the comment section on https://git.eclipse.org/r/27287

Best regards,
Markus
Re: A selection model that preserves selection during resort? [message #1385096 is a reply to message #1385090] Wed, 04 June 2014 10:10 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
Sorry, I'm quite busy at the moment.

No you don't need to create Javadoc for overridden methods. Although I'm glad if users also contribute missing Javadoc if the overridden method is not yet documented.

About the package name. IMHO it should be more general and point to what it does, not for which purpose it is used. Maybe something like statefull, persisted or preserved (as the selection is a state that is preserved on table state changes).

This would also allow to enhance your solution for filtering, which shouldn't be a big deal from what you already have.
Re: A selection model that preserves selection during resort? [message #1385263 is a reply to message #1385096] Thu, 05 June 2014 09:37 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk Fauth wrote on Wed, 04 June 2014 06:10
No you don't need to create Javadoc for overridden methods. Although I'm glad if users also contribute missing Javadoc if the overridden method is not yet documented.


Done: we documented most of the methods in ISelectionModel in patch set 4.


Dirk Fauth wrote on Wed, 04 June 2014 06:10
About the package name. IMHO it should be more general and point to what it does, not for which purpose it is used. Maybe something like statefull, persisted or preserved (as the selection is a state that is preserved on table state changes).

This would also allow to enhance your solution for filtering, which shouldn't be a big deal from what you already have.


Done ("preserved" in name of package and selection model) in patch set 4.
Re: A selection model that preserves selection during resort? [message #1385269 is a reply to message #1385263] Thu, 05 June 2014 10:00 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
IMHO preserve sounds better as package name.

Sorry my fault in the above post. Auto correct on my mobile used the past form.
Re: A selection model that preserves selection during resort? [message #1385542 is a reply to message #1385269] Mon, 09 June 2014 07:44 Go to previous messageGo to next message
Markus Wahl is currently offline Markus WahlFriend
Messages: 16
Registered: May 2014
Junior Member
Dirk Fauth wrote on Thu, 05 June 2014 06:00
preserve sounds better


Fixed in patch set 5!
Re: A selection model that preserves selection during resort? [message #1391096 is a reply to message #1385542] Mon, 30 June 2014 12:43 Go to previous messageGo to next message
Jonas Hugo is currently offline Jonas HugoFriend
Messages: 7
Registered: May 2014
Junior Member
Dirk, thank you for assistance.
Do you know the version number of NatTable which will contain this fix?
Do you have an ETA for that release?
Re: A selection model that preserves selection during resort? [message #1391235 is a reply to message #1391096] Mon, 30 June 2014 16:23 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
I thought of a bugfix release 1.1.1 in the next weeks. Not sure when I will have time to do that. Also I wanted to fix two issues that where reported for 1.1.0 before doing a release.

That should answer your second question, no I don't have an ETA for the bugfix release.
Re: A selection model that preserves selection during resort? [message #1419943 is a reply to message #1391235] Tue, 09 September 2014 09:22 Go to previous messageGo to next message
Jonas Hugo is currently offline Jonas HugoFriend
Messages: 7
Registered: May 2014
Junior Member
Hi Dirk, has there been any updates on an estimated date for the 1.1.1 release?
Re: A selection model that preserves selection during resort? [message #1419965 is a reply to message #1419943] Tue, 09 September 2014 10:02 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
I'm still waiting for a contribution fix. If it is not done by the contributor I will try to fix it myself to get 1.1.1 out until next week.
Re: A selection model that preserves selection during resort? [message #1460477 is a reply to message #1419965] Mon, 03 November 2014 16:04 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Hello all,

there may be a bug in PreserverSelectionModel. For the odd behavior, see the following video:
https://www.youtube.com/watch?v=hW_jpGu-NSM

It's easy to reproduce, modify the example "org.eclipse.nebula.widgets.nattable.examples.examples._120_Selection.Get_and_set_selected_objects" by setting the selection model after creating DefaultGridLayer:

        DefaultGridLayer gridLayer = new DefaultGridLayer(bodyDataProvider,
                new DefaultColumnHeaderDataProvider(propertyNames));

        gridLayer.getBodyLayer().getSelectionLayer().setSelectionModel(new PreserveSelectionModel<Person>(
                gridLayer.getBodyLayer().getSelectionLayer(), bodyDataProvider, new IRowIdAccessor<Person>() {

                    @Override
                    public Serializable getRowId(Person rowObject) {
                        return rowObject.getSerialNumber();
                    }
                }));

        NatTable natTable = new NatTable(parent, gridLayer);


Is this really a bug, or do i need to further configure PreserveSelectionModel to work properly?

Thanks in advance!
Re: A selection model that preserves selection during resort? [message #1460569 is a reply to message #1460477] Mon, 03 November 2014 18:02 Go to previous messageGo to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1436
Registered: July 2012
Senior Member
I don't know. Do you use only dragging or are there key modifiers involved? Only showing that video is not much help in reproducing the issue.
Previous Topic:How to change the cell background color?
Next Topic:Radio Buttons in Nattable
Goto Forum:
  


Current Time: Sat Dec 27 00:17:22 GMT 2014

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

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