Gwt-celltree-widget
GWT-CellTreeウィジェット
前書き
クラス宣言
以下は、 com.google.gwt.user.cellview.client.CellTree クラスの宣言です-
クラスコンストラクター
Sr.No. | Constructor & Description |
---|---|
1 |
CellTree(TreeViewModel viewModel, T rootValue) 新しいCellTreeを構築します。 |
2 |
CellTree(TreeViewModel viewModel, T rootValue, CellTree.Resources resources) 新しいCellTreeを構築します。 |
クラスメソッド
Sr.No. | Function name & Description |
---|---|
1 |
protected char getAccessKey() アクセスキーを取得します。 |
2 |
CellTree.NodeAnimation getAnimation() アニメーションが有効な場合、このツリーのノードを開閉するために使用されるアニメーションを取得します。 |
3 |
int getDefaultNodeSize() 各ツリーノードの下に表示する子のデフォルトの最大数を取得します。 |
4 |
TreeNode getRootTreeNode() ルートTreeNodeを取得します。 |
5 |
int getTabIndex() タブインデックス内のウィジェットの位置を取得します。 |
6 |
boolean isAnimationEnabled() アニメーションが有効な場合はtrue、有効でない場合はfalseを返します。 |
7 |
protected void onBlur() キーボードで選択されたノードがフォーカスを失ったときに呼び出されます。 |
8 |
void onBrowserEvent(Event event) ブラウザイベントが受信されるたびに発生します。 |
9 |
protected void onFocus() キーボードで選択されたノードがフォーカスを取得すると呼び出されます。 |
10 |
void setAccessKey(char key) ウィジェットの「アクセスキー」を設定します。 |
11 |
void setAnimation(CellTree.NodeAnimation animation) このツリーのノードの開閉に使用されるアニメーションを設定します。 |
12 |
void setAnimationEnabled(boolean enable) アニメーションを有効または無効にします。 |
13 |
void setDefaultNodeSize(int defaultNodeSize) 各子ノードの下に表示するデフォルトの子の数を設定します。 |
14 |
void setFocus(boolean focused) このウィジェットを明示的にフォーカス/フォーカス解除します。 |
15 |
void setTabIndex(int index) タブインデックスでのウィジェットの位置を設定します。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- com.google.gwt.user.client.ui.UIObject
- com.google.gwt.user.client.ui.Widget
- com.google.gwt.user.client.ui.Composite
- com.google.gwt.user.cellview.client.AbstractCellTree
- java.lang.Object
CellTreeウィジェットの例
この例では、GWTのCellTreeウィジェットの使用法を示す簡単な手順を紹介します。 次の手順に従って、_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 の内容です。
CellTreeウィジェットの使用法を示すJavaファイル src/com.finddevguides/HelloWorld.java の内容を見てみましょう。
すべての変更が完了したら、link:/gwt/gwt_create_application [GWT-アプリケーションの作成]の章で行ったように、アプリケーションをコンパイルして開発モードで実行します。 すべてがあなたのアプリケーションでうまくいけば、これは次の結果を生成します-