|
|||||||||
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.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.Editor
public class Editor
A base editor field that handles displaying/hiding on demand and has some built-in sizing and event handling logic.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Editor(Field field)
Creates a new editor. |
Method Summary | |
---|---|
void |
cancelEdit()
Cancels the editing process and hides the editor without persisting any changes. |
protected void |
cancelEdit(boolean remainVisible,
boolean revertInvalid)
|
void |
completeEdit()
Ends the editing process, persists the changed value to the underlying field, and hides the editor. |
protected void |
completeEdit(boolean remainVisible)
|
protected void |
doAttachChildren()
|
protected void |
doAutoSize()
|
protected void |
doDetachChildren()
|
java.lang.String |
getAlignment()
Returns the editor's alignment. |
Style.AutoSizeMode |
getAutoSizeMode()
Returns the auto size mode. |
Field |
getField()
Returns the editor's field. |
java.lang.Object |
getValue()
Returns the data value of the editor. |
boolean |
isAllowBlur()
Returns true if blurs are allowed. |
boolean |
isCancelOnEsc()
Returns true if cancel on escape is enabled. |
boolean |
isCancelOnInvalid()
Deprecated. duplicate method see isRevertInvalid() |
boolean |
isCompleteOnEnter()
Returns true if complete on enter is enabled. |
boolean |
isConstrain()
Returns true if the editor is constrained to the viewport. |
boolean |
isRevertInvalid()
Returns true of the editor reverts the value to the start value on invalid. |
boolean |
isSwallowKeys()
Returns true if key presses are being swallowed. |
boolean |
isUpdateEl()
Returns true if the inner HTML of the bound element is updated when the update is complete. |
protected void |
onBlur(FieldEvent fe)
|
protected void |
onDisable()
|
protected void |
onEnable()
|
protected void |
onHide()
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onResize(int width,
int height)
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs. |
protected void |
onShow()
|
protected void |
onSpecialKey(FieldEvent fe)
|
java.lang.Object |
postProcessValue(java.lang.Object value)
Called after the editor completes an edit. |
java.lang.Object |
preProcessValue(java.lang.Object value)
Called before the editor sets the value on the wrapped field. |
void |
realign()
Realigns the editor to the bound field based on the current alignment config value. |
void |
setAlignment(java.lang.String alignment)
The position to align to (see El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) for more details, defaults
to "c-c?"). |
void |
setAllowBlur(boolean allowBlur)
Sets whether editing should be cancelled when the field is blurred (defaults to false). |
void |
setAutoSizeMode(Style.AutoSizeMode autoSizeMode)
Sets the mode the editor gets sized by (defaults to AutoSizeMode.BOTH). |
void |
setCancelOnEsc(boolean cancelOnEsc)
True to cancel the edit when the escape key is pressed (defaults to false). |
void |
setCancelOnInvalid(boolean cancelOnInvalid)
Deprecated. duplicate method see setRevertInvalid(boolean) |
void |
setCompleteOnEnter(boolean completeOnEnter)
True to complete the edit when the enter key is pressed (defaults to false). |
void |
setConstrain(boolean constrain)
True to constrain the editor to the viewport. |
void |
setRevertInvalid(boolean revertInvalid)
True to automatically revert the field value and cancel the edit when the user completes an edit and the field validation fails (defaults to true). |
void |
setSwallowKeys(boolean swallowKeys)
Handle the keypress events so they don't propagate (defaults to true). |
void |
setUpdateEl(boolean updateEl)
True to update the innerHTML of the bound element when the update completes (defaults to false). |
void |
setValue(java.lang.Object value)
Sets the data value of the editor |
void |
startEdit(com.google.gwt.user.client.Element el,
java.lang.Object value)
Starts the editing process and shows the editor. |
protected void |
triggerBlur(TriggerField field)
|
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustPosition, adjustSize, afterRender, createComponentEvent, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Editor(Field field)
field
- the fieldMethod Detail |
---|
public void cancelEdit()
public void completeEdit()
public java.lang.String getAlignment()
public Style.AutoSizeMode getAutoSizeMode()
public Field getField()
public java.lang.Object getValue()
public boolean isAllowBlur()
public boolean isCancelOnEsc()
public boolean isCancelOnInvalid()
isRevertInvalid()
public boolean isCompleteOnEnter()
public boolean isConstrain()
public boolean isRevertInvalid()
public boolean isSwallowKeys()
public boolean isUpdateEl()
public java.lang.Object postProcessValue(java.lang.Object value)
value
- the value from the editor
public java.lang.Object preProcessValue(java.lang.Object value)
value
- the editor value
public void realign()
public void setAlignment(java.lang.String alignment)
El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[])
for more details, defaults
to "c-c?").
alignment
- the alignmentpublic void setAllowBlur(boolean allowBlur)
allowBlur
- true to allow blurpublic void setAutoSizeMode(Style.AutoSizeMode autoSizeMode)
autoSizeMode
- the autoSizeMode to setpublic void setCancelOnEsc(boolean cancelOnEsc)
cancelOnEsc
- true to cancel on escapepublic void setCancelOnInvalid(boolean cancelOnInvalid)
setRevertInvalid(boolean)
cancelOnInvalid
- true to cancel on invalidpublic void setCompleteOnEnter(boolean completeOnEnter)
completeOnEnter
- true to complete on enterpublic void setConstrain(boolean constrain)
constrain
- true to constrainpublic void setRevertInvalid(boolean revertInvalid)
revertInvalid
- true to revertpublic void setSwallowKeys(boolean swallowKeys)
swallowKeys
- true to swallow key press events.public void setUpdateEl(boolean updateEl)
updateEl
- true to update the inner HTMLpublic void setValue(java.lang.Object value)
value
- any valid value supported by the underlying fieldpublic void startEdit(com.google.gwt.user.client.Element el, java.lang.Object value)
el
- the element to editprotected void cancelEdit(boolean remainVisible, boolean revertInvalid)
protected void completeEdit(boolean remainVisible)
protected void doAttachChildren()
doAttachChildren
in class Component
protected void doAutoSize()
protected void doDetachChildren()
doDetachChildren
in class Component
protected void onBlur(FieldEvent fe)
protected void onDisable()
onDisable
in class Component
protected void onEnable()
onEnable
in class Component
protected void onHide()
onHide
in class BoxComponent
protected void onRender(com.google.gwt.user.client.Element target, int index)
Component
onRender
in class Component
target
- the target elementindex
- the insert locationprotected void onResize(int width, int height)
BoxComponent
onResize
in class BoxComponent
width
- the widthheight
- the heightprotected void onShow()
onShow
in class BoxComponent
protected void onSpecialKey(FieldEvent fe)
protected void triggerBlur(TriggerField field)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |