public class StyledTextCellEditor extends CellEditor
TextCellEditor. Only the control is
changed from Text to StyledText, with some small
modifications.CellEditor.LayoutData| Modifier and Type | Field and Description |
|---|---|
protected StyledText |
text
The text control; initially
null. |
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO| Constructor and Description |
|---|
StyledTextCellEditor()
Creates a new text string cell editor with no control The cell editor
value is the string itself, which is initially the empty string.
|
| Modifier and Type | Method and Description |
|---|---|
protected Control |
createControl(Composite parent) |
protected StyledText |
createStyledText(Composite parent)
Hook changing creation of Control
|
protected boolean |
dependsOnExternalFocusListener()
This implementation of
CellEditor.dependsOnExternalFocusListener() returns false if the
current instance's class is TextCellEditor, and true otherwise. |
protected java.lang.Object |
doGetValue()
The
TextCellEditor implementation of this
CellEditor framework method returns the text string. |
protected void |
doSetFocus() |
protected void |
doSetValue(java.lang.Object value)
The
TextCellEditor implementation of this
CellEditor framework method accepts a text string (type
String). |
protected void |
editOccured(ModifyEvent e)
Processes a modify event that occurred in this text cell editor.
|
CellEditor.LayoutData |
getLayoutData()
Since a text editor field is scrollable we don't set a minimumSize.
|
protected VerifyKeyListener |
getVerifyKeyListener() |
protected void |
handleDefaultSelection(SelectionEvent event)
Handles a default selection event from the text control by applying the
editor value and deactivating this cell editor.
|
boolean |
isCopyEnabled()
The
TextCellEditor implementation of this
CellEditor method returns true if the current
selection is not empty. |
boolean |
isCutEnabled()
The
TextCellEditor implementation of this
CellEditor method returns true if the current
selection is not empty. |
boolean |
isDeleteEnabled()
The
TextCellEditor implementation of this
CellEditor method returns true if there is a
selection or if the caret is not positioned at the end of the text. |
boolean |
isPasteEnabled()
The
TextCellEditor implementation of this
CellEditor method always returns true. |
boolean |
isSaveAllEnabled()
Check if save all is enabled
|
boolean |
isSelectAllEnabled()
Returns
true if this cell editor is able to perform the
select all action. |
protected void |
keyReleaseOccured(KeyEvent keyEvent)
Processes a key release event that occurred in this cell editor.
|
void |
performCopy()
The
TextCellEditor implementation of this
CellEditor method copies the current selection to the
clipboard. |
void |
performCut()
The
TextCellEditor implementation of this
CellEditor method cuts the current selection to the
clipboard. |
void |
performDelete()
The
TextCellEditor implementation of this
CellEditor method deletes the current selection or, if there
is no selection, the character next character from the current position. |
void |
performPaste()
The
TextCellEditor implementation of this
CellEditor method pastes the the clipboard contents over the
current selection. |
void |
performSelectAll()
The
TextCellEditor implementation of this
CellEditor method selects all of the current text. |
activate, activate, addListener, addPropertyChangeListener, create, deactivate, 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, valueChangedprotected StyledText text
null.public StyledTextCellEditor()
protected Control createControl(Composite parent)
createControl in class CellEditorprotected VerifyKeyListener getVerifyKeyListener()
protected StyledText createStyledText(Composite parent)
parent - protected java.lang.Object doGetValue()
TextCellEditor implementation of this
CellEditor framework method returns the text string.doGetValue in class CellEditorprotected void doSetFocus()
doSetFocus in class CellEditorprotected void doSetValue(java.lang.Object value)
TextCellEditor implementation of this
CellEditor framework method accepts a text string (type
String).doSetValue in class CellEditorvalue - a text string (type String)protected void editOccured(ModifyEvent e)
fireEditorValueChanged. Subclasses should call this method
at appropriate times. Subclasses may extend or reimplement.e - the SWT modify eventpublic CellEditor.LayoutData getLayoutData()
getLayoutData in class CellEditorprotected void handleDefaultSelection(SelectionEvent event)
event - the selection eventpublic boolean isCopyEnabled()
TextCellEditor implementation of this
CellEditor method returns true if the current
selection is not empty.isCopyEnabled in class CellEditorpublic boolean isCutEnabled()
TextCellEditor implementation of this
CellEditor method returns true if the current
selection is not empty.isCutEnabled in class CellEditorpublic boolean isDeleteEnabled()
TextCellEditor implementation of this
CellEditor method returns true if there is a
selection or if the caret is not positioned at the end of the text.isDeleteEnabled in class CellEditorpublic boolean isPasteEnabled()
TextCellEditor implementation of this
CellEditor method always returns true.isPasteEnabled in class CellEditorpublic boolean isSaveAllEnabled()
public boolean isSelectAllEnabled()
true if this cell editor is able to perform the
select all action.
This default implementation always returns false.
Subclasses may override
isSelectAllEnabled in class CellEditortrue if select all is possible, false
otherwiseprotected void keyReleaseOccured(KeyEvent keyEvent)
The TextCellEditor implementation of this framework method
ignores when the RETURN key is pressed since this is handled in
handleDefaultSelection. An exception is made for Ctrl+Enter
for multi-line texts, since a default selection event is not sent in this
case.
keyReleaseOccured in class CellEditorkeyEvent - the key eventpublic void performCopy()
TextCellEditor implementation of this
CellEditor method copies the current selection to the
clipboard.performCopy in class CellEditorpublic void performCut()
TextCellEditor implementation of this
CellEditor method cuts the current selection to the
clipboard.performCut in class CellEditorpublic void performDelete()
TextCellEditor implementation of this
CellEditor method deletes the current selection or, if there
is no selection, the character next character from the current position.performDelete in class CellEditorpublic void performPaste()
TextCellEditor implementation of this
CellEditor method pastes the the clipboard contents over the
current selection.performPaste in class CellEditorpublic void performSelectAll()
TextCellEditor implementation of this
CellEditor method selects all of the current text.performSelectAll in class CellEditorprotected boolean dependsOnExternalFocusListener()
CellEditor.dependsOnExternalFocusListener() returns false if the
current instance's class is TextCellEditor, and true otherwise.
Subclasses that hook their own focus listener should override this method
and return false. See also bug 58777.dependsOnExternalFocusListener in class CellEditor