Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » [CSS Display] How to custom the label of a lifeline?
[CSS Display] How to custom the label of a lifeline? [message #1814416] Wed, 11 September 2019 08:13 Go to next message
Yoann Farre is currently offline Yoann FarreFriend
Messages: 116
Registered: November 2017
Senior Member
Hello,

I would custom the lifeline label in a sequence diagram. However, when the field "Represents" is set, I can't found any way to custom the label , eg for example :
- display only the name of the instance which is represented (without the class)
- display the name of the lifeline instead of the the name of the instance which is represented.

I tried some CSS rule but it has no effect. Probably not surprising as the menu Show/Hide Label is deactivated for the lifeline.

Lifeline > Label[kind=Name] {
	visible : true;
}


Is it possible and if yes, how?

Is there a way to do it programmatically? Contribute a LabelProvider or something like this?

Thanks.

Yoann.

[Updated on: Wed, 11 September 2019 08:16]

Report message to a moderator

Re: [CSS Display] How to custom the label of a lifeline? [message #1814420 is a reply to message #1814416] Wed, 11 September 2019 08:38 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 913
Registered: February 2011
Senior Member
Hi Yoann,

By default, the CSS only allow you to customize the visibility of the label control (I.e. the entire text area of the Lifeline). Changing the actual text is only supported for a few specific labels (Properties, Operations...); there is no generic mechanism for that.

It seems that Lifelines don't support this mechanism (Anymore?), so there's nothing CSS can do. If you really need this, you'd have to provide a custom IParser for the Lifeline (LifelineNameEditPart), using the corresponding GMF extension point (IParserProvider / org.eclipse.gmf.runtime.common.ui.services.parserProviders); although I don't guarantee that Papyrus would properly support that.

Btw, for supported elements, the correct property would be maskLabel. The valid values can be found in the Appearance properties for the corresponding element (Property, Operation, ...), in the "Label customization" area:

Property {
    maskLabel: name type;
}

Lifeline {
    maskLabel: lifelineName representsName representsType; /* No longer supported? */
}


HTH,
Camille


Camille Letavernier
Re: [CSS Display] How to custom the label of a lifeline? [message #1814422 is a reply to message #1814420] Wed, 11 September 2019 09:04 Go to previous message
Yoann Farre is currently offline Yoann FarreFriend
Messages: 116
Registered: November 2017
Senior Member
Hi Camille,

Thanks for your reply.

I just tried the CSS rule with maskLabel, it seems it is not (no more) supported for Lifeline. As you're not sure the IParser contribution is properly supported by Papyrus, it could be more appropriate to contribute a "Label customization" area (like for Property of Operation) for an UML element (specifically for a diagram or not), is there a support/way to do that easily?

Yoann.
Previous Topic:About modeling with MARTE
Next Topic:[Duplicated post]
Goto Forum:
  


Current Time: Mon Dec 16 01:44:22 GMT 2019

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

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

Back to the top