|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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
com.google.gwt.user.client.ui.PopupPanel
asquare.gwt.tk.client.ui.CPopupPanel
asquare.gwt.tk.client.ui.ModalDialog
public class ModalDialog
A modal dialog featuring:
GlassPanel" which blocks user interaction with
the page (also stylable for the "light box" effect). Caption style namefocus model. CPopupPanel.removeController(Controller) with
TabFocusController.class to disable built-in focus management.UIObject.setWidth(String) can result in a dialog which is wider than the
caption. Use setContentWidth(String) instead.
final Button showDialogButton = new Button("Focus management");
showDialogButton.addClickListener(new ClickListener()
{
public void onClick(Widget sender)
{
final ModalDialog inputDialog = new ModalDialog();
inputDialog.setCaption("Input", false);
inputDialog.add(new Label("Enter a value"));
inputDialog.add(new TextBox());
inputDialog.add(new Button("OK", new ClickListener()
{
public void onClick(Widget sender)
{
inputDialog.hide();
}
}));
inputDialog.show(showDialogButton);
}
});
| Nested Class Summary | |
|---|---|
protected class |
ModalDialog.CaptionWrapper
Provides event support for the caption element. |
static class |
ModalDialog.FocusOnCloseController
A controller which focuses a widget when the dialog is hidden. |
static class |
ModalDialog.InitializeFocusController
Sets the initial focus when the dialog is shown. |
static class |
ModalDialog.PositionDialogController
A controller which encapsulates dialog sizing and positioning logic. |
static class |
ModalDialog.PositionDialogControllerIE6
|
| Field Summary | |
|---|---|
protected static com.google.gwt.user.client.ui.impl.FocusImpl |
s_focusImpl
|
static String |
STYLENAME_CAPTION
|
static String |
STYLENAME_CONTENT
|
static String |
STYLENAME_DIALOG
|
static String |
STYLENAME_DRAGGING
|
static String |
STYLENAME_GLASSPANEL
|
| Constructor Summary | |
|---|---|
ModalDialog()
|
|
| Method Summary | |
|---|---|
void |
add(Widget w)
Adds a widget to the content area of this dialog. |
protected List |
createCaptionControllers()
A factory method which gives a subclass the opportunity to override default controller creation. |
protected List |
createControllers()
A factory method which gives a subclass the opportunity to override default controller creation. |
Element |
getContentElement()
Get the element that forms the content area of the dialog. |
int |
getContentMinHeight()
Get the minimum height of the content panel. |
int |
getContentMinWidth()
Get the minimum width of the content panel. |
int |
getContentOffsetHeight()
Get the actual height of the content panel. |
int |
getContentOffsetWidth()
Get the actual width of the content panel. |
FocusModel |
getFocusModel()
Get the focus model for this dialog. |
HasFocus |
getFocusOnCloseWidget()
Get the widget which will be focused after the dialog is closed. |
GlassPanel |
getGlassPanel()
Get the GlassPanel which is displayed behind the dialog. |
void |
hide()
Detaches the dialog from the DOM (it will be garbage collected if there are no references to it). |
protected void |
onAttach()
|
protected void |
onDetach()
|
boolean |
remove(Widget w)
Removes a widget from the content area of this dialog. |
void |
setCaption(String text,
boolean asHtml)
Sets the contents of the caption to the specified text, clearing any previous contents from the caption. |
void |
setCaption(Widget w)
Set a widget as the sole child of the caption, clearing any previous contents from the caption. |
void |
setContentHeight(String height)
Set the desired height of the content panel. |
void |
setContentMinHeight(int minHeight)
Set the minimum height of the content panel. |
void |
setContentMinWidth(int minWidth)
Set the minimum width of the content panel. |
void |
setContentWidth(String width)
Set the desired width of the content panel. |
void |
setFocusModel(FocusModel focusModel)
Set the focus model for this dialog. |
void |
setWidget(Widget w)
Not supported. |
void |
show()
Shows the glasspanel and dialog then focuses the widget selected in the focus model. |
void |
show(HasFocus focusOnCloseWidget)
Shows the glasspanel and dialog then focuses the widget selected in the focus model. |
| Methods inherited from class asquare.gwt.tk.client.ui.CPopupPanel |
|---|
addController, getController, onBrowserEvent, onEventPreview, removeController, setControllers, sinkEvents, unsinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.PopupPanel |
|---|
addPopupListener, getPopupLeft, getPopupTop, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, removePopupListener, setPopupPosition |
| Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
|---|
getContainerElement, getWidget, iterator |
| Methods inherited from class com.google.gwt.user.client.ui.Panel |
|---|
adopt, clear, disown |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
getParent, isAttached, onLoad, removeFromParent |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String STYLENAME_DIALOG
public static final String STYLENAME_GLASSPANEL
public static final String STYLENAME_CAPTION
public static final String STYLENAME_CONTENT
public static final String STYLENAME_DRAGGING
protected static final com.google.gwt.user.client.ui.impl.FocusImpl s_focusImpl
| Constructor Detail |
|---|
public ModalDialog()
| Method Detail |
|---|
protected List createControllers()
CPopupPanel
createControllers in class CPopupPanelnullprotected List createCaptionControllers()
nullpublic FocusModel getFocusModel()
public void setFocusModel(FocusModel focusModel)
public int getContentMinHeight()
public void setContentMinHeight(int minHeight)
75 px.
Set to 0 to disable this feature.
minHeight - the minimum height in pixelspublic int getContentMinWidth()
public void setContentMinWidth(int minWidth)
200 px.
Set to 0 to disable this feature.
minWidth - the minimum width in pixelspublic void setContentWidth(String width)
width - the width in CSS measurementspublic void setContentHeight(String height)
height - the height in CSS measurementspublic int getContentOffsetWidth()
public int getContentOffsetHeight()
public void add(Widget w)
add in interface HasWidgetsadd in class SimplePanelw - a widgetpublic void setWidget(Widget w)
add(Widget) instead.
setWidget in class SimplePanelUnsupportedOperationExceptionpublic boolean remove(Widget w)
setCaption(null) instead.
remove in interface HasWidgetsremove in class PopupPanelw - the widget to remove
IllegalArgumentException - if w is in the caption.
public void setCaption(String text,
boolean asHtml)
text - the caption textasHtml - true to treat text as htmlsetCaption(Widget)public void setCaption(Widget w)
w - a widgetpublic Element getContentElement()
public GlassPanel getGlassPanel()
public HasFocus getFocusOnCloseWidget()
nullpublic void show()
show in class PopupPanelpublic void show(HasFocus focusOnCloseWidget)
focusOnCloseWidget - a widget to focus after this dialog is closedpublic void hide()
hide in class PopupPanelPopupPanel.hide()protected void onAttach()
onAttach in class CPopupPanelprotected void onDetach()
onDetach in class CPopupPanel
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||