Java Code Examples for javax.accessibility.AccessibleContext#getAccessibleRole()

The following examples show how to use javax.accessibility.AccessibleContext#getAccessibleRole() . 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: bug6986385.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 2
Source File: bug6986385.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 3
Source File: bug6986385.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 4
Source File: bug6986385.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 5
Source File: bug6986385.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 6
Source File: bug6986385.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 7
Source File: bug6986385.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 8
Source File: bug6986385.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 9
Source File: bug6986385.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 10
Source File: bug6986385.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 11
Source File: bug6986385.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 12
Source File: bug6986385.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 13
Source File: bug6986385.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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");
    }
}
 
Example 14
Source File: CAccessible.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}
 
Example 15
Source File: CAccessible.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}
 
Example 16
Source File: CAccessible.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}
 
Example 17
Source File: CAccessible.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}
 
Example 18
Source File: CAccessible.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}
 
Example 19
Source File: CAccessible.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if ( ptr != 0 ) {
        Object newValue = e.getNewValue();
        Object oldValue = e.getOldValue();
        if (name.compareTo(ACCESSIBLE_CARET_PROPERTY) == 0) {
            selectedTextChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_TEXT_PROPERTY) == 0 ) {
            valueChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_SELECTION_PROPERTY) == 0 ) {
            selectionChanged(ptr);
        } else if (name.compareTo(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY) == 0 ) {
            if (newValue instanceof AccessibleContext) {
                activeDescendant = (AccessibleContext)newValue;
            }
        } else if (name.compareTo(ACCESSIBLE_STATE_PROPERTY) == 0) {
            AccessibleContext thisAC = accessible.getAccessibleContext();
            AccessibleRole thisRole = thisAC.getAccessibleRole();
            Accessible parentAccessible = thisAC.getAccessibleParent();
            AccessibleRole parentRole = null;
            if (parentAccessible != null) {
                parentRole = parentAccessible.getAccessibleContext().getAccessibleRole();
            }
            // At least for now don't handle combo box menu state changes.
            // This may change when later fixing issues which currently
            // exist for combo boxes, but for now the following is only
            // for JPopupMenus, not for combobox menus.
            if (parentRole != AccessibleRole.COMBO_BOX) {
                if (thisRole == AccessibleRole.POPUP_MENU) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
                            menuOpened(ptr);
                    } else if ( oldValue != null &&
                                ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
                        menuClosed(ptr);
                    }
                } else if (thisRole == AccessibleRole.MENU_ITEM) {
                    if ( newValue != null &&
                         ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
                        menuItemSelected(ptr);
                    }
                }
            }
        }
    }
}