org.eclipse.nebula.widgets.richtext

## Class RichTextEditor

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Control
    - - org.eclipse.swt.widgets.Scrollable
      - - org.eclipse.swt.widgets.Composite
        - - org.eclipse.nebula.widgets.richtext.RichTextEditor

All Implemented Interfaces:
  Adaptable, Drawable

    public class RichTextEditor
    extends Composite

Rich Text Editor control that wraps CKEditor, a web-based WYSIWYG/Rich-Text editor.

Since:
  3.1
See Also:
  http://ckeditor.com/

### Constructor Summary

Constructors
Constructor and Description
`RichTextEditor(Composite parent)` Constructs a new instance of this class given its parent.
`RichTextEditor(Composite parent, int style)` Constructs a new instance of this class given its parent.
`RichTextEditor(Composite parent, ToolbarConfiguration config)` Constructs a new instance of this class given its parent.
`RichTextEditor(Composite parent, ToolbarConfiguration config, int style)` Constructs a new instance of this class given its parent, the given `ToolbarConfiguration` and a style value describing its behavior and appearance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `dispose()` Disposes of the operating system resources associated with the receiver and all its descendents.
`java.lang.String` `getText()` Get the text from the editing area.
`boolean` `isEditable()` Returns the editable state.
`boolean` `isReparentable()` Returns `true` if the underlying operating system supports this reparenting, otherwise `false`
`void` `setEditable(boolean editable)` Sets the editable state.
`void` `setFont(Font font)` 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.
`void` `setLayout(Layout layout)` Sets the layout which is associated with the receiver to be the argument which may be null.
`void` `setText(java.lang.String text)` Set text to the editing area.

### Methods inherited from class org.eclipse.swt.widgets.Composite

`changed, computeSize, getAdapter, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList`

### Methods inherited from class org.eclipse.swt.widgets.Scrollable

`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

### Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setData, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, update`

### Methods inherited from class org.eclipse.swt.widgets.Widget

`addDisposeListener, addListener, checkSubclass, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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,
                          ToolbarConfiguration config)

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)
  `config` - 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

    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)
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,
                          ToolbarConfiguration config,
                          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)
  `config` - the `ToolbarConfiguration` to use or `null` for using the default `ToolbarConfiguration`
  `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

### 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)

#### dispose

    public void dispose()

Description copied from class: `Widget`
Disposes of the operating system resources associated with the receiver and all its descendents. After this method has been invoked, the receiver and all descendents will answer `true` when sent the message `isDisposed()`. Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection.

NOTE: This method is not called recursively on the descendents of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the `Dispose` event.

Overrides:
  `dispose` in class `Widget`
See Also:
  `Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener)`, `Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener)`, `Widget.checkWidget()`

#### 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`

Copyright (c) EclipseSource and others 2002, 2016. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0