blockly > icons > CommentIcon

icons.CommentIcon class

An icon which allows the user to add comment text to a block.

Signature:

export declare class CommentIcon extends Icon implements IHasBubble, ISerializable 

Extends: Icon

Implements: IHasBubble, ISerializable

Constructors

Constructor Modifiers Description
(constructor)(sourceBlock) Constructs a new instance of the CommentIcon class

Properties

Property Modifiers Type Description
sourceBlock

protected

readonly

Block
TYPE

static

readonly

IconType<import("../interfaces/i_comment_icon.js").ICommentIcon> The type string used to identify this icon.
WEIGHT

static

readonly

(not declared) The weight this icon has relative to other icons. Icons with more positive weight values are rendered farther toward the end of the block.

Methods

Method Modifiers Description
applyColour()
bubbleIsVisible()
dispose()
getBubbleSize()
getSize()
getText() Returns the text of this comment.
getType()
getWeight()
initView(pointerdownListener)
isClickableInFlyout()
loadState(state) Applies the given state to this comment.
onClick()
onLocationChange(blockOrigin)
onSizeChange() Updates the size of this icon in response to changes in the size of the input bubble.
onTextChange() Updates the text of this comment in response to changes in the text of the input bubble.
saveState()
setBubbleSize(size) Sets the size of the editable bubble for this comment. Resizes the bubble if it is visible.
setBubbleVisible(visible)
setText(text) Sets the text of this comment. Updates any bubbles if they are visible.
updateEditable() Updates the state of the bubble (editable / noneditable) to reflect the state of the bubble if the bubble is currently shown.