Interface ITbeditor

All Superinterfaces:
IAnyGroup<ITbeditor>, IComponent<ITbeditor>, IHtmlBasedComponent<ITbeditor>, IXulElement<ITbeditor>

public interface ITbeditor extends IXulElement<ITbeditor>, IAnyGroup<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
  • Field Details

    • DEFAULT

      static final ITbeditor DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zkmax.tbeditor.Tbeditor"

      Specified by:
      getWidgetClass in interface IComponent<ITbeditor>
      Returns:
    • getConfig

      @Nullable Map<String,Object> getConfig()
      Returns the current configuration of the tbeditor
    • withConfig

      ITbeditor withConfig(@Nullable Map<String,? extends Object> config)
      Returns a copy of this immutable component with the specified config.

      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 tbeditor

      Default: null.

      Returns:
      A modified copy of the this object
    • getValue

      default String getValue()
      Returns editor's content with html format
    • withValue

      ITbeditor withValue(String value)
      Returns a copy of this immutable component with the specified value.

      Sets the editor's content with html format

      Parameters:
      value - The config to the tbeditor

      Default: "".

      Returns:
      A modified copy of the this object
    • of

      static ITbeditor of(String value)
      Returns the instance with the given value.
      Parameters:
      value - The html content
    • ofId

      static ITbeditor ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component