Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype
Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype [message #1777275] Mon, 27 November 2017 23:59 Go to next message
Davide Rossi is currently offline Davide RossiFriend
Messages: 16
Registered: July 2009
Junior Member
The question is rather simple: is there a selector I can use so that
StereotypeComment[selector] {
	visible:true;
}

is only applied to some specific stereotypes (so that, say, the stereotype comment shape is shown for the <<Foo>> stereotype but is not for the <<Bar>> stereotype)? Thanks.
Re: Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype [message #1777289 is a reply to message #1777275] Tue, 28 November 2017 08:27 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 846
Registered: February 2011
Senior Member
Hi Davide,

In theory, the StereotypeComment should only be displayed if at least one stereotype compartment is present and visible (So you should never have an empty StereotypeComment, and you can control the visibility of stereotype compartments inside the comments via CSS). However, I've just tried it, and there seems to be a bug. It works well when manipulating the StereotypeComment from the Appearance properties view, but the empty stereotype comment remains when using a stylesheet.

Regards,
Camille


Camille Letavernier
Re: Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype [message #1777294 is a reply to message #1777289] Tue, 28 November 2017 08:57 Go to previous messageGo to next message
Davide Rossi is currently offline Davide RossiFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Camille, thanks for the reply.

Camille Letavernier wrote on Tue, 28 November 2017 03:27

In theory, the StereotypeComment should only be displayed if at least one stereotype compartment is present and visible (So you should never have an empty StereotypeComment, and you can control the visibility of stereotype compartments inside the comments via CSS).


I'm not sure I understand what you say here. When you write "at least one stereotype compartment is present and visible" maybe you are you referring to stereotype properties?

I know I can control the visibility of the properties inside the comments via CSS but I want to know if it is possible to have different visibility depending on the specific stereotype that is applied, i.e. the StereotypeComment is shown for stereotype <<Foo>> but is hidden for sterotype <<Bar>>.
Re: Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype [message #1777297 is a reply to message #1777294] Tue, 28 November 2017 09:06 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 846
Registered: February 2011
Senior Member
Hi Davide,

In the Stereotype Comment, each applied stereotype is mapped to one compartment. You can select the visible compartments for each stereotype, e.g.:

StereotypeComment Compartment[stereotype=Foo]{
   visible: true;
}

StereotypeComment Compartment[stereotype=Bar]{
   visible: false;
}


Then, you just have to specify that the StereotypeComment is visible as well:

StereotypeComment {
   visible: true;
}


The expected result is that StereotypeComment will be displayed, unless it is empty (Empty stereotype comments should never be visible). So if Foo is applied, the corresponding compartment will be visible. However, there is a bug, which means the stereotype comment will always be visible, even when empty.

HTH,
Camille


Camille Letavernier
Re: Stereotypes and CSS: can select StereotypeComment on the basis of related stereotype [message #1777316 is a reply to message #1777297] Tue, 28 November 2017 12:46 Go to previous message
Davide Rossi is currently offline Davide RossiFriend
Messages: 16
Registered: July 2009
Junior Member
Thanks Camille but it does not seem to work.
This is my stylesheet:

StereotypeComment Compartment[stereotype="Foo"]{
   visible: true;
}

StereotypeComment Compartment[stereotype="Bar"]{
   visible: false;
}

StereotypeComment {
   visible: true;
}


And this is what I get:
http://www.morcilab.net/img/foobar.png
That is the stereotype comment is displayed for BOTH Foo and Bar.
Edit: unless you mean that the bug you refer to makes the comment appear also for Bar even if the corresponding compartment is not visible, but you wrote "empty", not "visible", and, to me, "empty" is to be referred to the metamodel and "visible" to the notation.

As a sidenote: for this example I tired creating a new profile model with Oxygen and the palette in the profile diagram is as follows:
http://www.morcilab.net/img/pal1.png
there are a lot of missing elements (among which "Import Metaclass" that makes the editor useless). Not only the palette was fine in Neon but also appears fine in Oxygen if I create the model in Neon and then import it in Oxygen as for the following image:
http://www.morcilab.net/img/pal2.png
Is that a bug or am I missing something?

[Updated on: Tue, 28 November 2017 13:34]

Report message to a moderator

Previous Topic:Some questions on styles and css
Next Topic:How to copy only a part of a template model
Goto Forum:
  


Current Time: Mon Jan 22 10:41:18 GMT 2018

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

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