|
||||||||||
| 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
org.gwtwidgets.client.ui.EditableLabel
public class EditableLabel
Editable Label class, funcionality displays a Label UI Element until clicked on, then if element is set to be editable (default) then an editable area and Buttons are displayed instead. If the Label is not set to be word wrapped (default) then the editable area is a Text Box and clicking the OK button or hitting return key in the TextBox will display the Label with the updated text. If the Label is set to be word wrapped, using the setWordWrap(boolean) method, then the editable area is a Text Area and clicking the OK button will display the Label with the updated text. In both cases, clicking Cancel button or hitting Escape key in the TextBox/TextArea then the Label is displayed with original text.
| Constructor Summary | |
|---|---|
EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate)
Constructor that uses default text values for buttons. |
|
EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
boolean wordWrap)
Constructor that uses default text values for buttons and sets the word wrap property. |
|
EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
java.lang.String okText,
java.lang.String cancelText)
Constructor that changes default button text. |
|
EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
java.lang.String okText,
java.lang.String cancelText,
boolean wordWrap)
Constructor that changes default text for buttons and allows the setting of the wordwrap property directly. |
|
| Method Summary | |
|---|---|
void |
cancelLabelChange()
Sets the Label text to the original value, restores the display. |
protected com.google.gwt.user.client.ui.Widget |
createCancelButton(java.lang.String cancelButtonText)
|
protected com.google.gwt.user.client.ui.Widget |
createConfirmButton(java.lang.String okButtonText)
|
int |
getMaxLength()
Get maximum length of editable area. |
java.lang.String |
getText()
Return the text value of the Label |
int |
getVisibleLength()
Get the visible length of the editable area. |
int |
getVisibleLines()
Get the number of Visible Lines of editable area of a word-wrapped editable Label. |
boolean |
getWordWrap()
Return whether the Label is word wrapped or not. |
boolean |
isFieldEditable()
Returns the value of the isEditable flag. |
boolean |
isInEditingMode()
Returns the value of the isEditing flag, allowing outside users to see if the Label is being edited or not. |
void |
setEditable(boolean flag)
Allows the setting of the isEditable flag, marking the label as editable or not. |
void |
setMaxLength(int length)
Set maximum length of editable area. |
void |
setText(java.lang.String newText)
Set the text value of the Label |
void |
setVisibleLength(int length)
Set the visible length of the editable area. |
void |
setVisibleLines(int number)
Sets the number of visible lines for a word-wrapped editable label. |
void |
setWordWrap(boolean b)
Set the word wrapping on the label (if word wrapped then the editable field becomes a TextArea, if not then the editable field is a TextBox. |
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
getElement, getWidget, initWidget, isAttached, onAttach, onDetach, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
doAttachChildren, doDetachChildren, getParent, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
java.lang.String okText,
java.lang.String cancelText,
boolean wordWrap)
labelText - The initial text of the label.onUpdate - Handler object for performing actions once label is updated.okText - Text for use in overiding the default OK button text.cancelText - Text for use in overiding the default CANCEL button text.wordWrap - Boolean representing if the label should be word wrapped or not
public EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
boolean wordWrap)
labelText - The initial text of the label.onUpdate - Handler object for performing actions once label is updated.wordWrap - Boolean representing if the label should be word wrapped or not
public EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate,
java.lang.String okText,
java.lang.String cancelText)
labelText - The initial text of the label.onUpdate - Handler object for performing actions once label is updated.okText - Text for use in overiding the default OK button text.cancelText - Text for use in overiding the default CANCEL button text.
public EditableLabel(java.lang.String labelText,
com.google.gwt.user.client.ui.ChangeListener onUpdate)
labelText - The initial text of the label.onUpdate - Handler object for performing actions once label is updated.| Method Detail |
|---|
public void setEditable(boolean flag)
flag - True or False value depending if the Label is to be editable or notpublic boolean isFieldEditable()
public boolean isInEditingMode()
public void cancelLabelChange()
protected com.google.gwt.user.client.ui.Widget createCancelButton(java.lang.String cancelButtonText)
cancelButtonText - protected com.google.gwt.user.client.ui.Widget createConfirmButton(java.lang.String okButtonText)
okButtonText - public void setWordWrap(boolean b)
setWordWrap in interface com.google.gwt.user.client.ui.HasWordWrapb - Boolean value, true means Label is word wrapped, false means it is not.public boolean getWordWrap()
getWordWrap in interface com.google.gwt.user.client.ui.HasWordWrappublic java.lang.String getText()
getText in interface com.google.gwt.user.client.ui.HasTextpublic void setText(java.lang.String newText)
setText in interface com.google.gwt.user.client.ui.HasTextpublic void setVisibleLines(int number)
number - Number of visible lines.
java.lang.RuntimeException - if the editable label is not word-wrapped.public int getVisibleLines()
java.lang.RuntimeException - If the Label is not word-wrapped.public void setMaxLength(int length)
length - Length of editable area.public int getMaxLength()
public void setVisibleLength(int length)
RuntimeExcpetion - If editable label is word wrapped.public int getVisibleLength()
RuntimeExcpetion - If editable label is word wrapped.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||