org.eclipse.gmf.tooling.runtime.directedit
Class WrapTextCellEditor

java.lang.Object
  extended by org.eclipse.jface.viewers.CellEditor
      extended by org.eclipse.jface.viewers.TextCellEditor
          extended by org.eclipse.gmf.tooling.runtime.directedit.WrapTextCellEditor
All Implemented Interfaces:
CellEditorEx

public class WrapTextCellEditor
extends org.eclipse.jface.viewers.TextCellEditor

A cell editor that manages a multiline wrappable text entry field. The cell editor's value is the text string itself.

This class may be instantiated; it is not intended to be subclassed.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.viewers.CellEditor
org.eclipse.jface.viewers.CellEditor.LayoutData
 
Field Summary
 
Fields inherited from class org.eclipse.jface.viewers.TextCellEditor
text
 
Fields inherited from class org.eclipse.jface.viewers.CellEditor
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
 
Constructor Summary
WrapTextCellEditor()
          Creates a new text string cell editor with no control The cell editor value is the string itself, which is initially the empty string.
WrapTextCellEditor(org.eclipse.swt.widgets.Composite parent)
          Creates a new text string cell editor parented under the given control.
WrapTextCellEditor(org.eclipse.swt.widgets.Composite parent, int style)
          Creates a new text string cell editor parented under the given control.
 
Method Summary
 void deactivate()
           
protected  void doSetValue(Object value)
           
 boolean hasValueChanged()
           
 boolean isDeactivationLocked()
          Returns true if deactivation has been locked
protected  void keyReleaseOccured(org.eclipse.swt.events.KeyEvent keyEvent)
           
 void setDeactivationLock(boolean deactivationLock)
          Sets deactivation lock so that the cell editor does not perform deactivate
 void setValueAndProcessEditOccured(Object value)
          This will be used when an edit has occurred by a ModifyEvent has been been send.
 
Methods inherited from class org.eclipse.jface.viewers.TextCellEditor
createControl, dependsOnExternalFocusListener, doGetValue, doSetFocus, editOccured, getLayoutData, handleDefaultSelection, isCopyEnabled, isCutEnabled, isDeleteEnabled, isPasteEnabled, isSaveAllEnabled, isSelectAllEnabled, performCopy, performCut, performDelete, performPaste, performSelectAll
 
Methods inherited from class org.eclipse.jface.viewers.CellEditor
activate, activate, addListener, addPropertyChangeListener, create, deactivate, dispose, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, focusLost, getControl, getDoubleClickTimeout, getErrorMessage, getStyle, getValidator, getValue, isActivated, isCorrect, isDirty, isFindEnabled, isRedoEnabled, isUndoEnabled, isValueValid, markDirty, performFind, performRedo, performUndo, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapTextCellEditor

public WrapTextCellEditor()
Creates a new text string cell editor with no control The cell editor value is the string itself, which is initially the empty string. Initially, the cell editor has no cell validator.


WrapTextCellEditor

public WrapTextCellEditor(org.eclipse.swt.widgets.Composite parent)
Creates a new text string cell editor parented under the given control. The cell editor value is the string itself, which is initially the empty string. Initially, the cell editor has no cell validator.

Parameters:
parent - the parent control

WrapTextCellEditor

public WrapTextCellEditor(org.eclipse.swt.widgets.Composite parent,
                          int style)
Creates a new text string cell editor parented under the given control. The cell editor value is the string itself, which is initially the empty string. Initially, the cell editor has no cell validator.

Parameters:
parent - the parent control
style - the style bits
Method Detail

keyReleaseOccured

protected void keyReleaseOccured(org.eclipse.swt.events.KeyEvent keyEvent)
Overrides:
keyReleaseOccured in class org.eclipse.jface.viewers.TextCellEditor
See Also:
CellEditor.keyReleaseOccured(org.eclipse.swt.events.KeyEvent)

setValueAndProcessEditOccured

public void setValueAndProcessEditOccured(Object value)
This will be used when an edit has occurred by a ModifyEvent has been been send. Will call #setValue(Object) but will also call editOccured(null) to make sure that the dirty flag is set probably and that any listeners are informed about the changed.

Specified by:
setValueAndProcessEditOccured in interface CellEditorEx
Parameters:
value - Value to set the cell editor to. Note: This happens address defect RATLC00522324. For our topgraphical edit parts we delagate the direct edit request to a primary edit part and set focus on that. The issue is that if the user has typed in an initial character when setting focus to the edit part, which typically is a TextCompartmentEditPart then setting that intial value does not fire the necessary change events that need to occur in order for that value to be recongnized. If you don't use this method then the result is that if you just type in the initial character and that is it then the text compartment loses focus then the value will not be saved. This is because setting the value of the cell doesn't think its value has changed since the first character is not recongized as a change.

doSetValue

protected void doSetValue(Object value)
Overrides:
doSetValue in class org.eclipse.jface.viewers.TextCellEditor

hasValueChanged

public boolean hasValueChanged()
Specified by:
hasValueChanged in interface CellEditorEx
Returns:
boolean value specifying whether or not the value has been changed

deactivate

public void deactivate()
Overrides:
deactivate in class org.eclipse.jface.viewers.CellEditor

isDeactivationLocked

public boolean isDeactivationLocked()
Returns true if deactivation has been locked

Specified by:
isDeactivationLocked in interface CellEditorEx
Returns:

setDeactivationLock

public void setDeactivationLock(boolean deactivationLock)
Sets deactivation lock so that the cell editor does not perform deactivate

Specified by:
setDeactivationLock in interface CellEditorEx
Parameters:
deactivationLock -


Copyright © 2012. All Rights Reserved.