Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EEF] Selecting wrapped item providers in the tree
[EEF] Selecting wrapped item providers in the tree [message #822547] Fri, 16 March 2012 19:01 Go to next message
Eclipse UserFriend
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 12:18] by Moderator

Re: [EEF] Selecting wrapped item providers in the tree [message #830314 is a reply to message #822547] Tue, 27 March 2012 09:18 Go to previous messageGo to next message
Eclipse UserFriend
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 11:47 Go to previous messageGo to next message
Eclipse UserFriend
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:18
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 #830429 is a reply to message #830419] Tue, 27 March 2012 12:05 Go to previous messageGo to next message
Eclipse UserFriend
For future reference, the bug report ID is 375440.

Sorry I can't post a direct link, there's a requirement of 25 messages posted before we can post links.
Re: [EEF] Selecting wrapped item providers in the tree [message #830948 is a reply to message #830429] Wed, 28 March 2012 04:56 Go to previous message
Eclipse UserFriend
Le 27/03/2012 18:05, Olivier Labrosse a écrit :
> Sorry I can't post a direct link, there's a requirement of 25 messages
> posted before we can post links.

no problem for that, i also follow the bugzilla's new bugs for EEF :)

--
Cheers,

Stéphane Bouchet, OBEO
Previous Topic:[EEF] Multiple Views for a Property Edition Element
Next Topic:[EEF] Master-Detail with subtypes
Goto Forum:
  


Current Time: Sat Jul 05 02:17:58 EDT 2025

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

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

Back to the top