使用UiBinder在GWT CustomButton的不同面上设置样式 [英] Setting styles on different faces of a GWT CustomButton using UiBinder

查看:91
本文介绍了使用UiBinder在GWT CustomButton的不同面上设置样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在ToggleButton的不同面上设置样式名称(即upFace,downFace,...)。它看起来像在脸上设置styleName不起作用。例如,以下内容不起作用:

I'm trying to set style names on different faces of ToggleButton (i.e. upFace, downFace, ...). It looks like setting styleName on a face doesn't work. For example the following won't work:

<g:ToggleButton>
    <g:upFace styleName='{style.myToggleButton-up}' />
</g:ToggleButton>

但是我注意到在ToggleButton本身设置样式名称时...

But I noticed when setting the style name on ToggleButton itself...

<g:ToggleButton styleName='{style.myToggleButton}' />

...生成的HTML看起来是这样的:

... the generated HTML will look something like this:

<div class="GPAKHSCBGG GPAKHSCBGG-up" role="button" aria-pressed="false">...</div>

但是,即使我定义了{style.myToggleButton-up},也不会将其填充到GPAKHSCBGG -向上。所以我想知道如何做到这一点,而不必模拟全局的.gwt-ToggleButton-up样式表。

However, even if I have {style.myToggleButton-up} defined, it is not populated to GPAKHSCBGG-up. So I'm wondering how can I do this without having to mock the global .gwt-ToggleButton-up stylesheet. Please help.

推荐答案

解决方案:

Solution:


添加@external myToggleButton,myToggleButton-up;到ui:活页夹文件。

Add @external myToggleButton, myToggleButton-up; to ui:binder file.

这篇关于使用UiBinder在GWT CustomButton的不同面上设置样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆