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

The following examples show how to use java.awt.Component#getAccessibleContext() . 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 File: JMenu.java    From jdk8u-dev-jdk with 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 2
Source File: JMenu.java    From hottub with 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 3
Source File: JMenu.java    From openjdk-jdk8u-backup with 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
Source File: JMenu.java    From Java8CN with 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 5
Source File: JMenu.java    From openjdk-jdk8u with 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 6
Source File: JMenu.java    From jdk8u60 with 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
Source File: JMenu.java    From TencentKona-8 with 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 8
Source File: JMenu.java    From openjdk-8-source with 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 9
Source File: JMenu.java    From jdk8u-jdk with 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 10
Source File: JMenu.java    From jdk1.8-source-analysis with 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 11
Source File: ProgressMonitor.java    From TencentKona-8 with GNU General Public License v2.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 12
Source File: ProgressMonitor.java    From jdk8u60 with GNU General Public License v2.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 13
Source File: ProgressMonitor.java    From openjdk-8-source with GNU General Public License v2.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 14
Source File: ProgressMonitor.java    From JDKSourceCode1.8 with 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
Source File: ProgressMonitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.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 16
Source File: ProgressMonitor.java    From Bytecoder with 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
Source File: ProgressMonitor.java    From jdk8u-jdk with GNU General Public License v2.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 18
Source File: ProgressMonitor.java    From openjdk-jdk9 with GNU General Public License v2.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 19
Source File: ProgressMonitor.java    From Java8CN with 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 File: JTabbedPane.java    From Bytecoder with 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);
    }
}