本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
};
}
示例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;
}
示例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");
}
}