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 StructuredViewers 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
textFields inherited from class org.eclipse.jface.viewers.CellEditor
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO -
Constructor Summary
ConstructorsConstructorDescriptionXtextStyledTextCellEditor(int style, com.google.inject.Injector injector) XtextStyledTextCellEditor(int style, com.google.inject.Injector injector, IXtextFakeContextResourcesProvider contextFakeResourceProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletionProposalAdaptercreateCompletionProposalAdapter(StyledText styledText, IContentAssistant contentAssistant) protected ControlcreateControl(Composite parent) Creates anSourceViewerand returns theStyledTextwidget of the viewer as the cell editors control.protected MenuManagerprotected StyledTextXtextAdapterprotected booleanThis implementation ofCellEditor.dependsOnExternalFocusListener()returns false if the current instance's class is TextCellEditor, and true otherwise.voiddispose()protected voiddoSetValue(Object value) TheTextCellEditorimplementation of thisCellEditorframework method accepts a text string (typeString).protected voidprotected CompletionProposalAdapterprotected IXtextFakeContextResourcesProviderprotected com.google.inject.Injectorprotected voidinitContextMenu(Control control) booleanprotected booleanbooleanbooleanprotected voidkeyReleaseOccured(KeyEvent keyEvent) Processes a key release event that occurred in this cell editor.voidvoidprotected voidsetIgnoreNextFocusLost(boolean ignoreNextFocusLost) voidsetVisibleRegion(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, performSelectAllMethods 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 anSourceViewerand returns theStyledTextwidget of the viewer as the cell editors control. Some code is copied fromXtextEditor.- Overrides:
createControlin classStyledTextCellEditor
-
initContextMenu
-
createMenuManager
-
keyReleaseOccured
Description copied from class:StyledTextCellEditorProcesses a key release event that occurred in this cell editor.The
TextCellEditorimplementation 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:
keyReleaseOccuredin classStyledTextCellEditor- Parameters:
keyEvent- the key event
-
doSetValue
Description copied from class:StyledTextCellEditorTheTextCellEditorimplementation of thisCellEditorframework method accepts a text string (typeString).- Overrides:
doSetValuein classStyledTextCellEditor- Parameters:
value- a text string (typeString)
-
isUndoEnabled
public boolean isUndoEnabled()- Overrides:
isUndoEnabledin classCellEditor
-
performUndo
public void performUndo()- Overrides:
performUndoin classCellEditor
-
isRedoEnabled
public boolean isRedoEnabled()- Overrides:
isRedoEnabledin classCellEditor
-
performRedo
public void performRedo()- Overrides:
performRedoin classCellEditor
-
isFindEnabled
public boolean isFindEnabled()- Overrides:
isFindEnabledin classCellEditor
-
focusLost
protected void focusLost()- Overrides:
focusLostin classCellEditor
-
dispose
public void dispose()- Overrides:
disposein classCellEditor
-
dependsOnExternalFocusListener
protected boolean dependsOnExternalFocusListener()Description copied from class:StyledTextCellEditorThis 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:
dependsOnExternalFocusListenerin 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()
-