當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。