קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
blockly > ContextMenuRegistry > getContextMenuOptions
הפונקציה מקבלת את האפשרויות התקינות של תפריט ההקשר בהיקף הנתון. האפשרויות נכללות רק אם פונקציית preconditionFn מראה שהן לא צריכות להיות מוסתרות.
Signature:
getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];
פרמטרים
| פרמטר |
סוג |
תיאור |
| היקף |
היקף |
ההיקף הנוכחי של תפריט ההקשר (כלומר, סביבת העבודה או הבלוק הספציפיים שעליהם לוחצים). |
| menuOpenEvent |
אירוע |
האירוע שגרם לפתיחת התפריט. |
החזרים:
ContextMenuOption[]
רשימת ContextMenuOptions
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],["The `getContextMenuOptions` method retrieves valid context menu options. It takes `scopeType` (e.g., block or workspace) and the current `scope` (specific workspace or block) as parameters. It returns a list of `ContextMenuOption` objects. Blocks are included only if a defined precondition function indicates they should be shown. This method determines what menu options are available based on where the context menu is being displayed.\n"]]