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


Java AccessibleRole类代码示例

本文整理汇总了Java中javax.accessibility.AccessibleRole的典型用法代码示例。如果您正苦于以下问题:Java AccessibleRole类的具体用法?Java AccessibleRole怎么用?Java AccessibleRole使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AccessibleRole类属于javax.accessibility包,在下文中一共展示了AccessibleRole类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public AccessibleContext getAccessibleContext() {

    if( null == accessibleContext ) {
        accessibleContext = new AccessibleJComponent() {
            @Override
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.SWING_COMPONENT;
            }
        };
    
        accessibleContext.setAccessibleName( NbBundle.getMessage(DescriptionComponent.class, "ACS_Description") );
        accessibleContext.setAccessibleDescription( NbBundle.getMessage(DescriptionComponent.class, "ACSD_Description") );
    }
    
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:DescriptionComponent.java

示例2: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public javax.accessibility.AccessibleContext getAccessibleContext() {
    if( null == accessibleContext ) {
        accessibleContext = new AccessibleJComponent() {
                    @Override
                    public AccessibleRole getAccessibleRole() {
                        return AccessibleRole.PAGE_TAB_LIST;
                    }
                };
    
        accessibleContext.setAccessibleName( NbBundle.getMessage(TabbedContainer.class, "ACS_TabbedContainer") );
        accessibleContext.setAccessibleDescription( NbBundle.getMessage(TabbedContainer.class, "ACSD_TabbedContainer") );
    }
    
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:TabbedContainer.java

示例3: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new JComponent.AccessibleJComponent() {
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }

            public String getAccessibleName() {
                return Bundle.ProfilerWindow_accessName(getDisplayName());
            }

            public String getAccessibleDescription() {
                ProfilerFeature selected = featuresView == null ? null :
                                featuresView.getSelectedFeature();
                return selected == null ? WelcomePanel.CAPTION :
                       (selected.getName() + " " + selected.getDescription()); // NOI18N
            }
        };
    }
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ProfilerWindow.java

示例4: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new JComponent.AccessibleJComponent() {
                    public AccessibleRole getAccessibleRole() {
                        return AccessibleRole.PANEL;
                    }

                    public String getAccessibleName() {
                        if (accessibleName != null) {
                            return accessibleName;
                        }

                        return getName();
                    }

                    /* Fix for 19344: Null accessible decription of all TopComponents on JDK1.4 */
                    public String getToolTipText() {
                        return TopComponent.this.getToolTipText();
                    }
                };
    }

    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:TopComponent.java

示例5: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new AccessibleJComponent() {
                    @Override
                    public AccessibleRole getAccessibleRole() {
                        // is it really a panel?
                        return AccessibleRole.PANEL;
                    }

                    @Override
                    public String getAccessibleName() {
                        if (accessibleName != null) {
                            return accessibleName;
                        }
                        return getName();
                    }
                };
    }

    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:AbstractOutputTab.java

示例6: getComponentRole

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public static String getComponentRole(Accessible component) {
  if (component == null)
    return "null";

  AccessibleContext aContext = component.getAccessibleContext();
  if (aContext == null) {
    return "null(noAccessibleContext)";
  }

  AccessibleRole aRole = aContext.getAccessibleRole();

  if (aRole == null) {
    return "null(noAccessibleRole)";
  }
  return aRole.toDisplayString(Locale.ENGLISH);
}
 
开发者ID:gigony,项目名称:GUITester-core,代码行数:17,代码来源:JFCUtil.java

示例7: testGetAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public void testGetAccessibleContext() {
    AccessibleContext c = frame.getAccessibleContext();
    assertTrue("class is ok", c instanceof JFrame.AccessibleJFrame);
    assertTrue("AccessibleRole is ok", c.getAccessibleRole() == AccessibleRole.FRAME);
    assertNull("AccessibleDescription is ok", c.getAccessibleDescription());
    assertTrue("AccessibleChildrenCount == 1", c.getAccessibleChildrenCount() == 1);
    // test getAccessibleName()
    assertTrue("AccessibleName is ok", c.getAccessibleName() == "");
    frame.setTitle("aa");
    assertTrue("AccessibleName is ok", c.getAccessibleName() == "aa");
    // test getAccessibleStateSet()
    AccessibleState[] states = c.getAccessibleStateSet().toArray();
    assertTrue("more than 2 states", states.length > 2);
    frame.setVisible(true);
    states = c.getAccessibleStateSet().toArray();
    assertTrue("more than 4 states", states.length > 4);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:JFrameTest.java

示例8: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new AccessibleJComponent() {
            public @Override AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }
        };
        accessibleContext.setAccessibleName(NbBundle.getMessage(CodeFoldingSideBar.class, "ACSN_CodeFoldingSideBar")); //NOI18N
    accessibleContext.setAccessibleDescription(NbBundle.getMessage(CodeFoldingSideBar.class, "ACSD_CodeFoldingSideBar")); //NOI18N
    }
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CodeFoldingSideBar.java

示例9: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new AccessibleJComponent() {
            @Override
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }
        };
        accessibleContext.setAccessibleName(NbBundle.getMessage(AnnotationView.class, "ACSN_AnnotationView")); //NOI18N
        accessibleContext.setAccessibleDescription(NbBundle.getMessage(AnnotationView.class, "ACSD_AnnotationView")); //NOI18N
    }
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:AnnotationView.java

示例10: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
@Override
public AccessibleContext getAccessibleContext() {
    if( null == accessibleContext ) {
        accessibleContext = new AccessibleAWTComponent() {
            @Override
                    public AccessibleRole getAccessibleRole() {
                        return AccessibleRole.SPLIT_PANE;
                    }
                };

        accessibleContext.setAccessibleName( NbBundle.getMessage(DescriptionComponent.class, "ACS_Splitter") );
        accessibleContext.setAccessibleDescription( NbBundle.getMessage(DescriptionComponent.class, "ACSD_Splitter") );
    }
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:PropUtils.java

示例11: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
/** Read accessible context
 * @return - accessible context
 */
@Override
public AccessibleContext getAccessibleContext () {
    if(toolbarAccessibleContext == null) {
        toolbarAccessibleContext = new AccessibleJComponent() {
            @Override
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.TOOL_BAR;
            }
        };
    }
    return toolbarAccessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:ToolbarPool.java

示例12: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public @Override AccessibleContext getAccessibleContext () {
    if (accessibleContext == null) {
        accessibleContext = new AccessibleJComponent() {
            public @Override AccessibleRole getAccessibleRole() {
                return AccessibleRole.PANEL;
            }
        };
    }
    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:LinesComponent.java

示例13: createAccesibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
protected AccessibleContext createAccesibleContext() {
    return new JComponent.AccessibleJComponent() {
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.LABEL;
        }
        public String getAccessibleName() {
            return BaseRenderer.this.toString();
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:BaseRenderer.java

示例14: getAccessibleContext

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public @Override AccessibleContext getAccessibleContext() {
    if (accessibleContext == null) {
        accessibleContext = new AccessibleJComponent() {
                    public @Override AccessibleRole getAccessibleRole() {
                        return AccessibleRole.SPLIT_PANE;
                    }
                };
        initAccessible();
    }

    return accessibleContext;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SplittedPanel.java

示例15: main

import javax.accessibility.AccessibleRole; //导入依赖的package包/类
public static void main(String... args) throws Exception {
    JLayer l = new JLayer();
    AccessibleContext acc = l.getAccessibleContext();
    if (acc == null) {
        throw new RuntimeException("JLayer's AccessibleContext is null");
    }
    if (acc.getAccessibleRole() != AccessibleRole.PANEL) {
        throw new RuntimeException("JLayer's AccessibleRole must be PANEL");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:bug6986385.java


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