|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo2.app.Component
nextapp.echo2.app.Label
echopointng.LabelEx
echopointng.EditableLabelEx
public class EditableLabelEx
EditableLabelEx is a Label component that can contain other
child components and when the user clicks on the Label, the underlying (and
hidden) child components will be shown.
So for example imagine a EditableLabelEx that contained a
TextField as a child. When the user clicks on the Label, the
TextField will be shown and the user can edit its contents.
This component uses the concept of a target component to allow
it to source its Text from. Any number of components can be added to the
EditableLabelEx however only the text of the
target component will be synchronised.
And this target can be a grand child of the EditableLabelEx.
For example if you added a DateField to the EditableLabelEx then
you would set the target to be the TextField part of the
DateField, since this is the bit you want to "edit" not the
drop down part.
The editing function is "ended" when the user moves away from the editing target or clicks some where else on the page. If the target is a TextComponent, then pressing escape can restore the value back to what it was before editing proceeded.
| Field Summary | |
|---|---|
static int |
ACTIVATE_ON_DBLCLICK
|
static int |
ACTIVATE_ON_DELAYEDCLICK
|
static Style |
DEFAULT_STYLE
|
static java.lang.String |
PROPERTY_ACTIVATION_METHOD
|
static java.lang.String |
PROPERTY_SYNCHRONIZED_WITH_TARGET
|
| Fields inherited from class nextapp.echo2.app.Label |
|---|
PROPERTY_ICON, PROPERTY_ICON_TEXT_MARGIN, PROPERTY_TEXT, PROPERTY_TEXT_ALIGNMENT, PROPERTY_TEXT_POSITION, PROPERTY_TOOL_TIP_TEXT |
| Fields inherited from interface echopointng.able.Borderable |
|---|
PROPERTY_BORDER |
| Fields inherited from interface echopointng.able.Widthable |
|---|
PROPERTY_WIDTH |
| Fields inherited from interface echopointng.able.Heightable |
|---|
PROPERTY_HEIGHT |
| Fields inherited from interface echopointng.able.Insetable |
|---|
DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS |
| Fields inherited from interface echopointng.able.AccessKeyable |
|---|
PROPERTY_ACCESS_KEY |
| Fields inherited from interface echopointng.able.MouseCursorable |
|---|
CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI |
| Fields inherited from interface echopointng.able.ToolTipable |
|---|
PROPERTY_TOOL_TIP_TEXT |
| Constructor Summary | |
|---|---|
EditableLabelEx()
Constructs a EditableLabelEx with no target component. |
|
EditableLabelEx(Component target)
Constructs a EditableLabelEx and sets the specified
component as its target. |
|
| Method Summary | |
|---|---|
int |
getActivationMethod()
|
Component |
getTarget()
|
java.lang.String |
getText()
Returns the text of the label. |
boolean |
isSynchronisedWithTarget()
|
boolean |
isValidChild(Component component)
This component does not support children. |
void |
processInput(java.lang.String inputName,
java.lang.Object inputValue)
Processes client input specific to the Component
received from the UpdateManager. |
void |
setActivationMethod(int newValue)
Sets the activation method for editing. |
void |
setSynchronisedWithTarget(boolean newValue)
If this is true, then the Label's value will be syncrhnonised with its target component. |
void |
setTarget(Component target)
Sets the current target of the EditableLabelEx. if this
is not already a child of the EditableLabelEx, then it
will be added as one. |
protected void |
synchroniseWithTarget()
This method is called internally to "synchronise" the value of the EditableLabelEx with its target component. |
void |
validate()
A life-cycle method invoked before the component is rendered to ensure it is in a valid state. |
| Methods inherited from class nextapp.echo2.app.Label |
|---|
getIcon, getIconTextMargin, getTextAlignment, getTextPosition, getToolTipText, setIcon, setIconTextMargin, setText, setTextAlignment, setTextPosition, setToolTipText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.Delegateable |
|---|
getRenderProperty, getRenderProperty |
| Methods inherited from interface echopointng.able.ToolTipable |
|---|
getToolTipText, setToolTipText |
| Field Detail |
|---|
public static final int ACTIVATE_ON_DBLCLICK
public static final int ACTIVATE_ON_DELAYEDCLICK
public static final java.lang.String PROPERTY_SYNCHRONIZED_WITH_TARGET
public static final java.lang.String PROPERTY_ACTIVATION_METHOD
public static final Style DEFAULT_STYLE
| Constructor Detail |
|---|
public EditableLabelEx()
EditableLabelEx with no target component.
public EditableLabelEx(Component target)
EditableLabelEx and sets the specified
component as its target.
target - -
the target of the EditableLabelEx| Method Detail |
|---|
public void processInput(java.lang.String inputName,
java.lang.Object inputValue)
ComponentComponent
received from the UpdateManager.
Derivative implementations should take care to invoke
super.processInput().
processInput in class ComponentinputName - the name of the inputinputValue - the value of the inputComponent.processInput(java.lang.String,
java.lang.Object)public Component getTarget()
EditableLabelEx.public void setTarget(Component target)
EditableLabelEx. if this
is not already a child of the EditableLabelEx, then it
will be added as one.
target - The target to set.public boolean isValidChild(Component component)
Label
isValidChild in class Labelcomponent - the Component to evaluate as a child
Component is a valid childLabel.isValidChild(nextapp.echo2.app.Component)protected void synchroniseWithTarget()
EditableLabelEx with its target component.
The default implementation will look to see if the component has a String getText() method and use that to set the text of the Label to be the same as its target.
You can overrride this method to synchronise the Label with any type of component. This method may be called multiple times and the target may be null so take this into account.
public boolean isSynchronisedWithTarget()
public java.lang.String getText()
Label
getText in class LabelLabel.getText()public void setSynchronisedWithTarget(boolean newValue)
newValue - -
the new state of the boolean flagpublic int getActivationMethod()
public void setActivationMethod(int newValue)
newValue - - the new activation methodpublic void validate()
Componentsuper.validate()
out of convention.
validate in class ComponentComponent.validate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||