Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 419405

Summary: Stylesheets: Compartment[type="compartment_shape_display"] showTitle:false; does not work
Product: [Modeling] Papyrus Reporter: Toni Siljamäki <toni.siljamaki>
Component: OthersAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: cletavernier, papyrus-bugs
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Toni Siljamäki CLA 2013-10-14 17:37:27 EDT
Compartment[type="compartment_shape_display"] {
	visible: true;
	/* THE showTitle DOESN'T DO ANYTHING */
	showTitle:false;
}

The reason why it doesn't work seem to be the following in
org.eclipse.papyrus.uml.diagram.component.providers.UMLViewProvider.java:

		if(hasTitle) {
			TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
			ts.setShowTitle(true);
			rv.getStyles().add(ts);
		}

As soon as the modelled component has a title at least one character long
the title gets displayed. One can easily test this by creatig a new
component and remove the characters in the title, which disappears when the
last character is deleted and appears again if one character is entered.
Comment 1 Camille Letavernier CLA 2013-10-16 05:00:50 EDT
"showTitle" is the title of the compartment; not the "name" of the Component. See "Right click > Show/Hide Compartment > Check "show title" to see what "showTitle" does.

The title cannot be edited.

Labels (Element name) are currently not supported by CSS (See bug 417396 for this specific enhancement request)
Comment 2 Toni Siljamäki CLA 2013-10-16 14:47:17 EDT
Ahhh... I tried until my eyes turned red to get rid of the
<<component>>-with-name compartment for a component,
but could not achieve that.

Especially the <<component>> was a bit annoying,
because I could not find any Appearance property to disable it.

At the same time I was also struggling with Bug 419325,
and could not achieve anything with that either.

I found some commented-out code in e.g. the UMLViewProvider.java file,
and then, I guess, I got into the wrong track late in night.

If I Right click > Show/Hide Compartment I cannot find the
compartment containing the <<component> and name for a component.
Comment 3 Toni Siljamäki CLA 2013-10-16 16:42:45 EDT
Instead of closing this bug it could be retitled to explain what I really
was after, which is to disable/hide the <<component>>-with-name compartment
for a component, which currently is not possible.
Comment 4 Camille Letavernier CLA 2013-10-17 04:45:13 EDT
> Instead of closing this bug it could be retitled to explain what I really
> was after, which is to disable/hide the <<component>>-with-name compartment
> for a component, which currently is not possible.

This is already covered by Bug 417396

I can mark it as duplicate instead of invalid, but there's no point to have both bugs opened for the same thing.

(Actually, I just noticed that Bug 417396 doesn't cover this use case, but it is really similar. I'll add a comment for that).

*** This bug has been marked as a duplicate of bug 417396 ***
Comment 5 Toni Siljamäki CLA 2013-10-17 07:29:07 EDT
Thanks. :)