Package javax.accessibility

Examples of javax.accessibility.Accessible


        @Override
        public Accessible getAccessibleParent() {
            toolkit.lockAWT();
            try {
                Accessible aParent = super.getAccessibleParent();
                if (aParent != null) {
                    return aParent;
                }
                Container parent = getParent();
                return (parent instanceof Accessible ? (Accessible) parent : null);
View Full Code Here


  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0, ac0ac);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0ac.getAccessibleDescription(), null);
    ac0ac.setAccessibleDescription("AAx");
    harness.check(ac0ac.getAccessibleDescription(), "AAx");
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0ac.getAccessibleChildrenCount(), 0);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0ac.getAccessibleRole(), AccessibleRole.LABEL);
 
    t.getColumnModel().getColumn(1).setHeaderRenderer(new MyTableCellRenderer());
    Accessible ac1 = ac.getAccessibleChild(1);
    harness.check(ac1.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac1ac = ac1.getAccessibleContext();
    harness.check(ac1ac.getAccessibleRole(), AccessibleRole.PUSH_BUTTON);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac0ac = ac0.getAccessibleContext().getAccessibleComponent();
    harness.check(ac0, ac0ac);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac0ac = ac0.getAccessibleContext().getAccessibleComponent();
    JLabel label = new JLabel("Just to get the background");
    harness.check(ac0ac.getBackground(), label.getBackground());
 
    MyTableCellRenderer r = new MyTableCellRenderer();
    r.setBackground(Color.yellow);
    t.getColumnModel().getColumn(1).setHeaderRenderer(r);
    Accessible ac1 = ac.getAccessibleChild(1);
    harness.check(ac1.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac1ac = ac1.getAccessibleContext().getAccessibleComponent();
    harness.check(ac1ac.getBackground(), Color.yellow);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac0ac = ac0.getAccessibleContext().getAccessibleComponent();
    JLabel label = new JLabel("Just to get the foreground");
    harness.check(ac0ac.getForeground(), label.getForeground());
 
    MyTableCellRenderer r = new MyTableCellRenderer();
    r.setForeground(Color.yellow);
    t.getColumnModel().getColumn(1).setHeaderRenderer(r);
    Accessible ac1 = ac.getAccessibleChild(1);
    harness.check(ac1.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac1ac = ac1.getAccessibleContext().getAccessibleComponent();
    harness.check(ac1ac.getForeground(), Color.yellow);
  }
View Full Code Here

  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac0ac = ac0.getAccessibleContext().getAccessibleComponent();
    DefaultTableCellRenderer r0 = new DefaultTableCellRenderer();
    harness.check(ac0ac.getFont(), r0.getFont());
 
    MyTableCellRenderer r = new MyTableCellRenderer();
    r.setFont(new Font("Dialog", Font.BOLD, 15));
    t.getColumnModel().getColumn(1).setHeaderRenderer(r);
    Accessible ac1 = ac.getAccessibleChild(1);
    harness.check(ac1.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleComponent ac1ac = ac1.getAccessibleContext().getAccessibleComponent();
    harness.check(ac1ac.getFont(), new Font("Dialog", Font.BOLD, 15));
  }
View Full Code Here

    table.getColumnModel().getColumn(2).setHeaderRenderer(
            new MyBooleanTableCellRenderer());
    AccessibleContext tableac = table.getAccessibleContext();
    harness.check(tableac.getClass().getName().endsWith("AccessibleJTable"));
    AccessibleTable at = tableac.getAccessibleTable().getAccessibleColumnHeader();
    Accessible accessibleCell0 = at.getAccessibleAt(0, 0);
    harness.check(accessibleCell0.getAccessibleContext().getAccessibleRole(),
            AccessibleRole.LABEL);
    Accessible accessibleCell1 = at.getAccessibleAt(0, 1);
    harness.check(accessibleCell1.getAccessibleContext().getAccessibleRole(),
            AccessibleRole.LABEL);
    Accessible accessibleCell2 = at.getAccessibleAt(0, 2);
    harness.check(accessibleCell2.getAccessibleContext().getAccessibleRole(),
            AccessibleRole.CHECK_BOX);
  }
View Full Code Here

TOP

Related Classes of javax.accessibility.Accessible

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.