Java Code Examples for java.awt.Component#getAccessibleContext()

The following examples show how to use java.awt.Component#getAccessibleContext() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jdk1.8-source-analysis   File: JMenu.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 2
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 3
Source Project: jdk8u-jdk   File: JMenu.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 4
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 5
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 6
Source Project: jdk8u60   File: JMenu.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 7
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 8
Source Project: Java8CN   File: JMenu.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 9
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 10
Source Project: hottub   File: JMenu.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the nth Accessible child of the object.
 *
 * @param i zero-based index of child
 * @return the nth Accessible child of the object
 */
public Accessible getAccessibleChild(int i) {
    Component[] children = getMenuComponents();
    int count = 0;
    for (Component child : children) {
        if (child instanceof Accessible) {
            if (count == i) {
                if (child instanceof JComponent) {
                    // FIXME:  [[[WDW - probably should set this when
                    // the component is added to the menu.  I tried
                    // to do this in most cases, but the separators
                    // added by addSeparator are hard to get to.]]]
                    AccessibleContext ac = child.getAccessibleContext();
                    ac.setAccessibleParent(JMenu.this);
                }
                return (Accessible) child;
            } else {
                count++;
            }
        }
    }
    return null;
}
 
Example 11
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 12
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 13
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 14
Source Project: JDKSourceCode1.8   File: ProgressMonitor.java    License: MIT License 5 votes vote down vote up
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 15
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 16
Source Project: Bytecoder   File: ProgressMonitor.java    License: Apache License 2.0 5 votes vote down vote up
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 17
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 18
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 19
Source Project: Java8CN   File: ProgressMonitor.java    License: Apache License 2.0 5 votes vote down vote up
private AccessibleContext getPanelAccessibleContext() {
    if (myBar != null) {
        Component c = myBar.getParent();
        if (c instanceof Accessible) {
            return c.getAccessibleContext();
        }
    }
    return null;
}
 
Example 20
Source Project: Bytecoder   File: JTabbedPane.java    License: Apache License 2.0 4 votes vote down vote up
private void clearAccessibleParent(Component c) {
    AccessibleContext ac = c.getAccessibleContext();
    if (ac != null) {
        ac.setAccessibleParent(null);
    }
}