Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
blockly > ComponentManager > getComponents
Méthode ComponentManager.getComponents()
Récupère tous les composants ayant la capacité spécifiée.
Signature :
getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
Paramètres
Paramètre |
Type |
Description |
capacité |
chaîne | Capacité<T> |
Capacité du composant. |
triée |
booléen |
Permet de renvoyer ou non une liste triée par pondération. |
Renvoie :
M[]
Composants correspondant à la capacité spécifiée.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/08/29 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2024/08/29 (UTC)."],[[["The `getComponents` method retrieves all components possessing a given capability."],["It accepts the capability (as a string or `Capability` object) and a boolean indicating whether to sort results by weight."],["The method returns an array of components matching the specified capability."]]],["The `getComponents` method retrieves components possessing a specific capability, defined by either a string or a `Capability\u003cT\u003e` object. It accepts an optional boolean parameter, `sorted`, to determine if the returned list should be ordered by component weights. The method returns an array (`T[]`) of components that match the provided capability. The method's core function is to filter and return relevant components based on a specified capability, with an option for sorted results.\n"]]