基本的なセルブラウザウィジェットをアプリで機能させようとしています。今のところ、構造だけなので、後で意味のあるものに置き換えることができます。サンプルを調べて実装しましたが、アプリケーションに統合しようとすると機能しません。
これがコードの一部です。何が問題ですか?ウィジェットが表示されないのはなぜですか?
public class ListViewImpl extends Composite implements ListView
{
private static ListViewImplUiBinder uiBinder = GWT
.create(ListViewImplUiBinder.class);
interface ListViewImplUiBinder extends UiBinder<Widget, ListViewImpl>
{
}
private Presenter presenter;
@UiField(provided=true)
CellBrowser cellbrowser;
public ListViewImpl()
{
TreeViewModel model = new ListTreeViewModel();
cellbrowser=new CellBrowser(model,null);
cellbrowser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
cellbrowser.setAnimationEnabled(true);
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void setPresenter(Presenter presenter)
{
this.presenter=presenter;
}
@Override
public Widget asWidget() {
return this;
}
}
Uibinderファイルは次のようになります->
<ui:style>
.browser {
border: 1px solid #ccc;
}
.out
{
outline:#ccc solid thick;
}
</ui:style>
<g:HTMLPanel styleName='{style.out}' >
<c:CellBrowser addStyleNames='{style.browser}' defaultColumnWidth='300' ui:field='cellbrowser' />
</g:HTMLPanel>
ListTreeViewモデルクラスは、スタンドアロンアプリケーションでコードを使用し、CellBrowserをRootLayoutPanelに追加する場合と同様に完璧です。できます!