UIOBjectのプロパティを設定して、ListBoxプライマリCSSテーマをクリアし、必要に応じて独自のテーマを追加できます。
例えば
ListBox list = new ListBox();
list.setStylePrimaryName("listBox");
プロパティJavaDOC
"Sets the element's primary style name and updates all dependent style names."
注:このcssをuiファイルに追加する必要があります。または、CSSResourceを作成してCSSファイルを参照することもできます。
interface ListBoundle extends ClientBundle{
ListBundle INSTANCE = GWT.create(ListBundle.class);
interface ListBoxCssResource extends CssResource {
String listBox();
}
@Source("package.listBox")
@CssResource.NotStrict
ListBoxCssResource css();
}
次に、を指すプロパティを設定します
String listBox();
お気に入り
ListBox list = new ListBox();
list.setStylePrimaryName(ListBoundle.ListBoxCssResource.listBox());
UiBinder内で使用するには、タグを使用する必要があります。
例えば
<ui:style>
.gwt-ListBox{
background: #fff;
border: 1px solid #96CAEA;
}
</ui:style>
<g:ListBox styleName="{style.gwt-ListBox}"/>
ただし、外部リソースを使用する方が適切です。
詳細については、こちらをお読みください