Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Modified style
Modified style [message #1854049] Fri, 29 July 2022 12:11 Go to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 195
Registered: February 2013
Senior Member
Hi everyone
Can i change widget style after initialization constructor?
Dmitry
Re: Modified style [message #1854065 is a reply to message #1854049] Sat, 30 July 2022 10:49 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2428
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Dmitry

yes.. you can. Define different styling as "custom variants" and switch them at runtime by setting RWT.CUSTOM_VARIANT data on the widget.

Best regards,
Ivan
Re: Modified style [message #1854204 is a reply to message #1854065] Sat, 06 August 2022 12:50 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 195
Registered: February 2013
Senior Member
mmmmm.... Does it help for widget behaviour like SET.READ_ONLY?
Re: Modified style [message #1854348 is a reply to message #1854204] Mon, 15 August 2022 17:08 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2428
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,

depends on the widget and the property you want to style.

Regards,
Ivan
Re: Modified style [message #1854359 is a reply to message #1854348] Mon, 15 August 2022 23:18 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 195
Registered: February 2013
Senior Member
Combo
Re: Modified style [message #1854372 is a reply to message #1854359] Tue, 16 August 2022 13:00 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2428
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Yes... just set RWT.CUSTOM_VARIANT with widget.setData(...). The styling with this variant will be applied from CSS like:

Button.my_custom_variant {
....
}

See also our online Controls demo here:
https://rap.eclipsesource.com/demo/release/controls/#Variants

Regards,
Ivan
Re: Modified style [message #1854660 is a reply to message #1854049] Thu, 01 September 2022 12:52 Go to previous message
Benjamin Wolff is currently offline Benjamin WolffFriend
Messages: 137
Registered: July 2009
Senior Member
Just as a general remark, I frequently use the theming reference to check what widgets can be styled via custom variants and what states and styles are supported: https://download.eclipse.org/rt/rap/doc/3.21/guide/reference/theming/index.html

You may need to substitute the version in the url to the one used in your project.

HTH,
Ben
Previous Topic:[ANN] RAP 3.21 Released!
Next Topic:Server push
Goto Forum:
  


Current Time: Wed Dec 04 11:59:02 GMT 2024

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

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

Back to the top