public class SummernoteBase extends Div implements HasAllSummernoteHandlers, HasEnabled
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledIndexedPanel.ForIsWidgetHasWidgets.ForIsWidgetDEBUG_ID_PREFIX| Constructor and Description |
|---|
SummernoteBase() |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addSummernoteBlurHandler(SummernoteBlurHandler handler)
Adds a
SummernoteBlurEvent handler. |
HandlerRegistration |
addSummernoteChangeHandler(SummernoteChangeHandler handler)
Adds a
SummernoteChangeEvent handler. |
HandlerRegistration |
addSummernoteEnterHandler(SummernoteEnterHandler handler)
Adds a
SummernoteEnterEvent handler. |
HandlerRegistration |
addSummernoteFocusHandler(SummernoteFocusHandler handler)
Adds a
SummernoteFocusEvent handler. |
HandlerRegistration |
addSummernoteImageUploadHandler(SummernoteImageUploadHandler handler)
Adds a
SummernoteImageUploadEvent handler. |
HandlerRegistration |
addSummernoteInitHandler(SummernoteInitHandler handler)
Adds a
SummernoteInitEvent handler. |
HandlerRegistration |
addSummernoteKeyDownHandler(SummernoteKeyDownHandler handler)
Adds a
SummernoteKeyDownEvent handler. |
HandlerRegistration |
addSummernoteKeyUpHandler(SummernoteKeyUpHandler handler)
Adds a
SummernoteKeyUpEvent handler. |
HandlerRegistration |
addSummernotePasteHandler(SummernotePasteHandler handler)
Adds a
SummernotePasteEvent handler. |
void |
clear()
Removes all contents and restores the editable instance
to an
_emptyPara_: <p><br></p> |
String |
getCode()
Gets the HTML code generated from the editor
|
SummernoteLanguage |
getLanguage()
Returns the editor language.
|
void |
insertImages(JsArray<SummernoteImageUploadEvent.ImageFile> images)
Inserts the given images to the editor.
This method should be used only when you customize the image upload handler. |
boolean |
isEmpty()
Returns
true if the content is empty.Editing area needs <p><br></p>
for focus, even if contents is empty. |
boolean |
isEnabled() |
protected void |
onLoad() |
protected void |
onUnload() |
void |
reconfigure()
Call this when updating options to ensure everything is up to date
|
void |
reset()
Clear editor contents and remove all stored history.
|
void |
setAirMode(boolean airMode)
Set the air mode of the editor.
|
void |
setCode(String code)
Sets the given HTML code to the editor.
|
void |
setDefaultHeight(int height)
Sets the default height of the editor (in pixel).
Note: DO NOT renamed this method to setHeight to avoid UiBinder name clash with UIObject.setHeight(String). |
void |
setDialogsFade(boolean dialogsFade)
Set
true to turn on dialogs fading effect
when showing or hiding.Defaults to false. |
void |
setDialogsInBody(boolean dialogsInBody)
Set
true to place dialogs in <body>
rather than in the editor.Defaults to false. |
void |
setDisableDragAndDrop(boolean disableDragAndDrop)
Set
true to disable drag and drop.Defaults to false. |
void |
setEnabled(boolean enabled) |
void |
setFontNames(SummernoteFontName... fontNames)
Set customized font names.
|
void |
setFontNamesIgnoreCheck(SummernoteFontName... fontNames)
Set a list for Web fonts to be ignored.
|
void |
setHasFocus(boolean focus)
Set the focus of the editor.
|
void |
setHint(String matchRegexp,
HintHandler hintHandler)
Summernote support hint (autocomplete) feature.
|
void |
setLanguage(SummernoteLanguage language)
Set the editor language.
|
void |
setMaxHeight(int maxHeight)
Sets the maximum height of the editor (in pixel).
|
void |
setMinHeight(int minHeight)
Sets the minimum height of the editor (in pixel).
|
void |
setPlaceholder(String placeholder)
Set placeholder of the editor.
|
void |
setShortcuts(boolean shortcuts)
Set
false to disable custom shortcuts.Defaults to true. |
void |
setShowToolbar(boolean showToolbar)
If
false the toolbar will be hidden.Defaults to true. |
void |
setToolbar(Toolbar toolbar)
Customizes the toolbar.
Example: |
add, getId, getPull, insert, insert, remove, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPull, setVisibleOnadd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, removeadd, adopt, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventforEach, spliteratorpublic SummernoteBase()
public void setDefaultHeight(int height)
UIObject.setHeight(String).height - public void setMaxHeight(int maxHeight)
maxHeight - public void setMinHeight(int minHeight)
minHeight - public void setShowToolbar(boolean showToolbar)
false the toolbar will be hidden.true.showToolbar - public void setToolbar(Toolbar toolbar)
summernote.setToolbar(new Toolbar()
.addGroup(ToolbarButton.OL, ToolbarButton.BOLD)
.addGroup(ToolbarButton.HELP));
toolbar - public void setHasFocus(boolean focus)
focus - if true, focus on the editorpublic void setPlaceholder(String placeholder)
placeholder - placeholder of the editorpublic void setFontNames(SummernoteFontName... fontNames)
fontNames - customized font namesSummernoteFontNamepublic void setFontNamesIgnoreCheck(SummernoteFontName... fontNames)
fontNames - public void setAirMode(boolean airMode)
false.airMode - if true, the air mode is turn onpublic void setShortcuts(boolean shortcuts)
false to disable custom shortcuts.true.shortcuts - if false, disable custom shortcutspublic void setDialogsInBody(boolean dialogsInBody)
true to place dialogs in <body>
rather than in the editor.false.dialogsInBody - if true, place dialogs in <body>public void setDialogsFade(boolean dialogsFade)
true to turn on dialogs fading effect
when showing or hiding.false.dialogsFade - if true, turn on dialogs fading effectpublic void setDisableDragAndDrop(boolean disableDragAndDrop)
true to disable drag and drop.false.disableDragAndDrop - if true, disable drag and droppublic void setHint(String matchRegexp, HintHandler hintHandler)
matchRegexp - hintHandler - public void setLanguage(SummernoteLanguage language)
language - supported editor languagepublic SummernoteLanguage getLanguage()
public HandlerRegistration addSummernoteInitHandler(SummernoteInitHandler handler)
HasSummernoteInitHandlersSummernoteInitEvent handler.addSummernoteInitHandler in interface HasSummernoteInitHandlershandler - the handlerpublic HandlerRegistration addSummernoteEnterHandler(SummernoteEnterHandler handler)
HasSummernoteEnterHandlersSummernoteEnterEvent handler.addSummernoteEnterHandler in interface HasSummernoteEnterHandlershandler - the handlerpublic HandlerRegistration addSummernoteFocusHandler(SummernoteFocusHandler handler)
HasSummernoteFocusHandlersSummernoteFocusEvent handler.addSummernoteFocusHandler in interface HasSummernoteFocusHandlershandler - the handlerpublic HandlerRegistration addSummernoteBlurHandler(SummernoteBlurHandler handler)
HasSummernoteBlurHandlersSummernoteBlurEvent handler.addSummernoteBlurHandler in interface HasSummernoteBlurHandlershandler - the handlerpublic HandlerRegistration addSummernoteKeyUpHandler(SummernoteKeyUpHandler handler)
HasSummernoteKeyUpHandlersSummernoteKeyUpEvent handler.addSummernoteKeyUpHandler in interface HasSummernoteKeyUpHandlershandler - the handlerpublic HandlerRegistration addSummernoteKeyDownHandler(SummernoteKeyDownHandler handler)
HasSummernoteKeyDownHandlersSummernoteKeyDownEvent handler.addSummernoteKeyDownHandler in interface HasSummernoteKeyDownHandlershandler - the handlerpublic HandlerRegistration addSummernotePasteHandler(SummernotePasteHandler handler)
HasSummernotePasteHandlersSummernotePasteEvent handler.addSummernotePasteHandler in interface HasSummernotePasteHandlershandler - the handlerpublic HandlerRegistration addSummernoteImageUploadHandler(SummernoteImageUploadHandler handler)
HasSummernoteImageUploadHandlersSummernoteImageUploadEvent handler.addSummernoteImageUploadHandler in interface HasSummernoteImageUploadHandlershandler - the handlerpublic HandlerRegistration addSummernoteChangeHandler(SummernoteChangeHandler handler)
HasSummernoteChangeHandlersSummernoteChangeEvent handler.addSummernoteChangeHandler in interface HasSummernoteChangeHandlershandler - the handlerpublic String getCode()
public boolean isEmpty()
true if the content is empty.<p><br></p>
for focus, even if contents is empty. So summernote supports this method
for helping to check contents is empty.true if the editor is emptypublic void clear()
_emptyPara_: <p><br></p>clear in interface HasWidgetsclear in class Panelpublic void setEnabled(boolean enabled)
setEnabled in interface HasEnabledpublic boolean isEnabled()
isEnabled in interface HasEnabledpublic void reset()
public void reconfigure()
public void insertImages(JsArray<SummernoteImageUploadEvent.ImageFile> images)
images - Copyright © 2017. All rights reserved.