Skip to main content

Home > 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

ConstructorModifiersDescription
(constructor)(sourceBlock)Constructs a new instance of the CommentIcon class

Properties

PropertyModifiersTypeDescription
sourceBlockprotected readonlyBlock
TYPEstatic readonlyIconType<import("../interfaces/i_comment_icon.js").ICommentIcon>The type string used to identify this icon.
WEIGHTstatic 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

MethodModifiersDescription
applyColour()
bubbleIsVisible()
createBubble()protected
dispose()
getBubble()See IHasBubble.getBubble.
getBubbleLocation()
getBubbleSize()
getSize()
getText()Returns the text of this comment.
getType()
getWeight()
initView(pointerdownListener)
isClickableInFlyout()
loadState(state)Applies the given state to this comment.
onBubbleLocationChange()
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()
setBubbleLocation(location)Sets the location of the comment bubble in the workspace.
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.