Package org.zkoss.stateless.sul
Interface ITbeditor
- All Superinterfaces:
IAnyGroup<ITbeditor>,IComponent<ITbeditor>,IHtmlBasedComponent<ITbeditor>,IXulElement<ITbeditor>
Immutable
Tbeditor component
A component which is similar to ckeditor but is lightweight and efficient.
Support @Action
| Name | Action Type |
|---|---|
| onChange | ActionData: InputData
Denotes the content of an input component has been modified by the user. |
| onChanging | ActionData: InputData
Denotes that user is changing the content of an input component. |
Example
@RichletMapping("/example")
public IComponent example() {
return ITbeditor.of("this is a demo for <b>trumbowy</b> editor!!");
}
Customized Properties
Tbeditor provides a way for users to customize their own properties, check
official document
for the detail. Here shows a simple example how to programmatic change the property.
Note: Not support all properties, for example, localization, custom skin,
are not supported.
@RichletMapping("/customizedProperties")
public IComponent customizedProperties() {
Map config = new HashMap();
config.put("btns", new String[] {"bold", "italic", "link"});
return ITbeditor.of("this is a demo for <b>trumbowy</b> editor!!")
.withConfig(config);
}
- Author:
- katherine
- See Also:
-
Tbeditor
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeITbeditor.static classBuilds an updater of typeITbeditorforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the current configuration of the tbeditordefault StringgetValue()Returns editor's content with html formatdefault StringReturns the client widget class.static ITbeditorReturns the instance with the given value.static ITbeditorReturns the instance with the given id.withConfig(Map<String, ? extends Object> config) Returns a copy ofthisimmutable component with the specifiedconfig.Returns a copy ofthisimmutable component with the specifiedvalue.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.tbeditor.Tbeditor"- Specified by:
getWidgetClassin interfaceIComponent<ITbeditor>- Returns:
-
getConfig
Returns the current configuration of the tbeditor -
withConfig
Returns a copy ofthisimmutable component with the specifiedconfig.Sets the editor's configuration,
For more detail, please refer to official document (not support localization for now).
We have to pass a Map as parameter that key is option name, value is option's possible value.
- Parameters:
config- The config to the tbeditorDefault:
null.- Returns:
- A modified copy of the
thisobject
-
getValue
Returns editor's content with html format -
withValue
Returns a copy ofthisimmutable component with the specifiedvalue.Sets the editor's content with html format
- Parameters:
value- The config to the tbeditorDefault:
"".- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the given value.- Parameters:
value- The html content
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-