当前位置: 首页>>代码示例>>Java>>正文


Java AccessibleAction.getAccessibleActionCount方法代码示例

本文整理汇总了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;

}
 
开发者ID:gigony,项目名称:GUITester-core,代码行数:37,代码来源:ActionableEvent_JFC.java

示例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;
  }
 
开发者ID:gigony,项目名称:GUITester-core,代码行数:41,代码来源:FileChooserDialogEvent_JFC.java


注:本文中的javax.accessibility.AccessibleAction.getAccessibleActionCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。