@Override protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case FOCUS_ITEM: return navigation.indicatorButtons.getSelectedToggle(); case ITEM_COUNT: return navigation.indicatorButtons.getToggles().size(); case ITEM_AT_INDEX: { Integer index = (Integer) parameters[0]; if (index == null) return null; return navigation.indicatorButtons.getToggles().get(index); } default: return super.queryAccessibleAttribute(attribute, parameters); } }
@Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case FOCUS_ITEM: return tabHeaderArea.getTabHeaderSkin(selectedTab); case ITEM_COUNT: return tabHeaderArea.headersRegion.getChildren().size(); case ITEM_AT_INDEX: { Integer index = (Integer) parameters[0]; if (index == null) return null; return tabHeaderArea.headersRegion.getChildren().get(index); } default: return super.queryAccessibleAttribute(attribute, parameters); } }
private void updatePageIndicators() { for (int i = 0; i < indicatorButtons.getToggles().size(); i++) { IndicatorButton ib = (IndicatorButton) indicatorButtons.getToggles().get(i); if (ib.getPageNumber() == currentIndex) { ib.setSelected(true); updatePageInformation(); break; } } getSkinnable().notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM); }
@Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case TEXT: return getText(); case SELECTED: return isSelected(); default: return super.queryAccessibleAttribute(attribute, parameters); } }
@Override public void select(int index) { if (index < 0 || (getItemCount() > 0 && index >= getItemCount()) || (index == getSelectedIndex() && getModelItem(index).isSelected())) { return; } // Unselect the old tab if (getSelectedIndex() >= 0 && getSelectedIndex() < tabPane.getTabs().size()) { tabPane.getTabs().get(getSelectedIndex()).setSelected(false); } setSelectedIndex(index); DockTab tab = getModelItem(index); if (tab != null) { setSelectedItem(tab); } // Select the new tab if (getSelectedIndex() >= 0 && getSelectedIndex() < tabPane.getTabs().size()) { tabPane.getTabs().get(getSelectedIndex()).setSelected(true); } /* Does this get all the change events */ tabPane.notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM); }
@Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case TEXT: return getTab().getText(); case SELECTED: return selectedTab == getTab(); default: return super.queryAccessibleAttribute(attribute, parameters); } }
@Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case FOCUS_ITEM: /* Internally comboBox reassign its focus the text field. * For the accessibility perspective it is more meaningful * if the focus stays with the comboBox control. */ return getParent(); default: return super.queryAccessibleAttribute(attribute, parameters); } }
@Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { case FOCUS_ITEM: // keep focus on parent control return getParent(); default: return super.queryAccessibleAttribute(attribute, parameters); } }
/** * {@inheritDoc} */ @Override public void select(int index) { if (index < 0 || (getItemCount() > 0 && index >= getItemCount()) || (index == getSelectedIndex() && getModelItem(index).isSelected())) { //Tab already selected, call listener and return if (Objects.nonNull(clickOnSelectedTabListener)) { clickOnSelectedTabListener.clickOnSelectedTab(getModelItem(index)); } return; } // Unselect the old tab setSelected(false); setSelectedIndex(index); Tab tab = getModelItem(index); if (tab != null) { setSelectedItem(tab); } // Select the new tab setSelected(true); /* Does this get all the change events */ tabPane.notifyAccessibleAttributeChanged(AccessibleAttribute.FOCUS_ITEM); }
/** * Gets the label associated with a node. If the node does not have a label, an empty optional is returned. * * @param node the node to get the label for */ public static Optional<Label> getLabel(Node node) { return Optional.ofNullable((Label) node.queryAccessibleAttribute(AccessibleAttribute.LABELED_BY)); }