Stay organized with collections
Save and categorize content based on your preferences.
blockly > Input > makeConnection
Constructs a connection based on the type of this input's source block. Properly handles constructing headless connections for headless blocks and rendered connections for rendered blocks.
Signature:
protected makeConnection(type: ConnectionType): Connection;
Parameters
Returns:
Connection
a connection of the given type, which is either a headless or rendered connection, based on the type of this input's source block.
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.
[[["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."],[[["The `Input.makeConnection()` method creates a Connection object, either headless or rendered, matching the input's source block type."],["It uses the provided `ConnectionType` to determine the type of connection to construct."],["This method is primarily used internally for building connections between blocks within Blockly."]]],["The `Input.makeConnection()` method creates a connection, adapting to the source block's type. It accepts a `ConnectionType` parameter and returns a `Connection` object. This method intelligently determines whether to construct a headless connection for headless blocks or a rendered connection for rendered blocks. The core action is to generate the appropriate connection based on the block type.\n"]]