Enum SelectionType
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
选择类型
Selection
的类型。
SelectionType
表示所选一个或多个对象中最具体的类型。例如,如果在 Table
中选择了一个或多个 TableCell
实例,则选择类型为 SelectionType.TABLE_CELL
。您可以使用 Selection.getTableCellRange
检索 TableCellRange
。您可以使用 Selection.getPageElementRange
检索 Table
,并从 Selection.getCurrentPage
检索 Page
。
如需调用枚举,您可以调用其父类、名称和属性。例如
SlidesApp.SelectionType.TEXT
。
属性
属性 | 类型 | 说明 |
UNSUPPORTED | Enum | 不受支持的选择类型。 |
NONE | Enum | 未选择。 |
TEXT | Enum | 文本选择。 |
TABLE_CELL | Enum | 选择表格单元格。 |
PAGE | Enum | 缩略图影片片段中的页面选择。 |
PAGE_ELEMENT | Enum | 页面元素选择。 |
CURRENT_PAGE | Enum | 当前页面选择。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eSelectionType\u003c/code\u003e identifies the specific type of selected objects in Google Slides, like text, table cells, or pages.\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple objects of the same type are selected, \u003ccode\u003eSelectionType\u003c/code\u003e reflects the most specific type, enabling access to properties like \u003ccode\u003eTableCellRange\u003c/code\u003e or \u003ccode\u003ePageElementRange\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSelectionType\u003c/code\u003e has several enum values, including \u003ccode\u003eUNSUPPORTED\u003c/code\u003e, \u003ccode\u003eNONE\u003c/code\u003e, \u003ccode\u003eTEXT\u003c/code\u003e, \u003ccode\u003eTABLE_CELL\u003c/code\u003e, \u003ccode\u003ePAGE\u003c/code\u003e, \u003ccode\u003ePAGE_ELEMENT\u003c/code\u003e, and \u003ccode\u003eCURRENT_PAGE\u003c/code\u003e, representing different selection states.\u003c/p\u003e\n"],["\u003cp\u003eYou can access these values using the syntax \u003ccode\u003eSlidesApp.SelectionType.TEXT\u003c/code\u003e (replace \u003ccode\u003eTEXT\u003c/code\u003e with the desired property).\u003c/p\u003e\n"]]],[],null,["# Enum SelectionType\n\nSelectionType\n\nType of [Selection](/apps-script/reference/slides/selection).\n\nThe [SelectionType](#) represents the most specific type of one or more objects that are\nselected. As an example if one or more [TableCell](/apps-script/reference/slides/table-cell) instances are selected in a [Table](/apps-script/reference/slides/table), the selection type is `Selection``Type.TABLE_CELL`. The [TableCellRange](/apps-script/reference/slides/table-cell-range) can be\nretrieved by using the `Selection.getTableCellRange`. The [Table](/apps-script/reference/slides/table) can be retrieved by\nusing the `Selection.getPageElementRange` and the [Page](/apps-script/reference/slides/page) can be retrieved from the\n`Selection.getCurrentPage`.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nSlidesApp.SelectionType.TEXT`. \n\n### Properties\n\n| Property | Type | Description |\n|----------------|--------|--------------------------------------------|\n| `UNSUPPORTED` | `Enum` | A selection type that is not supported. |\n| `NONE` | `Enum` | No selection. |\n| `TEXT` | `Enum` | Text selection. |\n| `TABLE_CELL` | `Enum` | Table cell selection. |\n| `PAGE` | `Enum` | Page selection in the thumbnail flimstrip. |\n| `PAGE_ELEMENT` | `Enum` | Page element selection. |\n| `CURRENT_PAGE` | `Enum` | Current page selection. |"]]