public class EEFTextLifecycleManager extends AbstractEEFWidgetLifecycleManager
Modifier and Type | Class and Description |
---|---|
static class |
EEFTextLifecycleManager.ConflictResolutionMode
The different ways an edition conflict can be resolved.
|
editingContextAdapter, help, interpreter, label, VALIDATION_MARKER_OFFSET, variableManager
container
Constructor and Description |
---|
EEFTextLifecycleManager(EEFTextDescription description,
org.eclipse.sirius.common.interpreter.api.IVariableManager variableManager,
org.eclipse.sirius.common.interpreter.api.IInterpreter interpreter,
EditingContextAdapter editingContextAdapter)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
aboutToBeHidden()
Prepares for the widgets to be hidden.
|
void |
aboutToBeShown()
Prepares for the widgets to be shown.
|
protected java.lang.String |
askUserToResolveConflict(org.eclipse.swt.widgets.Shell shell,
java.lang.String originalValue,
java.lang.String localEditedVersion,
java.lang.String newValueFromModel)
Open a simple dialog to inform the user of a conflict and ask him which version to keep.
|
protected void |
createMainControl(org.eclipse.swt.widgets.Composite parent,
IEEFFormContainer formContainer)
Create the main control.
|
protected IEEFWidgetController |
getController()
Returns the controller.
|
protected int |
getLabelVerticalAlignment()
Returns the vertical alignment of the label of the widget.
|
protected org.eclipse.swt.widgets.Control |
getValidationControl()
Returns the control on which the validation marker will appear.
|
protected EEFWidgetDescription |
getWidgetDescription()
Returns the description of the widget.
|
protected void |
lockedByOther()
Sets the appearance and behavior of the widget in order to indicate that the semantic element used by the widget
is currently locked by another user.
|
protected void |
notifyTextLossOnLock(java.lang.String userInput,
java.lang.String textFromModel)
Notify the end user that his current input will be lost as the underlying widget (and model element) has been
locked by a remote/async change.
|
protected java.lang.String |
resolveEditionConflict(org.eclipse.swt.widgets.Shell shell,
java.lang.String originalValue,
java.lang.String localEditedVersion,
java.lang.String newValueFromModel)
Handle conflicts between un-commited changes in the widget and concurrent changes in the model that produce a
different value than the original one seen by the user.
|
protected void |
setEnabled(boolean isEnabled)
Sets the enablement of the widget.
|
createControl, dispose, getEEFStyleHelper, getStructuredSelection, getWidgetSemanticElement, isEnabled, lockedByMe, lockedNoWrite, needSeparatedLabel, refresh, setLabelFontStyle, unlocked
public EEFTextLifecycleManager(EEFTextDescription description, org.eclipse.sirius.common.interpreter.api.IVariableManager variableManager, org.eclipse.sirius.common.interpreter.api.IInterpreter interpreter, EditingContextAdapter editingContextAdapter)
description
- The descriptionvariableManager
- The variable managerinterpreter
- The interpretereditingContextAdapter
- The editing context adapterprotected void createMainControl(org.eclipse.swt.widgets.Composite parent, IEEFFormContainer formContainer)
createMainControl
in class AbstractEEFWidgetLifecycleManager
parent
- The composite parentformContainer
- The form containerAbstractEEFWidgetLifecycleManager.createMainControl(org.eclipse.swt.widgets.Composite,
org.eclipse.eef.common.ui.api.IEEFFormContainer)
protected int getLabelVerticalAlignment()
getLabelVerticalAlignment
in class AbstractEEFWidgetLifecycleManager
AbstractEEFWidgetLifecycleManager.getLabelVerticalAlignment()
protected IEEFWidgetController getController()
getController
in class AbstractEEFWidgetLifecycleManager
AbstractEEFWidgetLifecycleManager.getController()
protected EEFWidgetDescription getWidgetDescription()
getWidgetDescription
in class AbstractEEFWidgetLifecycleManager
org.eclipse.eef.ide.ui.internal.widgets.AbstractEEFWidgetLifecycleManager#getWidgetDescription()
public void aboutToBeShown()
aboutToBeShown
in interface IEEFLifecycleManager
aboutToBeShown
in class AbstractEEFWidgetLifecycleManager
IEEFLifecycleManager.aboutToBeShown()
protected java.lang.String resolveEditionConflict(org.eclipse.swt.widgets.Shell shell, java.lang.String originalValue, java.lang.String localEditedVersion, java.lang.String newValueFromModel)
shell
- the shell to use if user interaction is needed.originalValue
- the original, common value, before the user started editing and before the concurrent model change
produced a new text.localEditedVersion
- the value as edited by the user, and seen in the UI.newValueFromModel
- the new value produced from the new model state.protected java.lang.String askUserToResolveConflict(org.eclipse.swt.widgets.Shell shell, java.lang.String originalValue, java.lang.String localEditedVersion, java.lang.String newValueFromModel)
shell
- the shell to use if user interaction is needed.originalValue
- the original, common value, before the user started editing and before the concurrent model change
produced a new text.localEditedVersion
- the value as edited by the user, and seen in the UI.newValueFromModel
- the new value produced from the new model state.protected org.eclipse.swt.widgets.Control getValidationControl()
getValidationControl
in class AbstractEEFLifecycleManager
AbstractEEFLifecycleManager.getValidationControl()
public void aboutToBeHidden()
aboutToBeHidden
in interface IEEFLifecycleManager
aboutToBeHidden
in class AbstractEEFWidgetLifecycleManager
IEEFLifecycleManager.aboutToBeHidden()
protected void lockedByOther()
AbstractEEFWidgetLifecycleManager
lockedByOther
in class AbstractEEFWidgetLifecycleManager
protected void notifyTextLossOnLock(java.lang.String userInput, java.lang.String textFromModel)
userInput
- the current text entered by the user.textFromModel
- the text that will replace the current input.protected void setEnabled(boolean isEnabled)
setEnabled
in class AbstractEEFWidgetLifecycleManager
isEnabled
- true
when the widget should have its default behavior, false
when the widget
should be in a read only mode.AbstractEEFWidgetLifecycleManager.setEnabled(boolean)