You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Eugene Kondrashev <eu...@gmail.com> on 2010/11/30 17:25:29 UTC

Label long text ellipsis

Hi
I wonder if Label has something like text-overflow: ellipsis css like
attributes?

>From the LabelSkin sources i found that there is no logic to do that.

Can you help me please achieving my goal. I need long text elipsis for the
Label, so tell me if I've ommited something from th OOB behavior or if there
is no mechanizm to do that, how can i implement it myself?
I guess I need to implement my own LabelSkin that will have exactly the same
code except public layout() method where glyphVectors is build.

Any help appriciated,

thanks,
Eugene

Re: Label long text ellipsis

Posted by Greg Brown <gk...@verizon.net>.
In general, we try not to overdesign things up front. I'd say let's start with the boolean and modify it later as needed.

On Dec 1, 2010, at 5:24 AM, Sandro Martini wrote:

> 
> Hi Greg, 
>> To add a new style, you just need to add a getter and setter to the skin
>> class. In this case, I imagine the property would be named "showEllipsis"
>> and would be a boolean. 
> Other than the boolean method to flag enable/disable (default) this feature,
> do you think it's good to have another flag for styling for example the
> ellipsis type (as post in JIRA comments) ?
> Or put all in a single style, like ellipsisType="none
> (default)|left|center|right" or other ?
> 
> And last, maybe another good style could be ellipsisChar to specify (if/when
> needed, for example by asian charset) a different character ... but I agree
> that this is could have small real use cases ...
> 
> I can link this feature in JIRA for the 2.1, ok ?
> 
> Comments ?
> 
> Bye,
> Sandro
> 
> 
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Label-long-text-ellipsis-tp1993593p1998201.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Label long text ellipsis

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg, 
> To add a new style, you just need to add a getter and setter to the skin
> class. In this case, I imagine the property would be named "showEllipsis"
> and would be a boolean. 
Other than the boolean method to flag enable/disable (default) this feature,
do you think it's good to have another flag for styling for example the
ellipsis type (as post in JIRA comments) ?
Or put all in a single style, like ellipsisType="none
(default)|left|center|right" or other ?

And last, maybe another good style could be ellipsisChar to specify (if/when
needed, for example by asian charset) a different character ... but I agree
that this is could have small real use cases ...

I can link this feature in JIRA for the 2.1, ok ?

Comments ?

Bye,
Sandro


-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Label-long-text-ellipsis-tp1993593p1998201.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Label long text ellipsis

Posted by Greg Brown <gk...@verizon.net>.
To add a new style, you just need to add a getter and setter to the skin class. In this case, I imagine the property would be named "showEllipsis" and would be a boolean. In the setter, you should call invalidateComponent() to ensure that the glyph vector is regenerated.

On Nov 30, 2010, at 12:04 PM, Eugene Kondrashev wrote:

> Hi Greg
> 
> Thanks for reply. Sooner or later i would need to implement that in some lightweight form.
> 
> Ok, one more question, can you point me please for an example of defining my own style item?
> 
> Thanks, 
> Eugene
> 
> 2010/11/30 Greg Brown <gk...@verizon.net>
> Hi Eugene,
> 
> Unfortunately, the ellipsis style is not currently supported. There is an open issue to add this feature:
> 
> https://issues.apache.org/jira/browse/PIVOT-623
> 
> You could certainly modify LabelSkin to add this functionality. If you do so, please consider submitting your changes for inclusion in the platform.
> 
> Thanks,
> Greg
> 
> On Nov 30, 2010, at 11:25 AM, Eugene Kondrashev wrote:
> 
>> Hi
>> I wonder if Label has something like text-overflow: ellipsis css like attributes?
>> 
>> From the LabelSkin sources i found that there is no logic to do that.
>> 
>> Can you help me please achieving my goal. I need long text elipsis for the Label, so tell me if I've ommited something from th OOB behavior or if there is no mechanizm to do that, how can i implement it myself?
>> I guess I need to implement my own LabelSkin that will have exactly the same code except public layout() method where glyphVectors is build.
>> 
>> Any help appriciated,
>> 
>> thanks,
>> Eugene
> 
> 


Re: Label long text ellipsis

Posted by Eugene Kondrashev <eu...@gmail.com>.
Hi Greg

Thanks for reply. Sooner or later i would need to implement that in some
lightweight form.

Ok, one more question, can you point me please for an example of defining my
own style item?

Thanks,
Eugene

2010/11/30 Greg Brown <gk...@verizon.net>

> Hi Eugene,
>
> Unfortunately, the ellipsis style is not currently supported. There is an
> open issue to add this feature:
>
> https://issues.apache.org/jira/browse/PIVOT-623
>
> You could certainly modify LabelSkin to add this functionality. If you do
> so, please consider submitting your changes for inclusion in the platform.
>
> Thanks,
> Greg
>
> On Nov 30, 2010, at 11:25 AM, Eugene Kondrashev wrote:
>
> Hi
> I wonder if Label has something like text-overflow: ellipsis css like
> attributes?
>
> From the LabelSkin sources i found that there is no logic to do that.
>
> Can you help me please achieving my goal. I need long text elipsis for the
> Label, so tell me if I've ommited something from th OOB behavior or if there
> is no mechanizm to do that, how can i implement it myself?
> I guess I need to implement my own LabelSkin that will have exactly the
> same code except public layout() method where glyphVectors is build.
>
> Any help appriciated,
>
> thanks,
> Eugene
>
>
>

Re: Label long text ellipsis

Posted by Greg Brown <gk...@verizon.net>.
Hi Eugene,

Unfortunately, the ellipsis style is not currently supported. There is an open issue to add this feature:

https://issues.apache.org/jira/browse/PIVOT-623

You could certainly modify LabelSkin to add this functionality. If you do so, please consider submitting your changes for inclusion in the platform.

Thanks,
Greg

On Nov 30, 2010, at 11:25 AM, Eugene Kondrashev wrote:

> Hi
> I wonder if Label has something like text-overflow: ellipsis css like attributes?
> 
> From the LabelSkin sources i found that there is no logic to do that.
> 
> Can you help me please achieving my goal. I need long text elipsis for the Label, so tell me if I've ommited something from th OOB behavior or if there is no mechanizm to do that, how can i implement it myself?
> I guess I need to implement my own LabelSkin that will have exactly the same code except public layout() method where glyphVectors is build.
> 
> Any help appriciated,
> 
> thanks,
> Eugene