Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
7   56   4   1.75
0   26   0.57   4
4     1  
1    
 
  JTreeChildrenShowUpCondition       Line # 32 7 0% 4 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Aug 23, 2008
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2008-2010 the original author or authors.
15    */
16    package org.fest.swing.driver;
17   
18    import static org.fest.swing.driver.JTreeChildOfPathCountQuery.childCount;
19    import static org.fest.util.Strings.concat;
20   
21    import javax.swing.JTree;
22    import javax.swing.tree.TreePath;
23   
24    import org.fest.swing.annotation.RunsInEDT;
25    import org.fest.swing.timing.Condition;
26   
27    /**
28    * Understands a condition that verifies that the children of a node in a <code>{@link JTree}</code> are displayed.
29    *
30    * @author Alex Ruiz
31    */
 
32    class JTreeChildrenShowUpCondition extends Condition {
33   
34    private JTree tree;
35    private TreePath path;
36   
 
37  56 toggle static JTreeChildrenShowUpCondition untilChildrenShowUp(JTree tree, TreePath path) {
38  56 return new JTreeChildrenShowUpCondition(tree, path);
39    }
40   
 
41  56 toggle private JTreeChildrenShowUpCondition(JTree tree, TreePath path) {
42  56 super(concat(path.toString(), " to show"));
43  56 this.tree = tree;
44  56 this.path = path;
45    }
46   
 
47  56 toggle @RunsInEDT
48    public boolean test() {
49  56 return childCount(tree, path) != 0;
50    }
51   
 
52  56 toggle @Override protected void done() {
53  56 tree = null;
54  56 path = null;
55    }
56    }