Package javax.accessibility

Examples of javax.accessibility.AccessibleSelection


        as.addAccessibleSelection(1);
        assertEquals(2, list.getSelectedItems().length);
    }

    public final void testRemoveAccessibleSelection() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertEquals(0, list.getSelectedItems().length);
        as.removeAccessibleSelection(0);
        as.removeAccessibleSelection(1);
        assertEquals(0, list.getSelectedItems().length);
        list.select(0);
        assertEquals(1, list.getSelectedItems().length);
        as.removeAccessibleSelection(1);
        assertEquals(1, list.getSelectedItems().length);
        as.removeAccessibleSelection(0);
        assertEquals(0, list.getSelectedItems().length);
    }
View Full Code Here


        as.removeAccessibleSelection(0);
        assertEquals(0, list.getSelectedItems().length);
    }

    public final void testIsAccessibleChildSelected() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertFalse(as.isAccessibleChildSelected(0));
        assertFalse(as.isAccessibleChildSelected(1));
        list.select(1);
        assertFalse(as.isAccessibleChildSelected(0));
        assertTrue(as.isAccessibleChildSelected(1));
        list.select(0);
        assertFalse(as.isAccessibleChildSelected(1));
        assertTrue(as.isAccessibleChildSelected(0));
    }
View Full Code Here

    /*
     * Class under test for javax.accessibility.Accessible getAccessibleSelection(int)
     */
    public final void testGetAccessibleSelectionint() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertNull(as.getAccessibleSelection(-1));
        assertNull(as.getAccessibleSelection(0));
        assertNull(as.getAccessibleSelection(1));
        list.select(1);
        assertNull(as.getAccessibleSelection(-1));
        assertTrue(as.getAccessibleSelection(0)
                   instanceof AccessibleAWTList.AccessibleAWTListChild);
        assertNull(as.getAccessibleSelection(1));
    }
View Full Code Here

    public final void testClearAccessibleSelection() {
        list.add("item1");
        list.add("item2");
        list.setMultipleMode(true);
        AccessibleSelection as = ac.getAccessibleSelection();
        list.select(0);
        list.select(1);
        assertEquals(2, list.getSelectedItems().length);
        as.clearAccessibleSelection();
        assertEquals(0, list.getSelectedItems().length);
        assertEquals(0, as.getAccessibleSelectionCount());

    }
View Full Code Here

        assertEquals(0, as.getAccessibleSelectionCount());

    }

    public final void testSelectAllAccessibleSelection() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertEquals(0, list.getSelectedItems().length);
        as.selectAllAccessibleSelection();
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        as.selectAllAccessibleSelection();
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        list.setMultipleMode(true);
        as.selectAllAccessibleSelection();
        assertEquals(2, list.getSelectedItems().length);


    }
View Full Code Here


    }

    public final void testAddAccessibleSelection() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertEquals(0, list.getSelectedItems().length);
        as.addAccessibleSelection(1);
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item2", list.getSelectedItem());
        as.addAccessibleSelection(0);
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        list.setMultipleMode(true);
        as.addAccessibleSelection(1);
        assertEquals(2, list.getSelectedItems().length);
    }
View Full Code Here

    }

    public final void testGetAccessibleSelectionCount() {
        list.add("item1");
        list.add("item2");
        AccessibleSelection as = ac.getAccessibleSelection();
        assertEquals(0, as.getAccessibleSelectionCount());
        list.select(0);
        assertEquals(1, as.getAccessibleSelectionCount());
        list.select(1);
        assertEquals(1, as.getAccessibleSelectionCount());
        list.setMultipleMode(true);
        list.select(0);
        assertEquals(2, as.getAccessibleSelectionCount());
    }
View Full Code Here

    public final void testClearAccessibleSelection() {
        list.add("item1");
        list.add("item2");
        list.setMultipleMode(true);
        AccessibleSelection as = ac.getAccessibleSelection();
        list.select(0);
        list.select(1);
        assertEquals(2, list.getSelectedItems().length);
        as.clearAccessibleSelection();
        assertEquals(0, list.getSelectedItems().length);
        assertEquals(0, as.getAccessibleSelectionCount());

    }
View Full Code Here

        assertEquals(0, as.getAccessibleSelectionCount());

    }

    public final void testSelectAllAccessibleSelection() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertEquals(0, list.getSelectedItems().length);
        as.selectAllAccessibleSelection();
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        as.selectAllAccessibleSelection();
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        list.setMultipleMode(true);
        as.selectAllAccessibleSelection();
        assertEquals(2, list.getSelectedItems().length);


    }
View Full Code Here


    }

    public final void testAddAccessibleSelection() {
        AccessibleSelection as = ac.getAccessibleSelection();
        list.add("item1");
        list.add("item2");
        assertEquals(0, list.getSelectedItems().length);
        as.addAccessibleSelection(1);
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item2", list.getSelectedItem());
        as.addAccessibleSelection(0);
        assertEquals(1, list.getSelectedItems().length);
        assertEquals("item1", list.getSelectedItem());
        list.setMultipleMode(true);
        as.addAccessibleSelection(1);
        assertEquals(2, list.getSelectedItems().length);
    }
View Full Code Here

TOP

Related Classes of javax.accessibility.AccessibleSelection

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.