Class RichTextEditor

    • Constructor Detail

      • RichTextEditor

        public RichTextEditor​(Composite parent)
        Constructs a new instance of this class given its parent.
        Parameters:
        parent - a composite control which will be the parent of the new instance (cannot be null)
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      • RichTextEditor

        public RichTextEditor​(Composite parent,
                              int style)
        Constructs a new instance of this class given its parent.
        Parameters:
        parent - a composite control which will be the parent of the new instance (cannot be null)
        style - the style of control to construct
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      • RichTextEditor

        @Deprecated
        public RichTextEditor​(Composite parent,
                              ToolbarConfiguration toolbarConfig)
        Deprecated.
        use constructors that take a RichTextEditorConfiguration
        Constructs a new instance of this class given its parent.
        Parameters:
        parent - a composite control which will be the parent of the new instance (cannot be null)
        toolbarConfig - the ToolbarConfiguration to use or null for using the default ToolbarConfiguration
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      • RichTextEditor

        @Deprecated
        public RichTextEditor​(Composite parent,
                              ToolbarConfiguration toolbarConfig,
                              int style)
        Deprecated.
        use constructors that take a RichTextEditorConfiguration
        Constructs a new instance of this class given its parent, the given ToolbarConfiguration and a style value describing its behavior and appearance.
        Parameters:
        parent - the parent composite where this rich text editor should be added to
        toolbarConfig - the ToolbarConfiguration to use or null for using the default ToolbarConfiguration
        style - the style of widget to construct
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      • RichTextEditor

        public RichTextEditor​(Composite parent,
                              RichTextEditorConfiguration editorConfig)
        Constructs a new instance of this class given its parent, the given ToolbarConfiguration and a style value describing its behavior and appearance.
        Parameters:
        parent - a composite control which will be the parent of the new instance (cannot be null)
        editorConfig - the RichTextEditorConfiguration to use or null for using the default RichTextEditorConfiguration
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        Since:
        3.2
      • RichTextEditor

        public RichTextEditor​(Composite parent,
                              RichTextEditorConfiguration editorConfig,
                              int style)
        Constructs a new instance of this class given its parent, the given ToolbarConfiguration and a style value describing its behavior and appearance.
        Parameters:
        parent - a composite control which will be the parent of the new instance (cannot be null)
        editorConfig - the RichTextEditorConfiguration to use or null for using the default RichTextEditorConfiguration
        style - the style of control to construct
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        Since:
        3.2
    • Method Detail

      • setLayout

        public void setLayout​(Layout layout)
        Description copied from class: Composite
        Sets the layout which is associated with the receiver to be the argument which may be null.
        Overrides:
        setLayout in class Composite
        Parameters:
        layout - the receiver's new layout or null
      • setFont

        public void setFont​(Font font)
        Description copied from class: Control
        Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
        Overrides:
        setFont in class Control
        Parameters:
        font - the new font (or null)
      • setText

        public void setText​(java.lang.String text)
        Set text to the editing area. Can contain HTML tags for styling.
        Parameters:
        text - The text to set to the editing area.
      • getText

        public java.lang.String getText()
        Get the text from the editing area. Contains HTML tags for formatting.
        Returns:
        The text that is currently set in the editing area.
      • isEditable

        public boolean isEditable()
        Returns the editable state.
        Returns:
        whether or not the receiver is editable
      • setEditable

        public void setEditable​(boolean editable)
        Sets the editable state.
        Parameters:
        editable - the new editable state
      • isReparentable

        public boolean isReparentable()
        Description copied from class: Control
        Returns true if the underlying operating system supports this reparenting, otherwise false
        Overrides:
        isReparentable in class Control
        Returns:
        true if the widget can be reparented, otherwise false