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 Detail

      • DEFAULT

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

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zkmax.inp.Tbeditor"

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

        @Nullable
        java.util.Map<java.lang.String,​java.lang.Object> getConfig()
        Returns the current configuration of the tbeditor
      • withConfig

        ITbeditor withConfig​(@Nullable
                             java.util.Map<java.lang.String,​? extends java.lang.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 java.lang.String getValue()
        Returns editor's content with html format
      • withValue

        ITbeditor withValue​(java.lang.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​(java.lang.String value)
        Returns the instance with the given value.
        Parameters:
        value - The html content
      • ofId

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