Class RawTextEditorComposite

All Implemented Interfaces:
Drawable

public class RawTextEditorComposite extends Composite
Raw text editor composite, showing optional toolbar for insert text fields/images/convert format.
Author:
Christopher Mindus
  • Constructor Details

  • Method Details

    • getToolBar

      public ToolBar getToolBar()
      Gets the toolbar.
    • getStyledText

      public KStringStyledText getStyledText()
      Gets the styled text editor.
    • setFocus

      public boolean setFocus()
      Sets focus to the text area.
      Overrides:
      setFocus in class Composite
      Returns:
      true for success.
    • scheduleUpdateStates

      public void scheduleUpdateStates()
      Schedules a deferred and coalesced call to updateStates().

      SWT fires caret and selection events synchronously from inside the StyledText text-change processing (handleTextChanged to updateSelection). Performing clipboard access and toolbar updates re-entrantly at that point can tear the internal renderer state of the widget and cause "Index out of bounds" in setCaretLocations (seen when pasting wrapping text), so the state update is deferred to the next event loop pass instead.

    • updateStates

      public void updateStates()
      Updates all states.
    • isOK

      public boolean isOK()
      Checks if the text is OK.
    • getError

      public IPropErrorItem getError()
      Gets the potential input error.
      Returns:
      The error, or null for no errors.
    • getKString

      public KString getKString()
      Gets the edited string.
    • setDialogMode

      public void setDialogMode()
      Sets dialog mode, i.e. Enter to go to default button in dialog, tab keys as normal.