Gwt-popuppanel-widget
GWT-PopupPanelウィジェット
前書き
クラス宣言
以下は、 com.google.gwt.user.client.ui.PopupPanel クラスの宣言です-
クラスコンストラクター
Sr.No. | Constructor & Description |
---|---|
1 |
PopupPanel() 空のポップアップパネルを作成します。 |
2 |
PopupPanel(boolean autoHide)
|
3 |
PopupPanel(boolean autoHide, boolean modal)
|
クラスメソッド
Sr.No. | Function name & Description |
---|---|
1 |
void addAutoHidePartner(Element partner) autoHideパートナー内で発生するマウスイベントは、autoHideに設定されたパネルを非表示にしません。 |
2 |
HandlerRegistration addCloseHandler( CloseHandler <PopupPanel> handler) CloseEventハンドラーを追加します。 |
3 |
void addPopupListener(PopupListener listener) 廃止予定です。 addCloseHandler(com.google.gwt.event。を使用します。 代わりにlogical.shared.CloseHandler) |
4 |
void center() ポップアップをブラウザウィンドウの中央に配置して表示します。 |
5 |
protected Element getContainerElement() このメソッドをオーバーライドして、ルート要素以外の要素がパネルの子ウィジェットのコンテナになるように指定します。 |
6 |
protected Element getGlassElement() このPopupPanelによって使用されるガラス要素を取得します。 |
7 |
java.lang.String getGlassStyleName() ガラス要素で使用されるスタイル名を取得します。 |
8 |
int getOffsetHeight() パネルのオフセット高さをピクセル単位で取得します。 |
9 |
int getOffsetWidth() パネルのオフセット幅をピクセル単位で取得します。 |
10 |
int getPopupLeft() ブラウザのクライアント領域に相対的なポップアップの左位置を取得します。 |
11 |
int getPopupTop() ブラウザのクライアント領域に相対的なポップアップの最上部の位置を取得します。 |
12 |
protected Element getStyleElement() スタイル名が適用される要素を返すテンプレートメソッド。 |
13 |
java.lang.String getTitle() このオブジェクトに関連付けられたタイトルを取得します。 |
14 |
void hide() ポップアップを非表示にして、ページから切り離します。 |
15 |
void hide(boolean autoClosed) ポップアップを非表示にして、ページから切り離します。 |
16 |
boolean isAnimationEnabled() アニメーションが有効な場合はtrue、有効でない場合はfalseを返します。 |
17 |
boolean isAutoHideEnabled() ユーザーがポップアップの外側をクリックしたときにポップアップを自動的に非表示にする場合はtrueを返します。 |
18 |
boolean isAutoHideOnHistoryEventsEnabled( ) ユーザーがブラウザの戻るボタンを押したときなど、履歴トークンが変更されたときにポップアップを自動的に非表示にする必要がある場合はtrueを返します。 |
19 |
boolean isGlassEnabled() ガラス要素がPopupPanelの下に表示される場合、trueを返します。 |
20 |
boolean isModal() PopupPanelまたはその子を対象としないキーボードイベントまたはマウスイベントを無視する必要がある場合、trueを返します。 |
21 |
boolean isPreviewingAllNativeEvents( ) ポップアップがすべてのネイティブイベントをプレビューする必要がある場合、イベントが別のポップアップによって既に消費されている場合でもtrueを返します。 |
22 |
boolean isShowing() このポップアップを表示するかどうかを決定します。 |
23 |
boolean isVisible() このポップアップが表示されるかどうかを決定します。 |
24 |
boolean onEventPreview(Event event) 廃止予定です。 onPreviewNativeEvent(com.google.gwt.user。を使用します。 代わりにclient.Event.NativePreviewEvent) |
25 |
boolean onKeyDownPreview(char key, int modifiers) 廃止予定です。 onPreviewNativeEvent(com.google.gwt.user。を使用します。 代わりにclient.Event.NativePreviewEvent) |
26 |
boolean onKeyPressPreview(char key, int modifiers) 廃止予定です。 onPreviewNativeEvent(com.google.gwt.user。を使用します。 代わりにclient.Event.NativePreviewEvent) |
27 |
boolean onKeyUpPreview(char key, int modifiers) 廃止予定です。 onPreviewNativeEvent(com.google.gwt.user。を使用します。 代わりにclient.Event.NativePreviewEvent) |
28 | *protected void onPreviewNativeEvent(Event.NativePreviewEvent event) * |
29 |
このメソッドは、ウィジェットがブラウザのドキュメントから切り離される直前に呼び出されます。 |
30 |
void removeAutoHidePartner(Element partner) autoHideパートナーを削除します。 |
31 |
void removePopupListener(PopupListener listener) 廃止予定です。 HandlerRegistrationを使用します。 addCloseHandler(com.google.gwt.event。によって返されたオブジェクトのremoveHandler()メソッド。 代わりにlogical.shared.CloseHandler) |
32 |
void setAnimationEnabled(boolean enable) アニメーションを有効または無効にします。 |
33 |
void setAutoHideEnabled(boolean autoHide) autoHide機能を有効または無効にします。 |
34 |
void setAutoHideOnHistoryEventsEnabled( boolean enabled) 履歴変更イベントのautoHideを有効または無効にします。 |
35 |
void setGlassEnabled(boolean enabled) 有効にすると、次に表示されるときに背景が半透明のペインでブロックされます。 |
36 |
void setGlassStyleName(java.lang.String glassStyleName) ガラス要素で使用されるスタイル名を設定します。 |
37 |
void setHeight(java.lang.String height) パネルの子ウィジェットの高さを設定します。 |
38 |
void setModal(boolean modal) ポップアップがモーダルの場合、PopupPanelまたはその子を対象としないキーボードまたはマウスイベントは無視されます。 |
39 |
void setPopupPosition(int left, int top) ブラウザのクライアント領域に対するポップアップの位置を設定します。 |
40 |
void setPopupPositionAndShow(PopupPanel. PositionCallback callback) PopupPanel.PositionCallbackを使用してポップアップの位置を設定し、ポップアップを表示します。 |
41 |
void setPreviewingAllNativeEvents(boolean previewAllNativeEvents) 有効にすると、ポップアップは、このイベントの後に別のポップアップが開かれた場合でも、すべてのネイティブイベントをプレビューします。 |
42 |
void setTitle(java.lang.String title) このオブジェクトに関連付けられたタイトルを設定します。 |
43 |
void setVisible(boolean visible) このオブジェクトが表示されるかどうかを設定します。 |
44 |
void setWidget(Widget w) このパネルのウィジェットを設定します。 |
45 |
void setWidth(java.lang.String width) パネルの子ウィジェットの幅を設定します。 |
46 |
void show() ポップアップを表示し、ページに添付します。 |
47 |
void showRelativeTo(UIObject target) 通常、ポップアップは相対ターゲットのすぐ下に配置され、その左端はターゲットの左端に揃えられます。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- 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.SimplePanel
- java.lang.Object
PopupPanelウィジェットの例
この例では、GWTでPopupPanelウィジェットの使用方法を示す簡単な手順を紹介します。 次の手順に従って、_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 の内容です。
PopupPanelウィジェットの使用法を示すJavaファイル src/com.finddevguides/HelloWorld.java の内容を見てみましょう。
すべての変更が完了したら、link:/gwt/gwt_create_application [GWT-アプリケーションの作成]の章で行ったように、アプリケーションをコンパイルして開発モードで実行します。 すべてがあなたのアプリケーションでうまくいけば、これは次の結果を生成します-