Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Select element in TreeMasterDetails View
[EMF Forms] Select element in TreeMasterDetails View [message #1723077] Thu, 11 February 2016 12:21 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 26
Registered: January 2016
Junior Member
Hi there,

we want to use the TreeMasterDetails view and add some selection behaviour:

1. Whenever the Selection in the ESelectionService has changed outside
the view, the tree will expand to the selected element and select that
element such that the details for that object get shown.

2. Vice Versa: Whenever an element in the Tree of the TreeMasterDetails
View is selected, the view should update the ESelectionService with that
element such that other views can get informed about the new selection.

Unfortunately EMF-Forms seems to have no API to work with selections. Is
that right? As a workaround we could search the SWT-Tree of the View
renderer itself and add listeners to that tree, however, that would
brake abstraction and does not work very nicely. The internal JFace tree
in the view would work on a higher abstraction level than the SWT tree
but is hidden in the internals of that renderer even deeper than the
SWTTree. So the SWT Tree is the only one we can get our fingers at.

Any idea about this use-case?

Cheers,
Hauke
Re: [EMF Forms] Select element in TreeMasterDetails View [message #1723151 is a reply to message #1723077] Fri, 12 February 2016 07:59 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

is the tree the top level element of your view?

Best regards

Jonas


Am 11.02.2016 um 13:21 schrieb Hauke Fuhrmann:
> Hi there,
>
> we want to use the TreeMasterDetails view and add some selection behaviour:
>
> 1. Whenever the Selection in the ESelectionService has changed outside
> the view, the tree will expand to the selected element and select that
> element such that the details for that object get shown.
>
> 2. Vice Versa: Whenever an element in the Tree of the TreeMasterDetails
> View is selected, the view should update the ESelectionService with that
> element such that other views can get informed about the new selection.
>
> Unfortunately EMF-Forms seems to have no API to work with selections. Is
> that right? As a workaround we could search the SWT-Tree of the View
> renderer itself and add listeners to that tree, however, that would
> brake abstraction and does not work very nicely. The internal JFace tree
> in the view would work on a higher abstraction level than the SWT tree
> but is hidden in the internals of that renderer even deeper than the
> SWTTree. So the SWT Tree is the only one we can get our fingers at.
>
> Any idea about this use-case?
>
> Cheers,
> Hauke


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Select element in TreeMasterDetails View [message #1723673 is a reply to message #1723151] Wed, 17 February 2016 07:42 Go to previous messageGo to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 26
Registered: January 2016
Junior Member
Hi,

the TreeMasterDetail is the only element in the view.

It looks something like this

<org.eclipse.emf.ecp.view.model:View ... >
<rootEClass href="http://myurl#//MyObject"/>
<children
xsi:type="org.eclipse.emf.ecp.view.treemasterview.model:TreeMasterDetail"
xmi:id="abc" name="Tree">
<detailView xmi:id="xyz" name="Details">
<rootEClass href="http://myurl#//MyObject"/>
</detailView>
</children>
</org.eclipse.emf.ecp.view.model:View>

All other Views are quite simple and none has another TreeMasterDetail
element, so this tree is the only one. So this is the reason we can
actually search the SWT-hierarchy for any Tree and assume that it is the
one we need to listen to.

Cheers,
Hauke

Am 12.02.2016 08:59, schrieb Jonas Helming:
> Hi,
>
> is the tree the top level element of your view?
>
> Best regards
>
> Jonas
>
>
> Am 11.02.2016 um 13:21 schrieb Hauke Fuhrmann:
>> Hi there,
>>
>> we want to use the TreeMasterDetails view and add some selection behaviour:
>>
>> 1. Whenever the Selection in the ESelectionService has changed outside
>> the view, the tree will expand to the selected element and select that
>> element such that the details for that object get shown.
>>
>> 2. Vice Versa: Whenever an element in the Tree of the TreeMasterDetails
>> View is selected, the view should update the ESelectionService with that
>> element such that other views can get informed about the new selection.
>>
>> Unfortunately EMF-Forms seems to have no API to work with selections. Is
>> that right? As a workaround we could search the SWT-Tree of the View
>> renderer itself and add listeners to that tree, however, that would
>> brake abstraction and does not work very nicely. The internal JFace tree
>> in the view would work on a higher abstraction level than the SWT tree
>> but is hidden in the internals of that renderer even deeper than the
>> SWTTree. So the SWT Tree is the only one we can get our fingers at.
>>
>> Any idea about this use-case?
>>
>> Cheers,
>> Hauke
>
>
Re: [EMF Forms] Select element in TreeMasterDetails View [message #1723851 is a reply to message #1723673] Thu, 18 February 2016 13:34 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

in this case, it probably makes sense to use the TreeViewer API on the
root level (introduced in 1.8.0), which we also use for the Generic
Editor (see
http://eclipsesource.com/blogs/2016/02/11/emf-forms-1-8-0-feature-ecore-editor-reloaded/)

It basicalls means, that you use an API that EMF Forms provides to
create the top level tree viewer (instead of letting the renderer do
that). This provides full programmatic access to the tree. The details
form is automatically rendered using EMF Forms then.

I will blog about this as part of the 1.8.0 feature announcements.

Best regards

Jonas


Am 17.02.2016 um 08:42 schrieb Hauke Fuhrmann:
> Hi,
>
> the TreeMasterDetail is the only element in the view.
>
> It looks something like this
>
> <org.eclipse.emf.ecp.view.model:View ... >
> <rootEClass href="http://myurl#//MyObject"/>
> <children
> xsi:type="org.eclipse.emf.ecp.view.treemasterview.model:TreeMasterDetail"
> xmi:id="abc" name="Tree">
> <detailView xmi:id="xyz" name="Details">
> <rootEClass href="http://myurl#//MyObject"/>
> </detailView>
> </children>
> </org.eclipse.emf.ecp.view.model:View>
>
> All other Views are quite simple and none has another TreeMasterDetail
> element, so this tree is the only one. So this is the reason we can
> actually search the SWT-hierarchy for any Tree and assume that it is the
> one we need to listen to.
>
> Cheers,
> Hauke
>
> Am 12.02.2016 08:59, schrieb Jonas Helming:
>> Hi,
>>
>> is the tree the top level element of your view?
>>
>> Best regards
>>
>> Jonas
>>
>>
>> Am 11.02.2016 um 13:21 schrieb Hauke Fuhrmann:
>>> Hi there,
>>>
>>> we want to use the TreeMasterDetails view and add some selection
>>> behaviour:
>>>
>>> 1. Whenever the Selection in the ESelectionService has changed outside
>>> the view, the tree will expand to the selected element and select that
>>> element such that the details for that object get shown.
>>>
>>> 2. Vice Versa: Whenever an element in the Tree of the TreeMasterDetails
>>> View is selected, the view should update the ESelectionService with that
>>> element such that other views can get informed about the new selection.
>>>
>>> Unfortunately EMF-Forms seems to have no API to work with selections. Is
>>> that right? As a workaround we could search the SWT-Tree of the View
>>> renderer itself and add listeners to that tree, however, that would
>>> brake abstraction and does not work very nicely. The internal JFace tree
>>> in the view would work on a higher abstraction level than the SWT tree
>>> but is hidden in the internals of that renderer even deeper than the
>>> SWTTree. So the SWT Tree is the only one we can get our fingers at.
>>>
>>> Any idea about this use-case?
>>>
>>> Cheers,
>>> Hauke
>>
>>
>


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Select element in TreeMasterDetails View [message #1726207 is a reply to message #1723851] Thu, 10 March 2016 14:31 Go to previous message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 26
Registered: January 2016
Junior Member
Am 18.02.2016 14:34, schrieb Jonas Helming:
> in this case, it probably makes sense to use the TreeViewer API on the
> root level (introduced in 1.8.0), which we also use for the Generic
> Editor (see
> http://eclipsesource.com/blogs/2016/02/11/emf-forms-1-8-0-feature-ecore-editor-reloaded/)
>
> It basicalls means, that you use an API that EMF Forms provides to
> create the top level tree viewer (instead of letting the renderer do
> that). This provides full programmatic access to the tree. The details
> form is automatically rendered using EMF Forms then.
>
> I will blog about this as part of the 1.8.0 feature announcements.

FTR: The Blog Post is available here
http://eclipsesource.com/blogs/2016/03/09/emf-forms-1-8-0-feature-factories-for-treeviewer-and-tableviewer/

Thanks!
Previous Topic:[EMF Forms] TreeMasterDetail changing &quot;Headers&quot;
Next Topic:[EMF Forms] Viewmodel migration to 1.7 fails when model package is called 'model'
Goto Forum:
  


Current Time: Fri Mar 29 15:25:45 GMT 2024

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

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

Back to the top