Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » changing fontsize during lifecycle
changing fontsize during lifecycle [message #112899] Thu, 20 November 2008 10:15 Go to next message
rollo is currently offline rolloFriend
Messages: 117
Registered: July 2009
Senior Member
Hi,

is it possible to change the fontsize of all buttons and labels during
the lifecycle.

In the moment i changed it per css, like this:
* {
font: normal 12px Verdana;
}

But I want that user can change it.

Roland
Re: changing fontsize during lifecycle [message #112995 is a reply to message #112899] Fri, 21 November 2008 06:34 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Roland,

this can be done using a PhaseListener.

You can hook into After-Render-Phase and update your widgets. One
possibility is to store the old font heights via setData with the
widgets to determine if the font size has to been modified or not. See
TextSizeDeterminationHandler for an example on how to iterate and update
over the complete widget tree.


Another possibility would be to create multiple themens with different
font sizes and switch between them during runtime. However, I don't
know, if that's supported yet. Ralf?

Regards,
Stefan.

Roland Siebert schrieb:
> Hi,
>
> is it possible to change the fontsize of all buttons and labels during
> the lifecycle.
>
> In the moment i changed it per css, like this:
> * {
> font: normal 12px Verdana;
> }
>
> But I want that user can change it.
>
> Roland
Re: changing fontsize during lifecycle [message #113017 is a reply to message #112995] Fri, 21 November 2008 08:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ifurnadjiev.innoopract.com

Hi,

switching the widget variant at runtime is possible. You can take a look
at the variant tab of the Control Demo.

Best,
Ivan

Stefan Roeck wrote:
> Hi Roland,
>
> this can be done using a PhaseListener.
>
> You can hook into After-Render-Phase and update your widgets. One
> possibility is to store the old font heights via setData with the
> widgets to determine if the font size has to been modified or not. See
> TextSizeDeterminationHandler for an example on how to iterate and
> update over the complete widget tree.
>
>
> Another possibility would be to create multiple themens with different
> font sizes and switch between them during runtime. However, I don't
> know, if that's supported yet. Ralf?
>
> Regards,
> Stefan.
>
> Roland Siebert schrieb:
>> Hi,
>>
>> is it possible to change the fontsize of all buttons and labels
>> during the lifecycle.
>>
>> In the moment i changed it per css, like this:
>> * {
>> font: normal 12px Verdana;
>> }
>>
>> But I want that user can change it.
>>
>> Roland
Re: changing fontsize during lifecycle [message #113029 is a reply to message #113017] Fri, 21 November 2008 09:23 Go to previous message
Eclipse UserFriend
Originally posted by: rsternberg.innoopract.com

Hi,

switching themes at runtime is currently not supported. If only the font
differs between the multiple themes, this would also involve a lot of
redundancy, I guess.

It's right, widget variants can be switched at runtime. But if you want
to go that way to change the font of every widget, you also have to
apply these variants to every widget. As a widget can only have a single
variant, this approach would prevent you from using variants for any
other purpose. To actually change fonts, you would have to change the
variant for all widgets, so you would save nothing compared to the
approach Stefan already outlined.

Don't forget to re-layout after switching fonts.

Best regards, Ralf

Ivan Furnadjiev wrote:
> Hi,
>
> switching the widget variant at runtime is possible. You can take a look
> at the variant tab of the Control Demo.
>
> Best,
> Ivan
>
> Stefan Roeck wrote:
>> Hi Roland,
>>
>> this can be done using a PhaseListener.
>>
>> You can hook into After-Render-Phase and update your widgets. One
>> possibility is to store the old font heights via setData with the
>> widgets to determine if the font size has to been modified or not. See
>> TextSizeDeterminationHandler for an example on how to iterate and
>> update over the complete widget tree.
>>
>>
>> Another possibility would be to create multiple themens with different
>> font sizes and switch between them during runtime. However, I don't
>> know, if that's supported yet. Ralf?
>>
>> Regards,
>> Stefan.
>>
>> Roland Siebert schrieb:
>>> Hi,
>>>
>>> is it possible to change the fontsize of all buttons and labels
>>> during the lifecycle.
>>>
>>> In the moment i changed it per css, like this:
>>> * {
>>> font: normal 12px Verdana;
>>> }
>>>
>>> But I want that user can change it.
>>>
>>> Roland
Previous Topic:[Decorator] Icons not refreshed
Next Topic:change color of the table item completely
Goto Forum:
  


Current Time: Sun Jan 29 10:23:14 GMT 2023

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

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

Back to the top