Class RichTextItem

All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasCanEditChangedHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPendingStatusChangedHandlers, HasPickerIconClickHandlers, HasReadOnlyDisplayChangedHandlers, HasShowContextMenuHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers, HasValueHoverHandlers, HasValueIconClickHandlers

public class RichTextItem extends CanvasItem
FormItem for rich text (HTML) editing. Makes use of a RichTextEditor as the editing interface.
  • Constructor Details

    • RichTextItem

      public RichTextItem()
    • RichTextItem

      public RichTextItem(JavaScriptObject jsObj)
    • RichTextItem

      public RichTextItem(String name)
    • RichTextItem

      public RichTextItem(String name, String title)
  • Method Details

    • getOrCreateRef

      public static RichTextItem getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changePickerIconDefaults

      public static void changePickerIconDefaults(FormItemIcon defaults)
    • setControlGroups

      public RichTextItem setControlGroups(String... controlGroups)
      RichTextEditor.controlGroups to display for this editor. Each controlGroup should be a property set either on this item or on the RichTextEditor prototype and should be set to an array of ControlNames.

      Note : This is an advanced setting

      Parameters:
      controlGroups - New controlGroups value. Default value is null
      Returns:
      RichTextItem instance, for chaining setter calls
    • setEndRow

      public RichTextItem setEndRow(Boolean endRow)
      By default RichTextItems take up an entire row
      Overrides:
      setEndRow in class FormItem
      Parameters:
      endRow - New endRow value. Default value is true
      Returns:
      RichTextItem instance, for chaining setter calls
      See Also:
    • getEndRow

      public Boolean getEndRow()
      By default RichTextItems take up an entire row
      Overrides:
      getEndRow in class FormItem
      Returns:
      Current endRow value. Default value is true
      See Also:
    • setMoveFocusOnTab

      public RichTextItem setMoveFocusOnTab(boolean moveFocusOnTab)
      If the user presses the "Tab" key, should focus be taken from this editor? If set to false a "Tab" keypress will cause a Tab character to be inserted into the text, and focus will be left in the edit area.

      If this method is called after the component has been drawn/initialized: Setter for moveFocusOnTab.
      Parameters:
      moveFocusOnTab - new value for moveFocusOnTab. Default value is true
      Returns:
      RichTextItem instance, for chaining setter calls
    • getMoveFocusOnTab

      public boolean getMoveFocusOnTab()
      If the user presses the "Tab" key, should focus be taken from this editor? If set to false a "Tab" keypress will cause a Tab character to be inserted into the text, and focus will be left in the edit area.
      Returns:
      Current moveFocusOnTab value. Default value is true
    • setShouldSaveValue

      public RichTextItem setShouldSaveValue(Boolean shouldSaveValue)
      Should this item's value be saved in the form's values and hence returned from form.getValues()?

      shouldSaveValue:false is used to mark formItems which do not correspond to the underlying data model and should not save a value into the form's values. Example includes visual separators, password re-type fields, or checkboxes used to show/hide other form items.

      A shouldSaveValue:false item should be given a value either via FormItem.defaultValue or by calling form.setValue(item, value) or formItem.setValue(value). Providing a value via form.values or form.setValues() will automatically switch the item to shouldSaveValue:true.

      Note that

      • if an item is shouldSaveValue true, but has no name, a warning is logged, and shouldSaveValue will be set to false.
      Overrides:
      setShouldSaveValue in class CanvasItem
      Parameters:
      shouldSaveValue - New shouldSaveValue value. Default value is true
      Returns:
      RichTextItem instance, for chaining setter calls
    • getShouldSaveValue

      public Boolean getShouldSaveValue()
      Should this item's value be saved in the form's values and hence returned from form.getValues()?

      shouldSaveValue:false is used to mark formItems which do not correspond to the underlying data model and should not save a value into the form's values. Example includes visual separators, password re-type fields, or checkboxes used to show/hide other form items.

      A shouldSaveValue:false item should be given a value either via FormItem.defaultValue or by calling form.setValue(item, value) or formItem.setValue(value). Providing a value via form.values or form.setValues() will automatically switch the item to shouldSaveValue:true.

      Note that

      • if an item is shouldSaveValue true, but has no name, a warning is logged, and shouldSaveValue will be set to false.
      Overrides:
      getShouldSaveValue in class CanvasItem
      Returns:
      Current shouldSaveValue value. Default value is true
    • setShowTitle

      public RichTextItem setShowTitle(Boolean showTitle)
      Don't show the title for rich text items by default
      Overrides:
      setShowTitle in class FormItem
      Parameters:
      showTitle - New showTitle value. Default value is false
      Returns:
      RichTextItem instance, for chaining setter calls
    • getShowTitle

      public Boolean getShowTitle()
      Don't show the title for rich text items by default
      Overrides:
      getShowTitle in class FormItem
      Returns:
      Current showTitle value. Default value is false
    • setStartRow

      public RichTextItem setStartRow(Boolean startRow)
      By default RichTextItems take up an entire row
      Overrides:
      setStartRow in class FormItem
      Parameters:
      startRow - New startRow value. Default value is true
      Returns:
      RichTextItem instance, for chaining setter calls
      See Also:
    • getStartRow

      public Boolean getStartRow()
      By default RichTextItems take up an entire row
      Overrides:
      getStartRow in class FormItem
      Returns:
      Current startRow value. Default value is true
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(RichTextItem richTextItemProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      richTextItemProperties - properties that should be used as new defaults when instances of this class are created
      See Also: