Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Centering label text(Centered text)
Centering label text [message #1694449] Tue, 05 May 2015 11:45 Go to next message
Patrik Jonsson is currently offline Patrik JonssonFriend
Messages: 18
Registered: January 2015
Junior Member
Hi

We would want name label texts to be centered so that when we start typing in the name label field the text "grows" both to the left and the right at the same time.

Is that possible via e.g. CSS?

Patrik
Re: Centering label text [message #1694452 is a reply to message #1694449] Tue, 05 May 2015 12:02 Go to previous messageGo to next message
Mickael ADAM is currently offline Mickael ADAMFriend
Messages: 31
Registered: February 2014
Member
hi,

use the attibute textAlignment on Label:

*{
textAlignment:"right";
}

HTH
Re: Centering label text [message #1694453 is a reply to message #1694452] Tue, 05 May 2015 12:02 Go to previous messageGo to next message
Mickael ADAM is currently offline Mickael ADAMFriend
Messages: 31
Registered: February 2014
Member
"center" in your case Smile
Re: Centering label text [message #1694454 is a reply to message #1694453] Tue, 05 May 2015 12:22 Go to previous messageGo to next message
Patrik Jonsson is currently offline Patrik JonssonFriend
Messages: 18
Registered: January 2015
Junior Member
Hmmm,

I now have
Label {
textAlignment:"center";
}

I have also tried with
*{
textAlignment:"center";
}

But nothing happens in my diagrams.
When I select a Label of say a class, and start typing inside it, the text just expands to the right.

Not sure what I am doing wrong.

Patrik
Re: Centering label text [message #1694457 is a reply to message #1694454] Tue, 05 May 2015 12:27 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Patrik,

These new properties only work on Mars I think (Papyrus 1.1.0)

Regards,
Camille


Camille Letavernier
Re: Centering label text [message #1694460 is a reply to message #1694457] Tue, 05 May 2015 12:43 Go to previous messageGo to next message
Patrik Jonsson is currently offline Patrik JonssonFriend
Messages: 18
Registered: January 2015
Junior Member
I am running
Version: Mars Milestone 6 (4.5.0M6)
Build id: 20150326-0744

with Papyrus
1.1.0.201503251607

Patrik
Re: Centering label text [message #1694461 is a reply to message #1694460] Tue, 05 May 2015 12:58 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

The property has been renamed from namePosition to textAlignment between M6 and M7:

463552: [CSS - Alignment] namePosition is similar to textAlignment, and should be renamed for consistency
https://bugs.eclipse.org/bugs/show_bug.cgi?id=463552

So you should try namePosition (but know that it is deprecated and won't work in the next update), or update to Papyrus Nightly, or wait until M7 at the end of this week (Papyrus nightly may be a little bit risky this week since we're already building M7 and our dependencies are moving, so you may have some difficulties to get a consistent build)

Regards,
Camille


Camille Letavernier

[Updated on: Tue, 05 May 2015 12:59]

Report message to a moderator

Re: Centering label text [message #1694467 is a reply to message #1694461] Tue, 05 May 2015 13:55 Go to previous messageGo to next message
Patrik Jonsson is currently offline Patrik JonssonFriend
Messages: 18
Registered: January 2015
Junior Member
Odd,

When I apply
*{
namePosition:center;
}
to my .css only those elements that have their name visible gets affected (Packages in my case) but those that have a Floating label (and no name label) does not get affected (e.g. Classes in my case).

I would want to accomplish the reverse, only affecting my Floating labels, which seems to be the intention of textAlignment as described in the css "manual".

How can this be done? Is it implemented in M7?

Patrik
Re: Centering label text [message #1694830 is a reply to message #1694467] Fri, 08 May 2015 10:13 Go to previous message
Patrik Jonsson is currently offline Patrik JonssonFriend
Messages: 18
Registered: January 2015
Junior Member
Hi

Thanks for the M7, it improved performance a lot in Browser context menus!

Regarding centered text, I have tried

Interface > Label {
visible:true;
textAlignment:"center";
}

in the M7 and this does not affect my floating labels for Interfaces.
What am I doing wrong?

Patrik
Previous Topic:Mars rollout
Next Topic:browser customization
Goto Forum:
  


Current Time: Thu Mar 28 10:34:53 GMT 2024

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

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

Back to the top