sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    CURSOR: any

    Mouse cursor style when over the hotspot that initiates editability.

    disposed: boolean

    Has this field been disposed of?

    EDITABLE: boolean

    Editable fields usually show some sort of UI indicating they are editable. They will also be saved by the XML renderer.

    maxDisplayLength: number

    Maximum characters of text to display before adding an ellipsis.

    name: any

    Name of field. Unique within each block. Static labels are usually unnamed.

    SERIALIZABLE: boolean

    Serializable fields are saved by the XML renderer, non-serializable fields are not. Editable fields should also be serializable.

    Methods

    • Updates the field to match the colour/style of the block. Should only be called by BlockSvg.applyColour().

      Returns void

    • Dispose of all DOM objects and events belonging to this editable field.

      Returns void

    • Force a rerender of the block that this field is installed on, which will rerender this field and adjust for any sizing changes. Other fields on the same block will not rerender, because their sizes have already been recorded.

      Returns void

    • Sets the field's value based on the given XML element. Should only be called by Blockly.Xml.

      Parameters

      • fieldElement: Element

        The element containing info about the field's state.

      Returns void

    • Returns whether or not we should flip the field in RTL.

      Returns boolean

      True if we should flip in RTL.

    • Search through the list of inputs and their fields in order to find the parent input of a field.

      Returns Input

      The input that the field belongs to.

    • Returns the bounding box of the rendered field, accounting for workspace scaling.

      Returns Blockly.utils.Rect

      An object with top, bottom, left, and right in pixels relative to the top left corner of the page (window coordinates).

    • Returns the height and width of the field.

      This should in general be the only place render_ gets called from.

      Returns Blockly.utils.Size

      Height and width.

    • Gets the group element for this editable field. Used for measuring the size and for positioning.

      Returns SVGGElement

      The group element.

    • Get the text of this field. Used when the block is collapsed.

      Returns string

      Text representing the value of this field ('true' or 'false').

    • Returns the tooltip text for this field.

      Returns string

      The tooltip text for this field.

    • Gets the validation function for editable fields, or null if not set.

      Returns Function

      Validation function, or null.

    • Get the value of this field, either 'TRUE' or 'FALSE'.

      Returns string

      The value of this field.

    • Get the boolean value of this field.

      Returns boolean

      The boolean value of this field.

    • Initialize everything to render this field. Override methods initModel and initView rather than this method.

      Returns void

    • Initializes the model of the field after it has been installed on a block. No-op by default.

      Returns void

    • Create the block UI for this checkbox.

      Returns void

    • Check whether this field defines the showEditor_ function.

      Returns boolean

      Whether this field is clickable.

    • Check whether this field is currently editable. Some fields are never EDITABLE (e.g. text labels). Other fields may be EDITABLE but may exist on non-editable blocks.

      Returns boolean

      Whether this field is editable and on an editable block

    • Check whether this field should be serialized by the XML renderer. Handles the logic for backwards compatibility and incongruous states.

      Returns boolean

      Whether this field should be serialized or not.

    • Returns whether or not the field is tab navigable.

      Returns boolean

      True if the field is tab navigable.

    • Gets whether this editable field is visible or not.

      Returns boolean

      True if visible.

    • Force a rerender of the block that this field is installed on, which will rerender this field and adjust for any sizing changes. Other fields on the same block will not rerender, because their sizes have already been recorded.

      Returns void

    • Handles the given keyboard shortcut.

      Parameters

      Returns boolean

      True if the shortcut has been handled, false otherwise.

    • Whether this field references any Blockly variables. If true it may need to be handled differently during serialization and deserialization. Subclasses may override this.

      Returns boolean

      True if this field has any variable references.

    • Set the character used for the check mark.

      Parameters

      • character: string

        The character to use for the check mark, or null to use the default.

      Returns void

    • Add the cursor SVG to this fields SVG group.

      Parameters

      • cursorSvg: SVGElement

        The SVG root of the cursor to be added to the field group.

      Returns void

    • Add the marker SVG to this fields SVG group.

      Parameters

      • markerSvg: SVGElement

        The SVG root of the marker to be added to the field group.

      Returns void

    • Sets the tooltip for this field.

      Parameters

      • newTip: TipInfo

        The text for the tooltip, a function that returns the text for the tooltip, a parent object whose tooltip will be used, or null to display the tooltip of the parent block. To not display a tooltip pass the empty string.

      Returns void

    • Sets a new validation function for editable fields, or clears a previously set validator.

      The validator function takes in the new field value, and returns validated value. The validated value could be the input value, a modified version of the input value, or null to abort the change.

      If the function does not return anything (or returns undefined) the new value is accepted as valid. This is to allow for fields using the validated function as a field-level change event notification.

      Parameters

      • handler: Function

        The validator function or null to clear a previous validator.

      Returns void

    • Used to change the value of the field. Handles validation and events. Subclasses should override doClassValidation_ and doValueUpdate_ rather than this method.

      Parameters

      • newValue: any

        New value.

      Returns void

    • Sets whether this editable field is visible or not. Should only be called by input.setVisible.

      Parameters

      • visible: boolean

        True if visible.

      Returns void

    • Show an editor when the field is clicked only if the field is clickable.

      Parameters

      • Optionalopt_e: Event

        Optional mouse event that triggered the field to open, or undefined if triggered programmatically.

      Returns void

    • Serializes this field's value to XML. Should only be called by Blockly.Xml.

      Parameters

      • fieldElement: Element

        The element to populate with info about the field's state.

      Returns Element

      The element containing info about the field's state.

    • Add or remove the UI indicating if this field is editable or not.

      Returns void