[EEF] Selecting wrapped item providers in the tree [message #822547] |
Fri, 16 March 2012 23:01 |
Olivier Labrosse Messages: 49 Registered: November 2011 |
Member |
|
|
Hi,
Our EEF editor makes use of wrapping in order to display the same EObjects under different branches of the tree.
Our first implementation had the problem of never displaying anything in the Details pane when selecting wrapped item providers. To resolve this, we made use of a custom TreeViewer where getSelection() is overridden and unwraps the selection unless we're in the middle of a preservingSelection() execution (using a custom flag to determine this).
This has been working great... until now, as we're noticing side-effects: drag and drop of wrapped items is buggy due to the unwrapped selection found in the event, which makes it impossible to match the selection (or "collection" as it is called in the command) to the wrapped children of our transient item providers. Impossible unless we extend DragAndDropCommand and override getChildren() to make sure it unwraps the children accordingly.
Is this the right way to go? I have a feeling I'm missing something, and I'm hoping someone can give me pointers in the case I'm off-track.
Thanks in advance for your support!
-Olivier
[Updated on: Mon, 19 March 2012 16:18] Report message to a moderator
|
|
|
Re: [EEF] Selecting wrapped item providers in the tree [message #830314 is a reply to message #822547] |
Tue, 27 March 2012 13:18 |
Stephane Bouchet Messages: 280 Registered: July 2009 |
Senior Member |
|
|
hi olivier,
The EEF editor is re-using a lot from the basic EMF editor, we just
enhance the property display of the selected objetcs.
what you are facing seems more related to EMF generally, i let other
people on this forums to help you.
You can try to do the same ( displaying same eobjects on different
branches ) just with the default EMF editor, and see what happens.
then we can try to help to integrate smoothly your developments in the
EEF editor.
Le 17/03/2012 00:01, Olivier Labrosse a écrit :
> Hi,
>
> Our EEF editor makes use of wrapping in order to display the same
> EObjects under different branches of the tree.
>
> Our first implementation had the problem of never displaying anything in
> the Details pane when selecting wrapped item providers. To resolve this,
> we made use of a custom TreeViewer where getSelection() is overridden
> and unwraps the selection unless we're in the middle of a
> preservingSelection() execution (using a custom flag to determine this).
>
> This has been working great until now, as we're noticing side-effects:
> drag and drop of wrapped items is buggy due to the unwrapped selection
> found in the event, which makes it impossible to match the selection (or
> "collection" as it is called in the command) to the wrapped children of
> our transient item providers. Impossible unless we extend
> DragAndDropCommand and override getChildren() to make sure it unwraps
> the children accordingly.
>
> Is this the right way to go? I have a feeling I'm missing something, and
> I'm hoping someone can give me pointers in the case I'm off-track.
>
> Thanks in advance for your support!
>
> -Olivier
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Re: [EEF] Selecting wrapped item providers in the tree [message #830419 is a reply to message #830314] |
Tue, 27 March 2012 15:47 |
Olivier Labrosse Messages: 49 Registered: November 2011 |
Member |
|
|
Thank you Stephane for your feedback.
You just reminded me of something I should have mentioned before: I don't believe it is normal to have to customize the TreeViewer to unwrap items for the EEFDetailsPage.
Having said that, I just now tried removing my TreeViewer customization and instead overriding some of the EEFDetailsPage code, and it fixed the problem I had with drag & drop. No more pre-unwrapping by the TreeViewer, which means I'm correctly dragging DelegatingWrapperItemProvider instances.
I will now post a bug report in Bugzilla with notes on how I fixed it.
Thanks again!
-Olivier
Stephane Bouchet wrote on Tue, 27 March 2012 09:18hi olivier,
The EEF editor is re-using a lot from the basic EMF editor, we just
enhance the property display of the selected objetcs.
what you are facing seems more related to EMF generally, i let other
people on this forums to help you.
You can try to do the same ( displaying same eobjects on different
branches ) just with the default EMF editor, and see what happens.
then we can try to help to integrate smoothly your developments in the
EEF editor.
Le 17/03/2012 00:01, Olivier Labrosse a écrit :
> Hi,
>
> Our EEF editor makes use of wrapping in order to display the same
> EObjects under different branches of the tree.
>
> Our first implementation had the problem of never displaying anything in
> the Details pane when selecting wrapped item providers. To resolve this,
> we made use of a custom TreeViewer where getSelection() is overridden
> and unwraps the selection unless we're in the middle of a
> preservingSelection() execution (using a custom flag to determine this).
>
> This has been working great until now, as we're noticing side-effects:
> drag and drop of wrapped items is buggy due to the unwrapped selection
> found in the event, which makes it impossible to match the selection (or
> "collection" as it is called in the command) to the wrapped children of
> our transient item providers. Impossible unless we extend
> DragAndDropCommand and override getChildren() to make sure it unwraps
> the children accordingly.
>
> Is this the right way to go? I have a feeling I'm missing something, and
> I'm hoping someone can give me pointers in the case I'm off-track.
>
> Thanks in advance for your support!
>
> -Olivier
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03283 seconds