Gwt-celllist-widget
GWT-CellListウィジェット
前書き
クラス宣言
以下は、 com.google.gwt.user.cellview.client.CellList <T> クラスの宣言です-
クラスコンストラクター
Sr.No. | Constructor & Description |
---|---|
1 |
CellList(Cell<T> cell) 新しいCellListを作成します。 |
2 |
CellList(Cell<T> cell, CellList.Resources resources) 指定されたCellList.Resourcesを使用して新しいCellListを構築します。 |
3 |
CellList(Cell<T> cell, CellList.Resources resources, ProvidesKey<T> keyProvider) 指定されたCellList.Resourcesおよびキープロバイダーを使用して新しいCellListを構築します。 |
4 |
CellList(Cell<T> cell, ProvidesKey<T> keyProvider) 指定されたキープロバイダーで新しいCellListを構築します。 |
クラスメソッド
Sr.No. | Function name & Description |
---|---|
1 |
protected boolean dependsOnSelection() ビュー内のセルが選択状態に依存しているかどうかを確認します。 |
2 |
protected void doSelection(Event event, T value, int indexOnPage) 廃止予定です。 代わりにAbstract HasData.add Cell Preview Handler(com.google.gwt.view.client.Cell Preview Event.Handler)を使用してください。 |
3 |
protected void fireEventToCell(Cell.Context context, Event event, Element parent, T value) セルにイベントを発生させます。 |
4 |
protected Cell<T> getCell() 各アイテムのレンダリングに使用されるセルを返します。 |
5 |
protected Element getCellParent(Element item) リスト項目からセルをラップする親要素を取得します。 |
6 |
protected Element getChildContainer() レンダリングされたセルを保持する要素を返します。 |
7 |
SafeHtml getEmptyListMessage() データがないときに表示されるメッセージを取得します。 |
8 |
protected Element getKeyboardSelectedElement() キーボードが選択されている要素を取得します。 |
9 |
Element getRowElement(int indexOnPage) 指定されたインデックスの要素を取得します。 |
10 |
protected boolean isKeyboardNavigationSuppressed() ユーザーがセルを編集しているときなど、キーボードナビゲーションが抑制されているかどうかを確認します。 |
11 |
protected void onBlur() ウィジェットがぼやけているときに呼び出されます。 |
12 |
protected void onBrowserEvent2(Event event) AbstractHasData.onBrowserEvent(Event)が完了した後に呼び出されます。 |
13 |
protected void onFocus() ウィジェットにフォーカスがあるときに呼び出されます。 |
14 |
protected void renderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel) すべての行の値を指定されたSafeHtmlBuilderにレンダリングします。 |
15 |
protected boolean resetFocusOnCell() 現在フォーカスされているセルにフォーカスをリセットします。 |
16 |
void setEmptyListMessage(SafeHtml html) データがないときに表示するメッセージを設定します。 |
17 |
protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus) キーボードの選択状態を反映するように要素を更新します。 |
18 |
protected void setSelected(Element elem, boolean selected) 廃止予定です。 このメソッドはAbstractHasDataによって呼び出されることはなく、renderRowValues(SafeHtmlBuilder、List、int、SelectionModel)で選択されたスタイルをレンダリングします |
19 |
void setValueUpdater(ValueUpdater<T> valueUpdater) セルがアイテムを変更するときに使用する値アップデーターを設定します。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- com.google.gwt.user.client.ui.UIObject
- com.google.gwt.user.client.ui.Widget
- com.google.gwt.user.cellview.client.AbstractHasData
- java.lang.Object
CellListウィジェットの例
この例では、GWTでCellListウィジェットの使用方法を示す簡単な手順を紹介します。 次の手順に従って、_GWTで作成したGWTアプリケーションを更新します-アプリケーションの作成_の章-
Step | Description |
---|---|
1 | Create a project with a name HelloWorld under a package com.finddevguides as explained in the GWT - Create Application chapter. |
2 | Modify HelloWorld.gwt.xml, HelloWorld.css, HelloWorldl and HelloWorld.java as explained below. Keep rest of the files unchanged. |
3 | Compile and run the application to verify the result of the implemented logic. |
以下は、変更されたモジュール記述子 src/com.finddevguides/HelloWorld.gwt.xml の内容です。
以下は、変更されたスタイルシートファイル war/HelloWorld.css の内容です。
以下は、変更されたHTMLホストファイル war/HelloWorldl の内容です。
CellListウィジェットの使用法を示すJavaファイル src/com.finddevguides/HelloWorld.java の内容を見てみましょう。
すべての変更が完了したら、link:/gwt/gwt_create_application [GWT-アプリケーションの作成]の章で行ったように、アプリケーションをコンパイルして開発モードで実行します。 すべてがあなたのアプリケーションでうまくいけば、これは次の結果を生成します-