本文整理汇总了Java中javax.accessibility.AccessibleSelection.removeAccessibleSelection方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibleSelection.removeAccessibleSelection方法的具体用法?Java AccessibleSelection.removeAccessibleSelection怎么用?Java AccessibleSelection.removeAccessibleSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.accessibility.AccessibleSelection
的用法示例。
在下文中一共展示了AccessibleSelection.removeAccessibleSelection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemoveAccessibleSelection
import javax.accessibility.AccessibleSelection; //导入方法依赖的package包/类
public final void testRemoveAccessibleSelection() {
AccessibleSelection as = ac.getAccessibleSelection();
list.add("item1");
list.add("item2");
assertEquals(0, list.getSelectedItems().length);
as.removeAccessibleSelection(0);
as.removeAccessibleSelection(1);
assertEquals(0, list.getSelectedItems().length);
list.select(0);
assertEquals(1, list.getSelectedItems().length);
as.removeAccessibleSelection(1);
assertEquals(1, list.getSelectedItems().length);
as.removeAccessibleSelection(0);
assertEquals(0, list.getSelectedItems().length);
}
示例2: performImpl
import javax.accessibility.AccessibleSelection; //导入方法依赖的package包/类
@Override
public void performImpl(Object... args) {
if (isContainer)
return;
((Window) getWindowModel().getRef()).requestFocus();
AccessibleSelection aSelection = JFCUtil.getAccessibleContext(componentModel).getAccessibleSelection();
Accessible accessibleObj = (Accessible) componentModel.getRef();
if (accessibleObj instanceof JTabbedPane)// AccessibleRole.PAGE_TAB_LIST
{
((JTabbedPane) accessibleObj).setSelectedIndex(getChooseIndex());
// TestLogger.info("\[email protected] Tab selection:" + getChooseIndex());
} else if (accessibleObj instanceof JComboBox) {
JComboBox comboBox = (JComboBox) accessibleObj;
comboBox.setSelectedIndex(getChooseIndex());
// TestLogger.info("\[email protected] ComboBox item selection:" + getChooseIndex());
} else {
if (aSelection.isAccessibleChildSelected(getChooseIndex()))
aSelection.removeAccessibleSelection(getChooseIndex());
else
aSelection.addAccessibleSelection(getChooseIndex());
// TestLogger.info("\[email protected] selection:" + getChooseIndex());
}
}