|
|||||||||
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.Composite
com.maryanovsky.gwtutils.client.ui.Form
public class Form
A panel which manages most of the tedious work behind setting up a well-arranged and properly aligned form. A form consists of 3 main elements: a title, a set of named fields and a set of buttons.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Form()
Creates a new Form . |
Method Summary | |
---|---|
void |
addField(String name,
HasVerticalAlignment.VerticalAlignmentConstant nameVerticalAlignment,
HasHorizontalAlignment.HorizontalAlignmentConstant nameHorizontalAlignment,
Widget field,
HasVerticalAlignment.VerticalAlignmentConstant fieldVerticalAlignment,
HasHorizontalAlignment.HorizontalAlignmentConstant fieldHorizontalAlignment,
String suffix,
HasVerticalAlignment.VerticalAlignmentConstant suffixVerticalAlignment,
HasHorizontalAlignment.HorizontalAlignmentConstant suffixHorizontalAlignment)
Adds a field with the specified name and suffix. |
void |
addField(String name,
Widget field)
Adds a field with the specified name. |
void |
addField(String name,
Widget field,
String suffix)
Adds a field with the specified name and suffix. |
void |
addRelatedFieldGap()
Adds a related gap following the last field. |
void |
addUnrelatedFieldGap()
Adds an unrelated gap following the last field. |
int |
getFieldRow(Widget field)
Returns the index of the field with the specified widget; -1
if none. |
protected void |
onLoad()
Invoked when this widget is attached to the DOM. |
void |
removeField(Widget field)
Removes the specified field from the form. |
void |
removeRow(int row)
Removes the specified row. |
void |
setButtons(Button okButton,
Button cancelButton)
Sets the form buttons. |
void |
setClickOkOnEnter(boolean isClickOkOnEnter)
Sets whether the "OK" button will be clicked programmatically when the user hits ENTER. |
void |
setDefaultFocusedWidget(Focusable widget)
Sets the widget to get the focus by default. |
void |
setFieldVisible(Widget field,
boolean isVisible)
Sets the visibility of the specified field. |
void |
setFormTitle(String title)
Sets the title of this form. |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Form()
Form
.
Method Detail |
---|
public void setClickOkOnEnter(boolean isClickOkOnEnter)
public void setFormTitle(String title)
public void addField(String name, Widget field)
public void addField(String name, Widget field, String suffix)
public void addField(String name, HasVerticalAlignment.VerticalAlignmentConstant nameVerticalAlignment, HasHorizontalAlignment.HorizontalAlignmentConstant nameHorizontalAlignment, Widget field, HasVerticalAlignment.VerticalAlignmentConstant fieldVerticalAlignment, HasHorizontalAlignment.HorizontalAlignmentConstant fieldHorizontalAlignment, String suffix, HasVerticalAlignment.VerticalAlignmentConstant suffixVerticalAlignment, HasHorizontalAlignment.HorizontalAlignmentConstant suffixHorizontalAlignment)
null
alignments are interpreted as
HasVerticalAlignment.ALIGN_MIDDLE
. Horizontal null
alignments are interpreted as textual leading alignment, except that
field names are aligned to the trailing side.
public void addUnrelatedFieldGap()
public void addRelatedFieldGap()
public void setButtons(Button okButton, Button cancelButton)
null
.
public int getFieldRow(Widget field)
-1
if none.
public void removeField(Widget field)
public void removeRow(int row)
removeField(Widget)
, this
method can be used to remove gaps.
public void setFieldVisible(Widget field, boolean isVisible)
public void setDefaultFocusedWidget(Focusable widget)
protected void onLoad()
onLoad
in class Widget
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |