テキスト付きのラベルの横に配置したいアスタリスクのイメージについて、1日前に質問しました。ただし、画像は2回表示されます.UiBinderとGwtをまだ学習しているため、これを理解するのにまだ苦労しています.
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:style type="com.equillore.mcmexternal.client.ui.IndicatorLabel.Style">
@sprite .mySpriteClass {gwt-image: "imageAccessor"; other: property;}
.required
{
gwt-image: 'requiredImage';
width: 7px;
height: 14px;
}
.labRequired
{
color:#303030;
font-family: Tahoma, Geneva, sans-serif;
font-size:10pt;
font-style:normal;
font-weight:lighter;
}
</ui:style>
<g:SimplePanel width='90px' height='21px'>
<g:Grid>
<g:row>
<g:customCell>
<g:Label ui:field="label" addStyleNames="{style.labRequired}"/>
</g:customCell>
<g:customCell>
<g:Label addStyleNames="{style.required}"/>
</g:customCell>
</g:row>
</g:Grid>
</g:SimplePanel>
次の行を削除すると
<ui:image field="requiredImage" src="images/required_indicator.gif"/>
アスタリスクのイメージが正しく表示されるように Java ファイルを変更するにはどうすればよいですか。これが Java ファイルです。
public class IndicatorLabel extends Composite implements HasText {
public interface Binder extends UiBinder<Widget, IndicatorLabel> {
}
private static final Binder binder = GWT.create(Binder.class);
public interface Style extends CssResource {
String required();
}
@UiField Style style;
@UiField Label label;
public IndicatorLabel() {
initWidget(binder.createAndBindUi(this));
}
public IndicatorLabel(String text) {
this();
setText(text);
}
敬具