public interface ItsNatLabel extends ItsNatElementComponent
A label component contains a single object value, this value is rendered as markup using a special object, the renderer, and may be optionally edited "in place" using a user defined editor.
Any change to the internal value is notified with a "value" property change event
and may be vetoed (see setValue(Object)
. The new value, if accepted, is rendered
as markup.
This component family is the "componentized" version of ElementLabel
and
follows a similar philosophy.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEditorActivatorEvent()
Returns the event type used to activate the label edition process by the user.
|
ItsNatLabelEditor |
getItsNatLabelEditor()
Returns the current label editor.
|
ItsNatLabelRenderer |
getItsNatLabelRenderer()
Returns the current component renderer.
|
ItsNatLabelUI |
getItsNatLabelUI()
Returns the user interface manager of this component.
|
java.lang.Object |
getValue()
Returns the current value.
|
boolean |
isEditing()
Informs whether the label value is being edited.
|
boolean |
isEditingEnabled()
Informs whether the in place edition is enabled.
|
void |
setEditingEnabled(boolean value)
Enables or disables temporally the in place edition.
|
void |
setEditorActivatorEvent(java.lang.String eventType)
Sets the event type used to activate the label edition process by the user.
|
void |
setItsNatLabelEditor(ItsNatLabelEditor editor)
Sets the label editor.
|
void |
setItsNatLabelRenderer(ItsNatLabelRenderer renderer)
Sets the component renderer.
|
void |
setValue(java.lang.Object value)
Sets the value.
|
void |
startEditing()
Used to start programmatically the label edition process "in place".
|
getElement, getItsNatElementComponentUI
addEventListener, addEventListener, addEventListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, disableEventListener, disableEventListener, dispose, enableEventListener, enableEventListener, getArtifact, getArtifact, getItsNatComponentManager, getItsNatComponentUI, getItsNatDocument, getNode, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, isDisposed, isEnabled, registerArtifact, removeArtifact, removeEventListener, removeEventListener, removeEventListener, removeEventListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setEnabled, setEventListenerParams, setEventListenerParams, setNode
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
ItsNatLabelUI getItsNatLabelUI()
java.lang.Object getValue()
void setValue(java.lang.Object value) throws java.beans.PropertyVetoException
This new value is "voted" before is set firing a java.beans.PropertyChangeEvent
event, with name "value", sent to the listeners registered with ItsNatComponent.addVetoableChangeListener(VetoableChangeListener)
if some listener does a "veto" (throws a java.beans.PropertyVetoException
)
the new value is not set. If finally set the PropertyChangeEvent
event
is sent to the listeners registered with
ItsNatComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)
or ItsNatComponent.addPropertyChangeListener(String,java.beans.PropertyChangeListener)
with property name "value".
value
- value to display (and may be edit).java.beans.PropertyVetoException
- if the new value was vetoed.ItsNatLabelRenderer getItsNatLabelRenderer()
ItsNatComponentManager.createDefaultItsNatLabelRenderer()
)setItsNatLabelRenderer(ItsNatLabelRenderer)
void setItsNatLabelRenderer(ItsNatLabelRenderer renderer)
renderer
- the new renderer.getItsNatLabelRenderer()
ItsNatLabelEditor getItsNatLabelEditor()
ItsNatComponentManager.createDefaultItsNatLabelEditor(ItsNatComponent)
) with a null parameter.setItsNatLabelEditor(ItsNatLabelEditor)
void setItsNatLabelEditor(ItsNatLabelEditor editor)
This component automatically adds a listener calling
javax.swing.CellEditor.addCellEditorListener(javax.swing.event.CellEditorListener)
this way the component is informed when the editor stops or cancels editing.
The edition process starts programmatically by calling startEditing()
or by user action (usually double clicking the label or the action/event type
specified by getEditorActivatorEvent()
). Then the label markup
(below the parent element) is removed and the method
ItsNatLabelEditor.getLabelEditorComponent(ItsNatLabel,Object,Element)
is called, this method usually places the editor component inside the label.
Current label implementations do nothing with the editor component returned and may be null.
When the editor stops the component calls CellEditor.getCellEditorValue()
to obtain the new value and sets this value to the label (calling setValue(Object)
)
and the editor is removed and the original label markup is restored modified by the renderer
with the new value. If the editor is cancelled all is the same but no markup change is made.
editor
- the new editor. May be null (edition disabled).getItsNatLabelEditor()
void startEditing()
isEditing()
boolean isEditing()
startEditing()
java.lang.String getEditorActivatorEvent()
If returns null edition activated by events is disabled .
setEditorActivatorEvent(String)
void setEditorActivatorEvent(java.lang.String eventType)
eventType
- the event type used to activate the edition.getEditorActivatorEvent()
boolean isEditingEnabled()
setEditingEnabled(boolean)
void setEditingEnabled(boolean value)
value
- true to enable in place edition.isEditingEnabled()
Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.