Constructor

Warning

new Warning(block)

Class for a warning.

Parameter

block

Blockly.Block

The block associated with this warning.

Value must not be null.

Extends
Blockly.Icon

Properties

block_

protected

unknown

The block this icon is attached to.

Inherited from
Blockly.Icon#block_

bubble_

protected

unknown

Bubble UI (if visible).

Inherited from
Blockly.Icon#bubble_

collapseHidden

Does this icon get hidden when the block is collapsed.

iconGroup_

unknown

Inherited from
Blockly.Icon#iconGroup_

iconXY_

protected

unknown

Absolute coordinate of icon's center.

Inherited from
Blockly.Icon#iconXY_

SIZE

Height and width of icons.

Inherited from
Blockly.Icon#SIZE

Methods

computeIconLocation

computeIconLocation()

Notification that the icon has moved, but we don't really know where. Recompute the icon's location from scratch.

Inherited from
Blockly.Icon#computeIconLocation

createBubble

package

createBubble()

Show the bubble.

createIcon

createIcon()

Create the icon on the block.

Inherited from
Blockly.Icon#createIcon

dispose

dispose()

Dispose of this warning.

disposeBubble

package

disposeBubble()

Dispose of the bubble and references to it.

getCorrectedSize

getCorrectedSize() returns Blockly.utils.Size

Get the size of the icon as used for rendering. This differs from the actual size of the icon, because it bulges slightly out of its row rather than increasing the height of its row.

Inherited from
Blockly.Icon#getCorrectedSize
Returns

Height and width.

getIconLocation

getIconLocation() returns Blockly.utils.Coordinate

Returns the center of the block's icon relative to the surface.

Inherited from
Blockly.Icon#getIconLocation
Returns

Object with x and y properties in workspace coordinates.

getText

getText() returns string

Get this warning's texts.

Returns

string All texts concatenated into one string.

iconClick_

protected

iconClick_(e)

Clicking on the icon toggles if the bubble is visible.

Parameter

e

Mouse click event.

Value must not be null.

Inherited from
Blockly.Icon#iconClick_

isVisible

isVisible() returns boolean

Is the associated bubble visible?

Inherited from
Blockly.Icon#isVisible
Returns

True if the bubble is visible.

setIconLocation

setIconLocation(xy)

Notification that the icon has moved. Update the arrow accordingly.

Parameter

xy

Absolute location in workspace coordinates.

Value must not be null.

Inherited from
Blockly.Icon#setIconLocation

setText

setText(text, id)

Set this warning's text.

Parameter

text

string

Warning text (or '' to delete). This supports linebreaks.

id

string

An ID for this text entry to be able to maintain multiple warnings.

setVisible

setVisible(visible)

Show or hide the warning bubble.

Parameter

visible

boolean

True if the bubble should be visible.

updateColour

updateColour()

Change the colour of the associated bubble to match its block.

Inherited from
Blockly.Icon#updateColour

updateEditable

updateEditable()

Add or remove the UI indicating if this icon may be clicked or not.

Inherited from
Blockly.Icon#updateEditable