Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > Events > VarRename
Class Events.VarRename
Memberi tahu pemroses bahwa model variabel diganti namanya.
Tanda Tangan:
export declare class VarRename extends VarBase
Memperluas: VarBase
Konstruktor
Properti
Properti |
Pengubah |
Jenis |
Deskripsi |
newName? |
|
string |
(Opsional) Nama baru variabel. |
oldName? |
|
string |
(Opsional) Nama variabel sebelumnya. |
jenis |
|
EventType |
|
Metode
Metode |
Pengubah |
Deskripsi |
run(forward) |
|
Jalankan peristiwa penggantian nama variabel. |
toJson() |
|
Enkode peristiwa sebagai JSON. |
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-05-16 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-05-16 UTC."],[[["The `Blockly.Events.VarRename` class handles events related to renaming variable models within Blockly workspaces."],["It extends the `Blockly.Events.VarBase` class and includes properties for the old and new variable names."],["Developers can use the `run` method to execute a variable rename event and `toJson` for serialization."],["Instances of this class are created with a constructor accepting the variable and its new name."]]],["The `VarRename` class, extending `VarBase`, notifies listeners about variable model renames. It is constructed with an optional variable and new name. Key properties include `newName` and `oldName` (both optional strings) to track the variable's name change. The class also defines the `type` property. Core methods include `run(forward)` to execute the rename and `toJson()` to convert the event into JSON format.\n"]]