Class CmsTinyMCEWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.FocusWidget
org.opencms.acacia.client.widgets.A_CmsEditWidget
org.opencms.acacia.client.widgets.CmsTinyMCEWidget
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllDragAndDropHandlers,com.google.gwt.event.dom.client.HasAllFocusHandlers,com.google.gwt.event.dom.client.HasAllGestureHandlers,com.google.gwt.event.dom.client.HasAllKeyHandlers,com.google.gwt.event.dom.client.HasAllMouseHandlers,com.google.gwt.event.dom.client.HasAllTouchHandlers,com.google.gwt.event.dom.client.HasBlurHandlers,com.google.gwt.event.dom.client.HasClickHandlers,com.google.gwt.event.dom.client.HasDoubleClickHandlers,com.google.gwt.event.dom.client.HasDragEndHandlers,com.google.gwt.event.dom.client.HasDragEnterHandlers,com.google.gwt.event.dom.client.HasDragHandlers,com.google.gwt.event.dom.client.HasDragLeaveHandlers,com.google.gwt.event.dom.client.HasDragOverHandlers,com.google.gwt.event.dom.client.HasDragStartHandlers,com.google.gwt.event.dom.client.HasDropHandlers,com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.dom.client.HasGestureChangeHandlers,com.google.gwt.event.dom.client.HasGestureEndHandlers,com.google.gwt.event.dom.client.HasGestureStartHandlers,com.google.gwt.event.dom.client.HasKeyDownHandlers,com.google.gwt.event.dom.client.HasKeyPressHandlers,com.google.gwt.event.dom.client.HasKeyUpHandlers,com.google.gwt.event.dom.client.HasMouseDownHandlers,com.google.gwt.event.dom.client.HasMouseMoveHandlers,com.google.gwt.event.dom.client.HasMouseOutHandlers,com.google.gwt.event.dom.client.HasMouseOverHandlers,com.google.gwt.event.dom.client.HasMouseUpHandlers,com.google.gwt.event.dom.client.HasMouseWheelHandlers,com.google.gwt.event.dom.client.HasTouchCancelHandlers,com.google.gwt.event.dom.client.HasTouchEndHandlers,com.google.gwt.event.dom.client.HasTouchMoveHandlers,com.google.gwt.event.dom.client.HasTouchStartHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasResizeHandlers,com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.TakesValue<String>,com.google.gwt.user.client.ui.Focusable,com.google.gwt.user.client.ui.HasEnabled,com.google.gwt.user.client.ui.HasFocus,com.google.gwt.user.client.ui.HasValue<String>,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.SourcesClickEvents,com.google.gwt.user.client.ui.SourcesFocusEvents,com.google.gwt.user.client.ui.SourcesKeyboardEvents,com.google.gwt.user.client.ui.SourcesMouseEvents,I_CmsEditWidget,I_CmsHasDisplayDirection
public final class CmsTinyMCEWidget
extends A_CmsEditWidget
implements com.google.gwt.event.logical.shared.HasResizeHandlers, I_CmsHasDisplayDirection
This class is used to start TinyMCE for editing the content of an element.
After constructing the instance, the actual editor is opened using the init() method, and destroyed with the close() method. While the editor is opened, the edited contents can be accessed using the methods of the HasValue interface.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface org.opencms.acacia.client.widgets.I_CmsHasDisplayDirection
I_CmsHasDisplayDirection.Direction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanA flag which indicates whether the editor is currently active.protected StringThe current content.protected com.google.gwt.core.client.JavaScriptObjectThe TinyMCE editor instance.protected StringThe DOM ID of the editable element.protected StringThe original HTML content of the editable element.protected intThe maximal width of the widget.static final StringUse as option to disallow any HTML or formatting the content.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCmsTinyMCEWidget(com.google.gwt.dom.client.Element element, Object options) Creates a new instance for the given element.CmsTinyMCEWidget(Object options) Creates a new instance with the given options. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistrationaddResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler) protected voidChecks whether the necessary Javascript libraries are available by accessing them.protected StringensureId(com.google.gwt.dom.client.Element element) Gives an element an id if it doesn't already have an id, and then returns the element's id.Returns the display direction.protected com.google.gwt.dom.client.ElementReturns the editor parent element.protected com.google.gwt.dom.client.ElementgetElementById(String id) Gets an element by its id.com.google.gwt.dom.client.ElementGets the main editable element.protected com.google.gwt.dom.client.ElementGets the toolbar element.getValue()booleanisActive()Returns if the widget is active.protected booleanisInline()Returns if the widget is used in inline mode.protected voidonAttach()protected voidonDetach()protected voidPropagates the a focus event.protected voidpropagateMouseEvent(String eventType, com.google.gwt.dom.client.Element eventSource) Propagates a native mouse event.protected voidRemoves the editor instance.voidsetActive(boolean active) Sets the widget active/inactive.protected voidsetMainElementContent(String html) Sets the main content of the element which is inline editable.voidSets the name of input fields.voidsetTypografLocale(String typografLocale) Sets the Typograf locale for inline editing mode.voidvoidprotected booleanChecks if the main element contains the current text selection.Methods inherited from class org.opencms.acacia.client.widgets.A_CmsEditWidget
fireValueChange, getPreviousValue, onAttachWidget, owns, setPreviousValueMethods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndexMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.dom.client.HasFocusHandlers
addFocusHandlerMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface org.opencms.acacia.client.widgets.I_CmsEditWidget
shouldSetDefaultWhenDisabledMethods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
-
Field Details
-
NO_HTML_EDIT
Use as option to disallow any HTML or formatting the content.- See Also:
-
m_active
A flag which indicates whether the editor is currently active. -
m_currentContent
The current content. -
m_editor
The TinyMCE editor instance. -
m_id
The DOM ID of the editable element. -
m_originalContent
The original HTML content of the editable element. -
m_width
The maximal width of the widget.
-
-
Constructor Details
-
CmsTinyMCEWidget
Creates a new instance for the given element. Use this constructor for in line editing.- Parameters:
element- the DOM elementoptions- the tinyMCE editor options to extend the default settings
-
CmsTinyMCEWidget
Creates a new instance with the given options. Use this constructor for form based editing.- Parameters:
options- the tinyMCE editor options to extend the default settings
-
-
Method Details
-
getDisplayingDirection
Description copied from interface:I_CmsHasDisplayDirectionReturns the display direction.- Specified by:
getDisplayingDirectionin interfaceI_CmsHasDisplayDirection- Returns:
- the display direction
- See Also:
-
getMainElement
Gets the main editable element.- Returns:
- the editable element
-
getValue
- Specified by:
getValuein interfacecom.google.gwt.user.client.ui.HasValue<String>- Specified by:
getValuein interfacecom.google.gwt.user.client.TakesValue<String>- Overrides:
getValuein classA_CmsEditWidget- See Also:
-
isActive
Description copied from interface:I_CmsEditWidgetReturns if the widget is active.- Specified by:
isActivein interfaceI_CmsEditWidget- Returns:
trueif the widget is active- See Also:
-
setActive
Description copied from interface:I_CmsEditWidgetSets the widget active/inactive.- Specified by:
setActivein interfaceI_CmsEditWidget- Parameters:
active-trueto activate the widget- See Also:
-
setName
Description copied from interface:I_CmsEditWidgetSets the name of input fields.- Specified by:
setNamein interfaceI_CmsEditWidget- Parameters:
name- of the input field- See Also:
-
setTypografLocale
Sets the Typograf locale for inline editing mode. -
setValue
-
setValue
- Specified by:
setValuein interfacecom.google.gwt.user.client.ui.HasValue<String>- Specified by:
setValuein interfaceI_CmsEditWidget- See Also:
-
checkLibraries
Checks whether the necessary Javascript libraries are available by accessing them. -
ensureId
Gives an element an id if it doesn't already have an id, and then returns the element's id.- Parameters:
element- the element for which we want to add the id- Returns:
- the id
-
getEditorParentElement
Returns the editor parent element.- Returns:
- the editor parent element
-
getElementById
Gets an element by its id.- Parameters:
id- the id- Returns:
- the element with the given id
-
getToolbarElement
Gets the toolbar element.- Returns:
- the toolbar element
-
isInline
Returns if the widget is used in inline mode.- Returns:
trueif the widget is used in inline mode
-
onAttach
- Overrides:
onAttachin classcom.google.gwt.user.client.ui.FocusWidget- See Also:
-
onDetach
- Overrides:
onDetachin classcom.google.gwt.user.client.ui.Widget- See Also:
-
propagateFocusEvent
Propagates the a focus event. -
propagateMouseEvent
Propagates a native mouse event.- Parameters:
eventType- the mouse event typeeventSource- the event source
-
removeEditor
Removes the editor instance. -
setMainElementContent
Sets the main content of the element which is inline editable.- Parameters:
html- the new content html
-
shouldReceiveFocus
Checks if the main element contains the current text selection.- Returns:
trueif the main element contains the current text selection