本文整理汇总了Java中javax.accessibility.AccessibleAction.getAccessibleActionCount方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibleAction.getAccessibleActionCount方法的具体用法?Java AccessibleAction.getAccessibleActionCount怎么用?Java AccessibleAction.getAccessibleActionCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.accessibility.AccessibleAction
的用法示例。
在下文中一共展示了AccessibleAction.getAccessibleActionCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSupportedBy
import javax.accessibility.AccessibleAction; //导入方法依赖的package包/类
@Override
public boolean isSupportedBy(ComponentModel model) {
// skip fileChooser dialog.
WindowModel winModel = GUIModelExtractor.getWindowModel(model);
if (winModel != null && winModel.get("windowlisteners") != null
&& winModel.get("windowlisteners").indexOf("javax.swing.JFileChooser") >= 0) {
return false;
}
AccessibleAction aAction = JFCUtil.getAccessibleContext(model).getAccessibleAction();
Accessible accessibleObj = (Accessible) model.getRef();
if (aAction == null)
return false;
if (aAction.getAccessibleActionCount() == 0)
return false;
if (accessibleObj instanceof JMenuItem) {
return false; // should be handled by SelectionMenuEvent
}
if (accessibleObj instanceof JTextComponent) {
return false; // should be handled by EditableTextEvent
}
if (accessibleObj instanceof BasicArrowButton) {
return false; // should be handled by ValueEvnet
}
if (accessibleObj instanceof JComboBox) {
return false; // should be handled by SelectionEvent
}
if (accessibleObj instanceof JSpinner) {
return false; // should be handled by SelectionEvent
}
return true;
}
示例2: findTargetBtnComponent
import javax.accessibility.AccessibleAction; //导入方法依赖的package包/类
private ComponentModel findTargetBtnComponent(GUIModel root) {
for (Enumeration<GUIModel> enumuration = (Enumeration<GUIModel>) root.depthFirstEnumeration(); enumuration
.hasMoreElements();) {
GUIModel node = enumuration.nextElement();
Object userObj = node.getUserObject();
if (userObj instanceof ComponentModel) {
ComponentModel model = (ComponentModel) userObj;
AccessibleAction aAction = JFCUtil.getAccessibleContext(model).getAccessibleAction();
Accessible accessibleObj = (Accessible) model.getRef();
if (aAction == null)
continue;
if (aAction.getAccessibleActionCount() == 0)
continue;
if (accessibleObj instanceof JMenuItem) {
continue; // should be handled by SelectionMenuEvent
}
if (accessibleObj instanceof JTextComponent) {
continue; // should be handled by EditableTextEvent
}
if (accessibleObj instanceof BasicArrowButton) {
continue; // should be handled by ValueEvnet
}
if (accessibleObj instanceof JComboBox) {
continue; // should be handled by SelectionEvent
}
if (accessibleObj instanceof JSpinner) {
continue; // should be handled by SelectionEvent
}
String title = model.get("title");
if (title.equalsIgnoreCase(targetBtnName)) {
return model;
}
}
}
return null;
}