Class XtextStyledTextCellEditor

Direct Known Subclasses:
XtextStyledTextCellEditorEx

public class XtextStyledTextCellEditor extends StyledTextCellEditor
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
  • 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

      protected Control createControl(Composite parent)
      Creates an SourceViewer and returns the StyledText widget of the viewer as the cell editors control. Some code is copied from XtextEditor.
      Overrides:
      createControl in class StyledTextCellEditor
    • initContextMenu

      protected void initContextMenu(Control control)
    • createMenuManager

      protected MenuManager createMenuManager()
    • keyReleaseOccured

      protected void keyReleaseOccured(KeyEvent keyEvent)
      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 in handleDefaultSelection. 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 class StyledTextCellEditor
      Parameters:
      keyEvent - the key event
    • doSetValue

      protected void doSetValue(Object value)
      Description copied from class: StyledTextCellEditor
      The TextCellEditor implementation of this CellEditor framework method accepts a text string (type String).
      Overrides:
      doSetValue in class StyledTextCellEditor
      Parameters:
      value - a text string (type String)
    • isUndoEnabled

      public boolean isUndoEnabled()
      Overrides:
      isUndoEnabled in class CellEditor
    • performUndo

      public void performUndo()
      Overrides:
      performUndo in class CellEditor
    • isRedoEnabled

      public boolean isRedoEnabled()
      Overrides:
      isRedoEnabled in class CellEditor
    • performRedo

      public void performRedo()
      Overrides:
      performRedo in class CellEditor
    • isFindEnabled

      public boolean isFindEnabled()
      Overrides:
      isFindEnabled in class CellEditor
    • focusLost

      protected void focusLost()
      Overrides:
      focusLost in class CellEditor
    • dispose

      public void dispose()
      Overrides:
      dispose in class CellEditor
    • dependsOnExternalFocusListener

      protected boolean dependsOnExternalFocusListener()
      Description copied from class: StyledTextCellEditor
      This implementation of 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.
      Overrides:
      dependsOnExternalFocusListener in class StyledTextCellEditor
    • setVisibleRegion

      public void setVisibleRegion(int start, int length)
    • getXtextAdapter

      public StyledTextXtextAdapter getXtextAdapter()
    • getCompletionProposalAdapter

      protected CompletionProposalAdapter getCompletionProposalAdapter()
    • getContextFakeResourceProvider

      protected IXtextFakeContextResourcesProvider getContextFakeResourceProvider()
    • createCompletionProposalAdapter

      protected CompletionProposalAdapter createCompletionProposalAdapter(StyledText styledText, IContentAssistant contentAssistant)
    • createXtextAdapter

      protected StyledTextXtextAdapter createXtextAdapter()
    • isIgnoreNextFocusLost

      protected boolean isIgnoreNextFocusLost()
    • setIgnoreNextFocusLost

      protected void setIgnoreNextFocusLost(boolean ignoreNextFocusLost)
    • getInjector

      protected com.google.inject.Injector getInjector()