Data binding between EMFProfilesApplicationView and ProfileRegistry after manual loading of a profile via command

55 views
Skip to first unread message

Emre Taspolatoglu

unread,
Jul 18, 2013, 4:28:02 AM7/18/13
to emf-pr...@googlegroups.com
Hello there,

hope everything is going well.

I would again like to ask a question regarding the data binding between the EMFProfilesApplicationView, to be more clear the TreeViewer defined in it, and the observed profiled models from selected workbench parts. My first thought was that the data binding would have been done in the View's own class, but I couldn't find any data binding context there. Then since the binding happens dynamically from the projects own registry and not from the EMF registry after loading some profiles via LoadProfileApplication command, there should be a listener mechanism, if I am not mistaking, that calls -in case of a valid profile on a selected EMF model- the registry and fills the tree viewer with parents (profiles) and children (stereotypes). So if my initial thought is correct, I wanted to ask where should I look first for parts of the project responsible for data binding? How are the corresponding profiles and stereotypes bound with the tree viewer from the EMFProfilesApplicationView?

If you could point mo to the right direction, I would be very glad. Thanks!

Emre

Philip Langer

unread,
Jul 18, 2013, 5:38:06 AM7/18/13
to emf-pr...@googlegroups.com, Becir Basic
Hi Emre,

I think Becir (see cc) is planning to change something at this part. Becir, could you comment on that question Emre posted? Will this part be affected by the changes you were planning?

Thanks and best wishes,

Philip

Philip Langer

unread,
Jul 18, 2013, 5:39:58 AM7/18/13
to emf-pr...@googlegroups.com
Sorry, I just realized that google groups doesn't show the addresses I put in cc. Anyway, I will check with Becir and see to get an answer!

Best wishes,

Philip

On Thursday, July 18, 2013 10:28:02 AM UTC+2, Emre Taspolatoglu wrote:

Emre Taspolatoglu

unread,
Jul 18, 2013, 8:19:01 AM7/18/13
to emf-pr...@googlegroups.com
Thanks Philip!

bec...@gmail.com

unread,
Jul 19, 2013, 7:12:24 AM7/19/13
to emf-pr...@googlegroups.com
Hi there,
the package 'org.modelversioning.emfprofile.application.registry.ui.observer' provides classes (ActiveEditorObserver, DecoratableEditorPartListener) which act as listeners to changes of workbench parts(editors). These classes identify editor parts for which profile definitions can be applied, and act in situations, such as open/close or switch of an editor by refreshing the content of the view completely by inquiring the profile application registry for a set of profile applications for the currently active editor to show.
In situations of executing commands, e.g. LoadProfileApplication, the command handler(e.g., /org.modelversioning.emfprofile.application.registry.ui/src/org/modelversioning/emfprofile/application/registry/ui/commands/handlers/LoadProfileApplicationHandler.java) opens the LoadProfileApplicationWizard which then uses the profile application registry to load a profile application and then it refreshes the view through ActiveEditorObserver's method 'refreshView'. This can be improved by implementing a listener mechanism for the PA registry, so the view could be notified to refresh itself, and not how it is done at the moment, by explicitly calling from every command handler the refreshView method. So, this could change very soon, because my current work deals somewhat with data binding.

Regards,
Becir



On Thursday, July 18, 2013 10:28:02 AM UTC+2, Emre Taspolatoglu wrote:

Emre Taspolatoglu

unread,
Jul 19, 2013, 7:51:07 AM7/19/13
to emf-pr...@googlegroups.com

Hello again and thanks a lot. The process is exactly how i was thinking of. But the refreshView method was -i guess- what i was looking for. Best regards, Emre

--
You received this message because you are subscribed to a topic in the Google Groups "EMF Profiles" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emf-profiles/Dl4CfVmxzaQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emf-profiles...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Emre Taspolatoglu

unread,
Jul 21, 2013, 2:10:22 PM7/21/13
to emf-pr...@googlegroups.com
Hi there,

I will like to ask a second question regarding another data binding case. This time it is between the Eclipse's Properties View and the EMF Profiles View.

As far as I know, EMF Profiles has nothing directly to do with how Properties View listens and gets the properties of the selected property source, such as a the Stereotype chosen in EMF Profiles View, right? After the selection, the Properties View delivers the defined attributes and tagged values of the Stereotype; beside Extension, Applied To and Profile Application.

My main question would be about the method getTaggesValues() of the Stereotype. I believe, that this is the method to get the values of defined Stereotype attributes? If not, I might have to take another look into the EMF Profiles models/codes. Because a few time ago as I was trying to integrate the tabbed properties view support into EMF Profiles View, I have come against a little problem, which was that only Extension, Applied To and Profile Application features of a selected Stereotype was schown in the tabbed properties view, but some how I couldn't managed to get to the by user defined stereotype attributes and their tagged values.

To be able further move with my data binding, I would be very glad if you could show me the right direction.

Thanks a lot!
To unsubscribe from this group and all its topics, send an email to emf-profiles+unsubscribe@googlegroups.com.

Philip Langer

unread,
Jul 22, 2013, 10:51:53 AM7/22/13
to emf-pr...@googlegroups.com
Hi,

see below...

2013/7/21 Emre Taspolatoglu <emreta...@gmail.com>:
> Hi there,
>
> I will like to ask a second question regarding another data binding case.
> This time it is between the Eclipse's Properties View and the EMF Profiles
> View.
>
> As far as I know, EMF Profiles has nothing directly to do with how
> Properties View listens and gets the properties of the selected property
> source, such as a the Stereotype chosen in EMF Profiles View, right? After
> the selection, the Properties View delivers the defined attributes and
> tagged values of the Stereotype; beside Extension, Applied To and Profile
> Application.
>
> My main question would be about the method getTaggesValues() of the
> Stereotype. I believe, that this is the method to get the values of defined
> Stereotype attributes? If not, I might have to take another look into the
> EMF Profiles models/codes. Because a few time ago as I was trying to
> integrate the tabbed properties view support into EMF Profiles View, I have
> come against a little problem, which was that only Extension, Applied To and
> Profile Application features of a selected Stereotype was schown in the
> tabbed properties view, but some how I couldn't managed to get to the by
> user defined stereotype attributes and their tagged values.

It would be great to have the tabbed properties view integrated with
EMF Profiles! Thanks!
The features you mentioned (extension, appliedTo) are those from the
automatically added superclass 'StereotypeApplication'. You want to
have those from the "real" stereotype. When you step through your code
and execute eObject.eClass() on the stereotypeapplication object, what
do you get returned? Did you try
eObject.eClass().getEAllStructuralFeatures()?

You can push your code to a google code clone of the EMF Profiles
Google code project or on github [1] if you prefer and I can have a
look at it.

Best wishes,

Philip

[1] https://github.com/planger/emf-profiles
>> emf-profiles...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "EMF Profiles" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emf-profiles...@googlegroups.com.

Emre Taspolatoglu

unread,
Jul 22, 2013, 11:01:13 AM7/22/13
to emf-pr...@googlegroups.com
Hello Philip,

thanks for the quick reply! I will try to take a look at things tomorrow
based on your tipps, and should be able to respond to you afterwards. As
with the tabbed properties view, I would be more than happy to
contribute, but because of a majoring exam in the coming weeks and some
other duties that needs to be done, it could unfortunately not happen so
quickly. :)

With best regards,
Emre

Emre Taspolatoglu

unread,
Jul 25, 2013, 1:21:25 AM7/25/13
to emf-pr...@googlegroups.com
Hi Philip, sorry I wasn't able to test your approach, because I have encountered some problems with the develop-Branch, which for the time being not allows me to go further with data binding. As soon as they are taken care of, I will come back to you regarding your tips.

Best regards,
Emre
>>> emf-profiles+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "EMF Profiles" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emf-profiles+unsubscribe@googlegroups.com.

Emre Taspolatoglu

unread,
Aug 9, 2013, 12:08:44 AM8/9/13
to emf-pr...@googlegroups.com
Hello Philip,

sorry for the delay. I wasn't able to concentrate fully on my project because of a learning period on an exam. But I have found some time to test your tip abput eGetAllStructuraFeatutes() in my databinding. But I now getting the following error, when I use the TreeViewer re-used from EMF Profiles View as a model and the mentioned TableViewer as the target:

java.lang.IllegalArgumentException: Could not find property with name stereotype.EAllStructuralFeatures in class class org.modelversioning.emfprofileapplication.impl.StereotypeApplicationImpl

The binding code I have used is generated as follows (not the direct way you have mentioned):

        IObservableValue observeSingleSelectionTreeViewer = ViewerProperties.singleSelection().observe(treeViewer);
        IObservableList treeViewerStereotypeEAllStructuralFeaturesObserveDetailList = PojoProperties.list(StereotypeApplicationImpl.class, "stereotype.EAllStructuralFeatures", StereotypeApplication.class).observeDetail(observeSingleSelectionTreeViewer);
        tableViewer.setInput(treeViewerStereotypeEAllStructuralFeaturesObserveDetailList);

The thing is that I am able to use the -children- Stereotype Applications from the TreeViewer as selections for the label provider or even in some tooltip-cases, where I can see which Stereotype is currently used on which EMF model element.

Do you have any further ideas? Will appreciate it a lot!

Have a nice day!

Emre

P.S: The bug reports I am having for the develop-branch should be uploaded until next week.

Philip Langer

unread,
Aug 9, 2013, 5:02:33 PM8/9/13
to emf-pr...@googlegroups.com
Hi Emre,

I have to say, I haven't tried PojoProperties yet, but why do you write "stereotype.EAllStructuralFeatures" and not only "eAllStructuralFeatures"? Have you tried using the EMF-specific databinding classes?


Maybe it is easier using this API?

Best wishes,

Philip
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "EMF Profiles" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
Reply all
Reply to author
Forward
0 new messages