Stay organized with collections
Save and categorize content based on your preferences.
blockly > BasicCursor
BasicCursor class
Class for a basic cursor. This will allow the user to get to all nodes in the AST by hitting next or previous.
Signature:
export declare class BasicCursor extends Cursor
Extends: Cursor
Constructors
Constructor |
Modifiers |
Description |
(constructor)() |
|
Constructs a new instance of the BasicCursor class |
Properties
Property |
Modifiers |
Type |
Description |
registrationName |
static
readonly
|
(not declared) |
Name used for registering a basic cursor. |
Methods
Method |
Modifiers |
Description |
getNextNode_(node, isValid) |
protected |
Uses pre order traversal to navigate the Blockly AST. This will allow a user to easily navigate the entire Blockly AST without having to go in and out levels on the tree. |
getPreviousNode_(node, isValid) |
protected |
Reverses the pre order traversal in order to find the previous node. This will allow a user to easily navigate the entire Blockly AST without having to go in and out levels on the tree. |
in() |
|
For a basic cursor we only have the ability to go next and previous, so in will also allow the user to get to the next node in the pre order traversal. |
next() |
|
Find the next node in the pre order traversal. |
out() |
|
For a basic cursor we only have the ability to go next and previous, so out will allow the user to get to the previous node in the pre order traversal. |
prev() |
|
Find the previous node in the pre order traversal. |
validNode_(node) |
protected |
Decides what nodes to traverse and which ones to skip. Currently, it skips output, stack and workspace nodes. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-09-18 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."]]