CSS custom variant availability [message #708087] |
Tue, 02 August 2011 12:47 |
Eclipse User |
|
|
|
Hi Rappers
RWT allows people to add a custom variant to a certain widget.
Widget.setData(WidgetUtil.CUSTOM_VARIANT, "aVariant");
Is there also a possibility to check if a variant is available?
Something like 'CssCore.getStyle("aVariant") == null' ?
BR
Andreas
|
|
|
|
|
Re: CSS custom variant availability [message #708172 is a reply to message #708135] |
Tue, 02 August 2011 14:30 |
Eclipse User |
|
|
|
Thank you Ivan.. but that's not what I mean;)
The question is whether or not a certain variant is somewhere in the
"css hierarchy" defined.
e.g.
if(CssCore.getStyle("aVariant") != null) {
myWidget.setData(WidgetUtil.CUSTOM_VARIANT, "aVariant");
} else {
myWidget.setData(WidgetUtil.CUSTOM_VARIANT, "anOtherVariant");
}
/Andreas
On 02.08.2011 15:28, Ivan Furnadjiev wrote:
> Hi Andreas,
> sure...
> if( "aVariant".equals( Widget.getData( WidgetUtil.CUSTOM_VARIANT ) ) ) {
> .....
> }
> HTH,
> Ivan
>
> On 8/2/2011 3:47 PM, Andreas Hoegger wrote:
>> Hi Rappers
>>
>> RWT allows people to add a custom variant to a certain widget.
>> Widget.setData(WidgetUtil.CUSTOM_VARIANT, "aVariant");
>>
>> Is there also a possibility to check if a variant is available?
>> Something like 'CssCore.getStyle("aVariant") == null' ?
>>
>>
>> BR
>> Andreas
|
|
|
Re: CSS custom variant availability [message #708204 is a reply to message #708172] |
Tue, 02 August 2011 14:56 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Andreas,
unfortunately I'm not aware of any way to query if specific custom
variant is defined in the current theme for particular widget or not.
Just out of curiosity, what is the use case that requires this
functionality?
Best,
Ivan
On 8/2/2011 5:30 PM, Andreas Hoegger wrote:
> Thank you Ivan.. but that's not what I mean;)
> The question is whether or not a certain variant is somewhere in the
> "css hierarchy" defined.
>
> e.g.
> if(CssCore.getStyle("aVariant") != null) {
> myWidget.setData(WidgetUtil.CUSTOM_VARIANT, "aVariant");
> } else {
> myWidget.setData(WidgetUtil.CUSTOM_VARIANT, "anOtherVariant");
> }
>
>
> /Andreas
>
>
> On 02.08.2011 15:28, Ivan Furnadjiev wrote:
>> Hi Andreas,
>> sure...
>> if( "aVariant".equals( Widget.getData( WidgetUtil.CUSTOM_VARIANT ) ) ) {
>> .....
>> }
>> HTH,
>> Ivan
>>
>> On 8/2/2011 3:47 PM, Andreas Hoegger wrote:
>>> Hi Rappers
>>>
>>> RWT allows people to add a custom variant to a certain widget.
>>> Widget.setData(WidgetUtil.CUSTOM_VARIANT, "aVariant");
>>>
>>> Is there also a possibility to check if a variant is available?
>>> Something like 'CssCore.getStyle("aVariant") == null' ?
>>>
>>>
>>> BR
>>> Andreas
>
|
|
|
Powered by
FUDForum. Page generated in 0.02718 seconds