01: package tide.sources;
02:
03: import java.util.*;
04: import javax.swing.tree.*;
05:
06: public final class LibFileUtils {
07: private LibFileUtils() {
08: }
09:
10: /** @return the inner classes, i.e. the ones with name +"$*.class"
11: */
12: public static List<LibFileItem> getInnerClassesSiblings(
13: LibFileItem lfi) {
14: List<LibFileItem> ic = new ArrayList<LibFileItem>();
15: DefaultMutableTreeNode parent = (DefaultMutableTreeNode) lfi
16: .getParent();
17: String javaName$ = lfi.getJavaName() + "$";
18: for (int i = 0; i < parent.getChildCount(); i++) {
19: LibFileItem ci = (LibFileItem) parent.getChildAt(i);
20: if (ci.isClassFile()
21: && ci.getJavaName().startsWith(javaName$)) {
22: ic.add(ci);
23: }
24: }
25: return ic;
26: }
27:
28: }
|