Gwt-grid-widget
GWT-グリッドウィジェット
前書き
クラス宣言
以下は、 com.google.gwt.user.client.ui.Grid クラスの宣言です-
クラスコンストラクター
Sr.No. | Constructor & Description |
---|---|
1 |
Grid() グリッドのコンストラクター。 |
2 |
Grid(int rows, int columns) 要求されたサイズのグリッドのコンストラクター。 |
クラスメソッド
Sr.No. | Function name & Description |
---|---|
1 |
boolean clearCell(int row, int column) 指定したセルの内容を単一のスペースに置き換えます。 |
2 |
protected Element createCell() 新しい空のセルを作成します。 |
3 |
int getCellCount(int row) 列数を返します。 |
4 |
int getColumnCount() このグリッドの列数を取得します。 |
5 |
int getRowCount() 行数を返します。 |
6 |
int insertRow(int beforeRow) テーブルに新しい行を挿入します。 |
7 |
protected void prepareCell(int row, int column) セルがテーブル内の有効なセルであることを確認します。 |
8 |
protected void prepareColumn(int column) 列インデックスが有効であることを確認します。 |
9 |
protected void prepareRow(int row) 行インデックスが有効であることを確認します。 |
10 |
void removeRow(int row) 指定された行をテーブルから削除します。 |
11 |
void resize(int rows, int columns) グリッドのサイズを変更します。 |
12 |
void resizeColumns(int columns) 指定された列数に合わせてグリッドのサイズを変更します。 |
13 |
void resizeRows(int rows) 指定した行数に合わせてグリッドのサイズを変更します。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- com.google.gwt.user.client.ui.UIObject
- com.google.gwt.user.client.ui.Widget
- com.google.gwt.user.client.ui.Panel
- com.google.gwt.user.client.ui.HTMLTable
- java.lang.Object
グリッドウィジェットの例
この例では、GWTでのグリッドウィジェットの使用法を示す簡単な手順を紹介します。 次の手順に従って、_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 の内容です。
グリッドウィジェットの使用方法を示すJavaファイル src/com.finddevguides/HelloWorld.java の内容を見てみましょう。
すべての変更が完了したら、link:/gwt/gwt_create_application [GWT-アプリケーションの作成]の章で行ったように、アプリケーションをコンパイルして開発モードで実行します。 すべてがあなたのアプリケーションでうまくいけば、これは次の結果を生成します-