01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.views;
05:
06: import com.terracottatech.config.AdditionalBootJarClasses;
07: import com.terracottatech.config.DsoApplication;
08:
09: public class AdditionalBootJarClassesWrapper {
10: private DsoApplication fApp;
11: private BootClassWrapper[] children;
12:
13: AdditionalBootJarClassesWrapper(DsoApplication dsoApp) {
14: fApp = dsoApp;
15: }
16:
17: BootClassWrapper[] createBootClassWrappers() {
18: int count = sizeOfIncludeArray();
19:
20: children = new BootClassWrapper[count];
21: for (int i = 0; i < count; i++) {
22: children[i] = new BootClassWrapper(this , i);
23: }
24:
25: return children;
26: }
27:
28: BootClassWrapper[] getChildren() {
29: return children;
30: }
31:
32: BootClassWrapper getChildAt(int index) {
33: return children != null ? children[index] : null;
34: }
35:
36: int sizeOfIncludeArray() {
37: AdditionalBootJarClasses abjc = fApp
38: .getAdditionalBootJarClasses();
39: return abjc != null ? abjc.sizeOfIncludeArray() : 0;
40: }
41:
42: String getIncludeArray(int i) {
43: AdditionalBootJarClasses abjc = fApp
44: .getAdditionalBootJarClasses();
45: return abjc != null ? abjc.getIncludeArray(i) : null;
46: }
47:
48: void removeInclude(int i) {
49: AdditionalBootJarClasses abjc = fApp
50: .getAdditionalBootJarClasses();
51: if (abjc != null) {
52: abjc.removeInclude(i);
53: }
54: if (sizeOfIncludeArray() == 0) {
55: fApp.unsetAdditionalBootJarClasses();
56: }
57: }
58: }
|