Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Possible Model Explorer bug
Possible Model Explorer bug [message #1398830] Fri, 11 July 2014 17:08 Go to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 32
Registered: March 2014
Member
This looks like a bug to me. Can anyone else reprodice it? I took a quick look in bugzilla but I didn't see anything appropriate.

Summary:
When the C_Cpp profile is applied to a model, EcorePrimitiveTypes and PrimitiveTypes are displayed in the Model Explorer pane only after a model element has been deleted.

Steps to reproduce:

1. Create a new Papyrus UML project, with an initial Class diagram
a) File->New->Papyrus Project
b) Name project, check Use default location, click Next
c) Select UML, Click Next
d) Check UML Class Diagram, name diagram, click Finish

2) Apply the C/C++ profile
a) Select model in the Model Explorer
b) In the Properties window, select the Profile tab
c) Click on the "Apply regisered profile" button,
d) Select the C/C++ profile, click OK.
e) Check the C_Cpp box, click OK.


The C_Cpp profile shows up in the "Profile application" area but the Model Explorer pane is not changed. You can expand the model to show the diagram but nothing else is displayed.

3) Add a class to the model.
The Model Explorer shows the new class as a child of the model.

4) Delete the new class using the delete key.
The class is deleted and removed from the model as expected but now the model has 2 siblings in the Model Explorer window: PrimitiveTypes and EcorePrimitiveTypes, both greyed out but still selectable.
I would assume that these are supposed to be displayed when the profile is applied to the model.
What is the greying out indicating?

BTW, if a class is created and deleted before the profile is applyed to the model, the PrimitiveTypes are displayed in the ModelExplorer immediately.
Re: Possible Model Explorer bug [message #1398858 is a reply to message #1398830] Fri, 11 July 2014 18:07 Go to previous messageGo to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 32
Registered: March 2014
Member
This was on a Windows 7 platform using v1.0.0.v201406111317.
Re: Possible Model Explorer bug [message #1398889 is a reply to message #1398830] Fri, 11 July 2014 18:55 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 950
Registered: July 2009
Senior Member
Hi, Stephen,

This sounds like the C_Cpp profile doesn't make much use of those
library models, such that they only appear when they are forced by
proxy resolution to load. And performing a delete command could
certainly do that, because delete wipes out all cross-references to the
deleted elements, which triggers the ECrossReferenceAdapter or does an
ad hoc cross-reference scan on the ResourceSet, either of which would
cause proxies (likely in the C_Cpp profile's package imports) to be
resolved.

So, not an unexpected behaviour of the Model Explorer, but I can see
why it would be surprising. It would be nice if all newly reachable
top-level packages showed right away in the explorer rather than
page-faulting in one by one, as it were. (it would also be nice not to
be prompted to select the only package/profile to import/apply in a
resource that only has the one)

The greying-out indicates that these library models are not editable
(they are read-only).

You might raise an enhancement request in bugzilla to ask that newly
reachable top packages all be shown immediately in the Model Explorer
when a package is imported or a profile applied. But, then, what
should happen the next time a model with the C_Cpp profile applied is
opened in the editor? Should the explorer immediately find and show
the libraries that the model's applied profiles (such as C_Cpp) import?
Perhaps. But it is not so clear in the case that a package isn't
explictly imported using a PackageImport relationship but is simply
referenced (because PackageImport alters the importing namespace, which
one doesn't always want). In that case, finding the used top-level
packages is a potentially expensive operation.

So, I don't know that this is an enhancement we would want to implement ...

HTH,

Christian


On 2014-07-11 17:08:48 +0000, Stephen Blackwell said:

> This looks like a bug to me. Can anyone else reprodice it? I took a
> quick look in bugzilla but I didn't see anything appropriate.
>
> Summary:
> When the C_Cpp profile is applied to a model, EcorePrimitiveTypes and
> PrimitiveTypes are displayed in the Model Explorer pane only after a
> model element has been deleted.
>
> Steps to reproduce:
>
> 1. Create a new Papyrus UML project, with an initial Class diagram
> a) File->New->Papyrus Project
> b) Name project, check Use default location, click Next
> c) Select UML, Click Next
> d) Check UML Class Diagram, name diagram, click Finish
>
> 2) Apply the C/C++ profile
> a) Select model in the Model Explorer
> b) In the Properties window, select the Profile tab
> c) Click on the "Apply regisered profile" button, d) Select the
> C/C++ profile, click OK.
> e) Check the C_Cpp box, click OK.
>
>
> The C_Cpp profile shows up in the "Profile application" area but the
> Model Explorer pane is not changed. You can expand the model to show
> the diagram but nothing else is displayed.
>
> 3) Add a class to the model.
> The Model Explorer shows the new class as a child of the model.
>
> 4) Delete the new class using the delete key.
> The class is deleted and removed from the model as expected but now the
> model has 2 siblings in the Model Explorer window: PrimitiveTypes and
> EcorePrimitiveTypes, both greyed out but still selectable.
> I would assume that these are supposed to be displayed when the profile
> is applied to the model.
> What is the greying out indicating?
>
> BTW, if a class is created and deleted before the profile is applyed to
> the model, the PrimitiveTypes are displayed in the ModelExplorer
> immediately.
Re: Possible Model Explorer bug [message #1400819 is a reply to message #1398889] Mon, 14 July 2014 19:14 Go to previous message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 32
Registered: March 2014
Member
To my mind, this is still a bug.
If I applied a profile because I want to get at the types the profile provides, then those types should be available to me as soon as the profile is applied.

However, the profile may be a red herring. Read on...

I created a new Papyrus project as before.
This time I right-clicked on the model in the Model Explorer and selected New Child->Package from the context menu.
The Model Explorer shows the new package as a child of the model as expected.
Now drag a class from the palette into the class diagram. The new class is created as a sibling of the package and is displayed as such in the Model Explorer.
Finally, in the Model Explorer, drag the new class into the package so it is now a child of the package.
At this point, the PrimitiveTypes and EcorePrimitiveTypes show up in the Model Explorer as siblings of the model without ever having applied any profile

Is this expected behaviour too?
If the C/C++ profile does not provide these predefined types, what does it do?
Is there any documentation on the C/C++ profile?

Thanks,
Steve.
Previous Topic:.di and .notation files are not saved -> out of sync with .uml file
Next Topic:Associate Language
Goto Forum:
  


Current Time: Tue Jun 02 07:46:46 GMT 2015

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

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