/* * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javafx.scene; import java.time.LocalDate; import javafx.collections.ObservableList; import javafx.geometry.Bounds; import javafx.geometry.Orientation; import javafx.scene.input.KeyCombination; import javafx.scene.text.Font; /** * This enum describes the attributes that an assistive technology * such as a screen reader can request from the scene graph. * * The {@link AccessibleRole} dictates the set of attributes that * the screen reader will request for a particular control. For * example, a slider is expected to return a double that represents * the current value. *

* Attributes may have any number of parameters, depending on the particular attribute.

*

* When the value of an attribute is changed by a node, it must notify the assistive technology * using {@link Node#notifyAccessibleAttributeChanged(AccessibleAttribute)}. This will allow * the screen reader to inform the user that a value has changed. The most common form of * notification is focus change. *

* * @see Node#queryAccessibleAttribute(AccessibleAttribute, Object...) * @see Node#notifyAccessibleAttributeChanged(AccessibleAttribute) * @see AccessibleRole * @see AccessibleAttribute#ROLE * * @since JavaFX 8u40 */ public enum AccessibleAttribute { /** * Returns the accelerator for the node.

* */ ACCELERATOR(KeyCombination.class), /** * Returns the bounds for the node.

* */ BOUNDS(Bounds.class), /** * Returns the array of bounding rectangles for the given character range.

* */ BOUNDS_FOR_RANGE(Bounds[].class), /** * Returns the caret offset for the node.

* */ CARET_OFFSET(Integer.class), /** * Returns the children for the node.

* */ CHILDREN(ObservableList.class), /** * Returns the column at the given index.

* */ COLUMN_AT_INDEX(Node.class), /** * Returns the cell at the given row and column indices.

* */ CELL_AT_ROW_COLUMN(Node.class), /** * Returns the column count for the node.

* */ COLUMN_COUNT(Integer.class), /** * Returns the column index for the node.

* */ COLUMN_INDEX(Integer.class), /** * Returns the contents of the node.

* */ CONTENTS(Node.class), /** * Returns true if the node is disabled, otherwise false.

* */ DISABLED(Boolean.class), /** * Returns the depth of a row in the disclosure hierarchy.

* */ DISCLOSURE_LEVEL(Integer.class), /** * Returns the local date for the node.

* */ DATE(LocalDate.class), /** * Returns true if the node is editable, otherwise false.

* */ EDITABLE(Boolean.class), /** * Returns true if the node is expanded, otherwise false.

* */ EXPANDED(Boolean.class), /** * Returns the focus item. *

* Used for controls such as TabPane, TableView, ListView * where the assistive technology focus is different from the * normal focus node. For example, a table control will have focus, * while a cell inside the table might have the screen reader focus. *

* */ FOCUS_ITEM(Node.class), /** * Returns the focus node. * Type: Node *

* When this attribute is requested from the Scene, the default implementation * returns {@link Scene#focusOwnerProperty()}. *

* */ FOCUS_NODE(Node.class), /** * Returns true if the node is focused, otherwise false.

* */ FOCUSED(Boolean.class), /** * Returns the font for the node.

* */ FONT(Font.class), /** * Returns the header for the node.

* */ HEADER(Node.class), /** * Returns the help text for the node.

* */ HELP(String.class), /** * Returns the horizontal scroll bar for the node.

* */ HORIZONTAL_SCROLLBAR(Node.class), /** * Returns true of the node is indeterminaite, otherwise false.

* */ INDETERMINATE(Boolean.class), /** * Returns the item at the given index.

* */ ITEM_AT_INDEX(Node.class), /** * Returns the item count for the node.

* */ ITEM_COUNT(Integer.class), /** * Returns the index for the node.

* */ INDEX(Integer.class), /** * Returns the node that is the label for this node. *

When {@link javafx.scene.control.Label#labelFor} is set, * the default implementation of {@code LABELED_BY} uses this * relationship to return the appropriate node to the screen * reader.

* */ LABELED_BY(Node.class), /** * Returns true if the node is a leaf element, otherwise false.

* */ LEAF(Boolean.class), /** * Returns the line end offset of the given line index.

* */ LINE_END(Integer.class), /** * Returns the line index of the given character offset.

* */ LINE_FOR_OFFSET(Integer.class), /** * Returns the line start offset of the given line index.

* */ LINE_START(Integer.class), /** * Returns the minimum value for the node.

* */ MIN_VALUE(Double.class), /** * Returns the maximum value for the node.

* */ MAX_VALUE(Double.class), /** * Returns the mnemonic for the node.

* */ MNEMONIC(String.class), /** * Returns true if the node allows for multiple selection, otherwise false.

* */ MULTIPLE_SELECTION(Boolean.class), /** * Returns the node at the given location.

* */ NODE_AT_POINT(Node.class), /** * Returns the character offset at the given location.

* */ OFFSET_AT_POINT(Integer.class), /** * Returns the orientation of the node.

* */ ORIENTATION(Orientation.class), /** * Return the overflow button for the node.

* */ OVERFLOW_BUTTON(Node.class), /** * Returns the parent for the node.

* */ PARENT(Parent.class), /** * Returns the parent menu for the node.

* */ PARENT_MENU(Node.class), /** * Returns the role for the node.

* */ ROLE(AccessibleRole.class), /** * Returns the role description for the node.

* */ ROLE_DESCRIPTION(String.class), /** * Returns the row at the given index.

* */ ROW_AT_INDEX(Node.class), /** * Returns the row count for the node.

* */ ROW_COUNT(Integer.class), /** * Returns the row index of the node.

* */ ROW_INDEX(Integer.class), /** * Returns the scene for the node.

* */ SCENE(Scene.class), /** * Returns true if the node is selected, otherwise false.

* */ SELECTED(Boolean.class), /** * Returns the list of selected items for the node.

* */ SELECTED_ITEMS(ObservableList.class), /** * Returns the text selection end offset for the node.

* */ SELECTION_END(Integer.class), /** * Returns the text selection start offset for the node.

* */ SELECTION_START(Integer.class), /** * Returns the sub menu for the node.

* */ SUBMENU(Node.class), /** * Returns the text for the node. * E.g. * *

* */ TEXT(String.class), /** * Returns a tree item at the given index, relative to its TREE_ITEM_PARENT.

* */ TREE_ITEM_AT_INDEX(Node.class), /** * Returns the tree item count for the node, relative to its TREE_ITEM_PARENT.

* */ TREE_ITEM_COUNT(Integer.class), /** * Returns the parent item for the item, or null if the item is the root.

* */ TREE_ITEM_PARENT(Node.class), /** * Returns the value for the node.

* */ VALUE(Double.class), /** * Returns the vertical scroll bar for the node.

* */ VERTICAL_SCROLLBAR(Node.class), /** * Returns true if node is visible, otherwise false.

* */ VISIBLE(Boolean.class), /** * Returns true if the node has been visited, otherwise false.

* */ VISITED(Boolean.class), ; private Class returnClass; AccessibleAttribute(Class returnClass) { this.returnClass = returnClass; } public Class getReturnType() { return returnClass; } }