Enum TabType
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מקש Tabהקלדה
ספירה של כל סוגי הכרטיסיות.
כדי לקרוא למאפיין enum, צריך לקרוא לכיתה ההורה, לשם ולנכס שלו. לדוגמה,
DocumentApp.TabType.TAB
.
אפשר להשתמש בספירה TabType
כדי לבדוק את הסוג של רכיב נתון, לדוגמה:
const tab = DocumentApp.getActiveDocument().getActiveTab();
// Use getType() to determine the tab's type before casting.
if (tab.getType() === DocumentApp.TabType.DOCUMENT_TAB) {
// It's a document tab, write some text to it.
tab.asDocumentTab().setText('Hello World!');
} else {
// There are currently no types other than DOCUMENT_TAB.
}
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eTabType\u003c/code\u003e is an enumeration used to identify different tab types within a Google Doc.\u003c/p\u003e\n"],["\u003cp\u003eCurrently, \u003ccode\u003eDOCUMENT_TAB\u003c/code\u003e is the only available tab type, representing a document tab that can be interacted with using the \u003ccode\u003eDocumentTab\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the type of a tab using \u003ccode\u003egetType()\u003c/code\u003e and then perform actions based on its specific type, such as adding text to a \u003ccode\u003eDOCUMENT_TAB\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `TabType` enumeration defines the types of tabs within a document. It currently has one property: `DOCUMENT_TAB`, which represents a DocumentTab. To use `TabType`, access it via `DocumentApp.TabType.DOCUMENT_TAB`. The `getType()` method can determine a tab's type, and you should use it for type checking before casting it as a Document Tab with `asDocumentTab()`.\n"],null,["# Enum TabType\n\nTabType\n\nAn enumeration of all the tab types.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nDocumentApp.TabType.TAB`.\n\nUse the `Tab``Type` enumeration to check the type of a given element, for instance:\n\n```javascript\nconst tab = DocumentApp.getActiveDocument().getActiveTab();\n// Use getType() to determine the tab's type before casting.\nif (tab.getType() === DocumentApp.TabType.DOCUMENT_TAB) {\n // It's a document tab, write some text to it.\n tab.asDocumentTab().setText('Hello World!');\n} else {\n // There are currently no types other than DOCUMENT_TAB.\n}\n``` \n\n### Properties\n\n| Property | Type | Description |\n|----------------|--------|----------------------------------------------------------------------------------------|\n| `DOCUMENT_TAB` | `Enum` | The type corresponding to [DocumentTab](/apps-script/reference/document/document-tab). |"]]