Community
Participate
Working Groups
I'm currently implementing context menu actions in EGit change set model. I would like to have dynamically build context menu based on kind of selected element therefore I use SynchronizePageActionGroup.fillContextMenu() where using getContext().getSelection() I can obtain selected element in synchronize view. Here is my test structure of elements in view: |- GitModelWorking Tree | |- GitModelCacheTree |- GitModelCache | |- GitModelCacheTree(1) |- GitModelCommit | |- GitModelTree(2) |- GitModelCommit |- GitModelTree(3) Every thing works well until the GitModelCacheTree(1) have same name as GitModelTree(2) in this case if right mouse button click occurs on GitModelTree(2) framework returns instance of GitModelCacheTree(1) in getContext().getSeletion() which is a bug. Such situation doesn't occurs if every three elements (1, 2, 3) have same name and the third one was selected.
Have you tried creating your own view and adding the same set of elements to it? Will calling getContext().getSelection() then give you the same results? Why did you mark the bug as critical? Does it result loss of data when you execute an action on a bad selection?
Sorry for bothering you guys ... it appears that this was problem in my code. I didn't overwrite properly hashCode() and equals() methods.