Class XtextStyledTextCellEditor
java.lang.Object
org.eclipse.jface.viewers.CellEditor
org.yakindu.base.utils.jface.viewers.StyledTextCellEditor
org.yakindu.base.xtext.utils.jface.viewers.XtextStyledTextCellEditor
- Direct Known Subclasses:
XtextStyledTextCellEditorEx
This class integrates Xtext features into a
CellEditor
and can be
used e.g. in jFace StructuredViewer
s or in GMF EditParts via
DirectEditManager.
The current implementation supports, code completion, syntax highlighting and
validation- See Also:
-
XtextStyledTextProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.viewers.CellEditor
CellEditor.LayoutData
-
Field Summary
Fields inherited from class org.yakindu.base.utils.jface.viewers.StyledTextCellEditor
text
Fields inherited from class org.eclipse.jface.viewers.CellEditor
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
-
Constructor Summary
ConstructorDescriptionXtextStyledTextCellEditor
(int style, com.google.inject.Injector injector) XtextStyledTextCellEditor
(int style, com.google.inject.Injector injector, IXtextFakeContextResourcesProvider contextFakeResourceProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletionProposalAdapter
createCompletionProposalAdapter
(StyledText styledText, IContentAssistant contentAssistant) protected Control
createControl
(Composite parent) Creates anSourceViewer
and returns theStyledText
widget of the viewer as the cell editors control.protected MenuManager
protected StyledTextXtextAdapter
protected boolean
This implementation ofCellEditor.dependsOnExternalFocusListener()
returns false if the current instance's class is TextCellEditor, and true otherwise.void
dispose()
protected void
doSetValue
(Object value) TheTextCellEditor
implementation of thisCellEditor
framework method accepts a text string (typeString
).protected void
protected CompletionProposalAdapter
protected IXtextFakeContextResourcesProvider
protected com.google.inject.Injector
protected void
initContextMenu
(Control control) boolean
protected boolean
boolean
boolean
protected void
keyReleaseOccured
(KeyEvent keyEvent) Processes a key release event that occurred in this cell editor.void
void
protected void
setIgnoreNextFocusLost
(boolean ignoreNextFocusLost) void
setVisibleRegion
(int start, int length) Methods inherited from class org.yakindu.base.utils.jface.viewers.StyledTextCellEditor
createStyledText, doGetValue, doSetFocus, editOccured, getLayoutData, getVerifyKeyListener, 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, deactivate, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, getControl, getDoubleClickTimeout, getErrorMessage, getStyle, getValidator, getValue, isActivated, isCorrect, isDirty, isValueValid, markDirty, performFind, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
-
Constructor Details
-
XtextStyledTextCellEditor
public XtextStyledTextCellEditor(int style, com.google.inject.Injector injector, IXtextFakeContextResourcesProvider contextFakeResourceProvider) -
XtextStyledTextCellEditor
public XtextStyledTextCellEditor(int style, com.google.inject.Injector injector)
-
-
Method Details
-
createControl
Creates anSourceViewer
and returns theStyledText
widget of the viewer as the cell editors control. Some code is copied fromXtextEditor
.- Overrides:
createControl
in classStyledTextCellEditor
-
initContextMenu
-
createMenuManager
-
keyReleaseOccured
Description copied from class:StyledTextCellEditor
Processes a key release event that occurred in this cell editor.The
TextCellEditor
implementation of this framework method ignores when the RETURN key is pressed since this is handled inhandleDefaultSelection
. An exception is made for Ctrl+Enter for multi-line texts, since a default selection event is not sent in this case.- Overrides:
keyReleaseOccured
in classStyledTextCellEditor
- Parameters:
keyEvent
- the key event
-
doSetValue
Description copied from class:StyledTextCellEditor
TheTextCellEditor
implementation of thisCellEditor
framework method accepts a text string (typeString
).- Overrides:
doSetValue
in classStyledTextCellEditor
- Parameters:
value
- a text string (typeString
)
-
isUndoEnabled
public boolean isUndoEnabled()- Overrides:
isUndoEnabled
in classCellEditor
-
performUndo
public void performUndo()- Overrides:
performUndo
in classCellEditor
-
isRedoEnabled
public boolean isRedoEnabled()- Overrides:
isRedoEnabled
in classCellEditor
-
performRedo
public void performRedo()- Overrides:
performRedo
in classCellEditor
-
isFindEnabled
public boolean isFindEnabled()- Overrides:
isFindEnabled
in classCellEditor
-
focusLost
protected void focusLost()- Overrides:
focusLost
in classCellEditor
-
dispose
public void dispose()- Overrides:
dispose
in classCellEditor
-
dependsOnExternalFocusListener
protected boolean dependsOnExternalFocusListener()Description copied from class:StyledTextCellEditor
This implementation ofCellEditor.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.- Overrides:
dependsOnExternalFocusListener
in classStyledTextCellEditor
-
setVisibleRegion
public void setVisibleRegion(int start, int length) -
getXtextAdapter
-
getCompletionProposalAdapter
-
getContextFakeResourceProvider
-
createCompletionProposalAdapter
protected CompletionProposalAdapter createCompletionProposalAdapter(StyledText styledText, IContentAssistant contentAssistant) -
createXtextAdapter
-
isIgnoreNextFocusLost
protected boolean isIgnoreNextFocusLost() -
setIgnoreNextFocusLost
protected void setIgnoreNextFocusLost(boolean ignoreNextFocusLost) -
getInjector
protected com.google.inject.Injector getInjector()
-