Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Label size calculation error for text with consecutive spaces
Label size calculation error for text with consecutive spaces [message #808123] Mon, 27 February 2012 12:33 Go to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
Hi,
I have created a custom dialog class in my RAP application. I have overridden the method 'createDialogArea' to add labels and other controls to my dialog. The issue is for labels with style property 'WRAP' and that have more than one consecutive spaces. The text width for such labels is being determined as if there is a single space due to which my label text gets cut off.
So, for ex if my text is
'Eclipse Rich Ajax Platform - Testing single spaces',
the width calculation is done such that my text would be
'Eclipse Rich Ajax Platform - Testing single spaces'. (with single spaces)

So when the text is actually displayed, the calculated width is not able to accommodate the text.

I have attached a simple dialog code to reproduce this.

Regards,
Aman.

begin 644 MyDialog.java
M<&%C:V%G92!O<F<N96-L:7!S92YR87`N9&5M;RYC;VYT<F]L<SL-"@T*:6UP
M;W)T(&]R9RYE8VQI<'-E+FIF86-E+F1I86QO9W,N1&EA;&]G.PT*:6UP;W)T
M(&]R9RYE8VQI<'-E+G-W="Y35U0[#0II;7!O<G0@;W)G+F5C;&EP<V4N<W=T
M+F-U<W1O;2Y#3&%B96P[#0II;7!O<G0@;W)G+F5C;&EP<V4N<W=T+G=I9&=E
M=',N0V]M<&]S:71E.PT*:6UP;W)T(&]R9RYE8VQI<'-E+G-W="YW:61G971S
M+D-O;G1R;VP[#0II;7!O<G0@;W)G+F5C;&EP<V4N<W=T+G=I9&=E=',N4VAE
M;&P[#0H-"G!U8FQI8R!C;&%S<R!->41I86QO9R!E>'1E;F1S($1I86QO9R![
M#0H-"@EP<F]T96-T960@37E$:6%L;V<H4VAE;&P@<&%R96YT4VAE;&PI('L-
M"@D)<W5P97(H<&%R96YT4VAE;&PI.PT*"7T-"@T*"7!R;W1E8W1E9"!#;VYT
M<F]L(&-R96%T941I86QO9T%R96$H0V]M<&]S:71E('!A<F5N="D@>PT*"0E#
M;VUP;W-I=&4@8V]M<&]S:71E(#T@*$-O;7!O<VET92D@<W5P97(N8W)E871E
M1&EA;&]G07)E82AP87)E;G0I.PT*"0E#3&%B96P@;&%B96P@/2!N97<@0TQA
M8F5L*&-O;7!O<VET92P@4U=4+E=205`I.PT*"0EL86)E;"YS971497AT*")%
M8VQI<'-E("!2:6-H("!!:F%X("!0;&%T9F]R;2`@+2`@5&5S=&EN9R`@<VEN
M9VQE("!S<&%C97,B*3L-"@D)<F5T=7)N(&-O;7!O<VET93L-"@E]#0H-"@DO
M*BH-"@D@*B`-"@D@*B\-"@EP<FEV871E('-T871I8R!F:6YA;"!L;VYG('-E
;<FEA;%9E<G-I;VY5240@/2`Q3#L-"@T*?0T*
`
end

[Updated on: Mon, 27 February 2012 12:36]

Report message to a moderator

Re: Label size calculation error for text with multiple consecutive spaces [message #808260 is a reply to message #808123] Mon, 27 February 2012 15:34 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Hi Aman,
I think you are running into this bug:
371360: [TextSizeDetermination] Returns smaller width if there are
sequential spaces between words
https://bugs.eclipse.org/bugs/show_bug.cgi?id=371360
Best,
Ivan

On 2/27/2012 2:33 PM, Amandeep Chahal wrote:
> Hi,
> I have created a custom dialog class in my RAP application. I have overridden the method 'createDialogArea' to add labels and other controls to my dialog. The issue is for labels with style property 'WRAP' and that have more than one consecutive spaces. The text width for such labels is being determined as if there is a single space due to which my label text gets cut off.
> So, for ex if my text is
> 'Eclipse Rich Ajax Platform - Testing single spaces',
> the width calculation is done such that my text would be
> 'Eclipse Rich Ajax Platform - Testing single spaces'. (with single spaces)
>
> So when the text is actually displayed, the calculated width is not able to accommodate the text.
>
> I have attached a simple dialog code to reproduce this.
>
> Regards,
> Aman.
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Label size calculation error for text with multiple consecutive spaces [message #808958 is a reply to message #808260] Tue, 28 February 2012 10:25 Go to previous messageGo to next message
Amandeep Chahal is currently offline Amandeep ChahalFriend
Messages: 85
Registered: September 2011
Location: India
Member
Thanks for your reply Ivan. The bug you are referring to is precisely what I'm facing. Are there plans to fix this in the next release?

Re: Label size calculation error for text with multiple consecutive spaces [message #808969 is a reply to message #808958] Tue, 28 February 2012 10:34 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Yes, we should fix it in the next release.

On 2/28/2012 12:25 PM, Amandeep Chahal wrote:
> Thanks for your reply Ivan. The bug you are referring to is precisely
> what I'm facing. Are there plans to fix this in the next release?
>
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Problem with ViewStack org.eclipse.rap.design.example.stack.view
Next Topic:Components RAP development
Goto Forum:
  


Current Time: Sat Dec 20 01:01:24 GMT 2014

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

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