Code example for View

Methods: clearFocus, requestFocus

0
        assertTrue(root.hasFocus());
 
        child1.clearFocus();
        assertFalse(root.hasFocus());
 
        child3b.requestFocus();
        assertTrue(root.hasFocus());
 
        child3b.clearFocus();
        assertFalse(root.hasFocus());
 
        root.requestFocus();
        assertTrue(root.hasFocus());
    } 
 
    @Test 
    public void clearFocus_shouldRecursivelyClearTheFocusOfAllChildren() throws Exception { 
        child3a.requestFocus();
 
        root.clearFocus();