|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.model.ui.AbstractPresentationModel
com.guiseframework.component.AbstractComponent
com.guiseframework.component.AbstractCompositeComponent
com.guiseframework.component.AbstractMultipleCompositeComponent
com.guiseframework.component.AbstractListCompositeComponent
com.guiseframework.component.AbstractLayoutComponent
com.guiseframework.component.AbstractContainer
com.guiseframework.component.AbstractContainerControl
com.guiseframework.component.AbstractEditComponentTextControl<EC>
EC - The type of component being edited.public abstract class AbstractEditComponentTextControl<EC extends Component>
Control that allows some component text property to be edited in-place.
Editing can be started by calling setMode(AbstractEditComponentTextControl.Mode) with AbstractEditComponentTextControl.Mode.EDIT.
This class binds a single left mouse click input to getEditActionPrototype(),
the command ProcessCommand.CONTINUE to getAcceptActionPrototype(),
and the command ProcessCommand.ABORT to getRejectActionPrototype().
| Nested Class Summary | |
|---|---|
static class |
AbstractEditComponentTextControl.Mode
The mode of this component; whether the component is being edited. |
| Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent |
|---|
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Control |
|---|
Control.Status |
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.component.ModalComponent |
|---|
MODE_PROPERTY |
| Fields inherited from interface com.guiseframework.component.EditComponent |
|---|
EDITABLE_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Component |
|---|
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Displayable |
|---|
DISPLAYED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.InfoModel |
|---|
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY |
| Fields inherited from interface com.guiseframework.model.LabelModel |
|---|
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY |
| Fields inherited from interface com.guiseframework.component.LayoutComponent |
|---|
LAYOUT_PROPERTY, LAYOUT_THEME_APPLIED_PROPERTY |
| Fields inherited from interface com.guiseframework.component.Control |
|---|
STATUS_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Enableable |
|---|
ENABLED_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractEditComponentTextControl(EC editedComponent,
java.lang.String editedProperty,
ValueControl<java.lang.String> editControl,
Flow flow)
Edited component, value control, and flow constructor. |
|
| Method Summary | |
|---|---|
void |
acceptEdit()
Accepts edits. |
protected void |
acceptEdit(java.lang.String text)
Accepts edits with the given text. |
void |
addEditListener(EditListener editListener)
Adds an edit listener. |
void |
deleteLabel()
Removes the current label by setting it to null. |
void |
editLabel()
Initiates editing. |
protected void |
fireEdited()
Fires an edit event to all registered edit listeners. |
protected void |
fireEdited(EditEvent editEvent)
Fires a given edit event to all registered edit listeners. |
ActionPrototype |
getAcceptActionPrototype()
|
ActionPrototype |
getDeleteActionPrototype()
|
ActionPrototype |
getEditActionPrototype()
|
ValueControl<java.lang.String> |
getEditControl()
The control used to edit the text. |
EC |
getEditedComponent()
The component the text of which is to be edited. |
AbstractEditComponentTextControl.Mode |
getMode()
|
ActionPrototype |
getRejectActionPrototype()
|
protected abstract java.lang.String |
getText(EC editedComponent)
Retrieves the text from the edited component. |
boolean |
isEditable()
|
void |
rejectEdit()
Cancels edits. |
void |
removeEditListener(EditListener editListener)
Removes an edit listener. |
void |
setEditable(boolean newEditable)
Sets whether the value is editable and the component will allow the the user to change the value. |
void |
setMode(AbstractEditComponentTextControl.Mode newMode)
Sets the mode of interaction. |
protected abstract void |
setText(EC editedComponent,
java.lang.String newText)
Updates the text of the edited component. |
protected void |
update()
Update the states of the components and prototypes based upon the current state of the component. |
| Methods inherited from class com.guiseframework.component.AbstractContainerControl |
|---|
determineStatus, getEnableable, getStatus, isEnabled, reset, setEnabled, setNotification, setStatus, updateStatus, updateValid |
| Methods inherited from class com.guiseframework.component.AbstractContainer |
|---|
add, add, add, add, add, add, add, add, clear, contains, createComponent, get, getChildComponents, indexOf, isEmpty, iterator, lastIndexOf, remove, remove, setChildren, setLayout, size |
| Methods inherited from class com.guiseframework.component.AbstractLayoutComponent |
|---|
addComponent, applyTheme, applyTheme, getLayout, isLayoutThemeApplied, removeComponent, resetTheme, setLayoutThemeApplied, updateTheme |
| Methods inherited from class com.guiseframework.component.AbstractListCompositeComponent |
|---|
addComponent, getComponentList, hasChildComponents |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
depict, getDepictID, getSession, processEvent |
| Methods inherited from interface com.guiseframework.model.InfoModel |
|---|
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType |
| Methods inherited from interface com.guiseframework.model.LabelModel |
|---|
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType |
| Methods inherited from interface com.guiseframework.component.Container |
|---|
add, add, add, add, add, add, add, clear, contains, get, indexOf, isEmpty, lastIndexOf, remove, remove, setLayout, size |
| Methods inherited from interface com.guiseframework.component.LayoutComponent |
|---|
getLayout, isLayoutThemeApplied, setLayoutThemeApplied |
| Methods inherited from interface com.guiseframework.component.CompositeComponent |
|---|
addCompositeComponentListener, getChildComponents, hasChildComponents, removeCompositeComponentListener |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Constructor Detail |
|---|
public AbstractEditComponentTextControl(EC editedComponent,
java.lang.String editedProperty,
ValueControl<java.lang.String> editControl,
Flow flow)
editedComponent - The component the text of which is to be edited.editedProperty - The component property that will be affected when the text changes.editControl - The control used to edit the text.flow - The logical axis (line or page) along which information is flowed.
java.lang.NullPointerException - if the edited component, value control, text property, and/or flow axis is null.| Method Detail |
|---|
public boolean isEditable()
isEditable in interface EditComponentpublic void setEditable(boolean newEditable)
Boolean.
setEditable in interface EditComponentnewEditable - true if the component should allow the user to change the value.EditComponent.EDITABLE_PROPERTYpublic AbstractEditComponentTextControl.Mode getMode()
getMode in interface ModalComponent<AbstractEditComponentTextControl.Mode>null if the component is in a modeless state.public void setMode(AbstractEditComponentTextControl.Mode newMode)
AbstractEditComponentTextControl.Mode.EDIT initiates the editing process; changing the mode from AbstractEditComponentTextControl.Mode.EDIT clears the value from the edit control.
If the mode changes, this method will call update().
setMode in interface ModalComponent<AbstractEditComponentTextControl.Mode>newMode - The new mode of component interaction.
java.lang.IllegalStateException - If editing is initiated and the current text of the component cannot be edited in the edit control.ModalComponent.MODE_PROPERTYpublic EC getEditedComponent()
public ValueControl<java.lang.String> getEditControl()
public ActionPrototype getEditActionPrototype()
public ActionPrototype getAcceptActionPrototype()
public ActionPrototype getRejectActionPrototype()
public ActionPrototype getDeleteActionPrototype()
public void editLabel()
public void acceptEdit()
acceptEdit(String).
getMode()protected void acceptEdit(java.lang.String text)
text - The edited text to accept.getMode(),
setText(Component, String)public void rejectEdit()
public void deleteLabel()
null.
protected void update()
update in class AbstractComponentprotected abstract java.lang.String getText(EC editedComponent)
editedComponent - The component the text of which is to be edited.
protected abstract void setText(EC editedComponent,
java.lang.String newText)
editedComponent - The component the text of which is to be edited.newText - The new text to set in the edited component.public void addEditListener(EditListener editListener)
addEditListener in interface EditListenableeditListener - The edit listener to add.public void removeEditListener(EditListener editListener)
removeEditListener in interface EditListenableeditListener - The edit listener to remove.protected void fireEdited()
fireEdited(EditEvent).
EditListener,
EditEventprotected void fireEdited(EditEvent editEvent)
editEvent - The edit event to fire.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||