|
|||||||||
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.gwtext.client.widgets.Component
com.gwtext.client.widgets.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.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Editor()
|
|
Editor(Field field)
Create a new Editor. |
|
Editor(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addListener(EditorListener listener)
Add an Editor listener. |
void |
cancelEdit(boolean remainVisible)
Cancels the editing process and hides the editor without persisting any changes. |
void |
completeEdit(boolean remainVisible)
Ends the editing process, persists the changed value to the underlying field, and hides the editor. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
java.lang.Object |
getValue()
Gets the data value of the editor. |
java.lang.String |
getValueAsString()
Gets the data value of the editor. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
realign()
Realigns the editor to the bound field based on the current alignment config value. |
void |
setAlignment(java.lang.String anchorPosition)
The position to align to. |
void |
setAutosize(boolean autosize)
True for the editor to automatically adopt the size of the underlying field. |
void |
setAutosize(java.lang.String autosize)
Set to "width" to adopt the width only, or "height" to adopt the height only. |
void |
setCancelOnEsc(boolean cancelOnEsc)
True to cancel the edit when the escape key is pressed (defaults to false). |
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 |
setField(Field field)
|
void |
setHideEl(boolean hideEl)
False to keep the bound element visible while the editor is displayed (defaults to true). |
void |
setIgnoreNoChange(boolean ignoreNoChange)
True to skip the the edit completion process (no save, no events fired) if the user completes an edit and the value has not changed (defaults to false). |
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 |
setShadow(boolean shadow)
"sides" for sides/bottom only, "frame" for 4-way shadow, and "drop" for bottom-right shadow (defaults to "frame") |
void |
setShadow(java.lang.String shadow)
"sides" for sides/bottom only, "frame" for 4-way shadow, and "drop" for bottom-right shadow (defaults to "frame") |
void |
setSize(int width,
int height)
Sets the height and width of this editor. |
void |
setSwallowKeys(boolean swallowKeys)
Handle the keydown/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(boolean value)
The data value of the underlying field (defaults to ""). |
void |
setValue(java.util.Date value)
The data value of the underlying field (defaults to ""). |
void |
setValue(double value)
The data value of the underlying field (defaults to ""). |
void |
setValue(long value)
The data value of the underlying field (defaults to ""). |
void |
setValue(java.lang.String value)
The data value of the underlying field (defaults to ""). |
void |
setValueRendered(boolean value)
Sets the data value of the editor. |
void |
setValueRendered(java.util.Date value)
Sets the data value of the editor. |
void |
startEdit(com.google.gwt.user.client.Element el)
Starts the editing process and shows the editor. |
void |
startEdit(com.google.gwt.user.client.Element el,
java.lang.String value)
Starts the editing process and shows the editor. |
void |
startEdit(java.lang.String id)
Starts the editing process and shows the editor. |
void |
startEdit(java.lang.String id,
java.lang.String value)
Starts the editing process and shows the editor. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Editor()
public Editor(Field field)
field
- the editor fieldpublic Editor(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class Component
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Component
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Component
public void cancelEdit(boolean remainVisible)
remainVisible
- override the default behavior and keep the editor visible after cancel (defaults to false)public void completeEdit(boolean remainVisible)
remainVisible
- Override the default behavior and keep the editor visible after edit (defaults to false)public java.lang.String getValueAsString()
public java.lang.Object getValue()
public void realign()
public void setSize(int width, int height)
width
- the new widthheight
- the new heightpublic void setValueRendered(boolean value)
value
- the valuepublic void setValueRendered(java.util.Date value)
value
- the valuepublic void startEdit(java.lang.String id)
id
- the element ID to editpublic void startEdit(java.lang.String id, java.lang.String value)
id
- the element ID to editvalue
- A value to initialize the editor with. If a value is not provided, it defaults to the innerHTML of the element.public void startEdit(com.google.gwt.user.client.Element el)
el
- the element to editpublic void startEdit(com.google.gwt.user.client.Element el, java.lang.String value)
el
- the element to editvalue
- A value to initialize the editor with. If a value is not provided, it defaults to the innerHTML of the element.public void addListener(EditorListener listener)
listener
- the listenerpublic void setAlignment(java.lang.String anchorPosition)
anchorPosition
- defaults to "c-c"public void setAutosize(boolean autosize) throws java.lang.IllegalStateException
autosize
- true to autosize
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setAutosize(java.lang.String autosize) throws java.lang.IllegalStateException
autosize
- the autosize value
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setCancelOnEsc(boolean cancelOnEsc)
cancelOnEsc
- cancel on escapepublic void setCompleteOnEnter(boolean completeOnEnter)
completeOnEnter
- true to complete on enterpublic void setConstrain(boolean constrain) throws java.lang.IllegalStateException
constrain
- true to constrain the editor to the viewport
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setField(Field field)
public void setHideEl(boolean hideEl)
hideEl
- true to hide elementpublic void setIgnoreNoChange(boolean ignoreNoChange)
ignoreNoChange
- true to ingnore no changepublic void setRevertInvalid(boolean revertInvalid)
revertInvalid
- true to rever invalid field valuepublic void setShadow(boolean shadow) throws java.lang.IllegalStateException
shadow
- the shadow setting
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setShadow(java.lang.String shadow) throws java.lang.IllegalStateException
shadow
- the shadow setting
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setSwallowKeys(boolean swallowKeys) throws java.lang.IllegalStateException
swallowKeys
- true to swallow keys
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setUpdateEl(boolean updateEl)
updateEl
- true to update the elementpublic void setValue(java.lang.String value)
value
- the field valuepublic void setValue(java.util.Date value)
value
- the field valuepublic void setValue(long value)
value
- the field valuepublic void setValue(double value)
value
- the field valuepublic void setValue(boolean value)
value
- the field value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |