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   50   5   2.33
4   23   0.71   3
3     1.67  
1    
 
  WindowChildrenFinder       Line # 33 7 0% 5 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Oct 22, 2007
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 @2007-2010 the original author or authors.
15    */
16    package org.fest.swing.hierarchy;
17   
18    import static java.util.Collections.emptyList;
19    import static org.fest.util.Collections.isEmpty;
20    import static org.fest.util.Collections.list;
21   
22    import java.awt.*;
23    import java.util.*;
24    import java.util.List;
25   
26    import org.fest.swing.annotation.RunsInCurrentThread;
27   
28    /**
29    * Understands how to find children components in a <code>{@link Window}</code>.
30    *
31    * @author Yvonne Wang
32    */
 
33    final class WindowChildrenFinder implements ChildrenFinderStrategy {
34   
 
35  106841 toggle @RunsInCurrentThread
36    public Collection<Component> nonExplicitChildrenOf(Container c) {
37  79312 if (!(c instanceof Window)) return emptyList();
38  27528 return ownedWindows((Window)c);
39    }
40   
 
41  27528 toggle @RunsInCurrentThread
42    private Collection<Component> ownedWindows(Window w) {
43  27528 return windows(list(w.getOwnedWindows()));
44    }
45   
 
46  27530 toggle private Collection<Component> windows(List<Window> windows) {
47  24713 if (isEmpty(windows)) return emptyList();
48  2817 return new ArrayList<Component>(windows);
49    }
50    }