01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.midp.automation;
28:
29: import com.sun.midp.midletsuite.*;
30: import java.util.*;
31:
32: /**
33: * AutoSuiteDescriptor implementation for external suite
34: */
35: class AutoExternalSuiteDescriptorImpl extends AutoSuiteDescriptorImpl {
36:
37: /** suite ID */
38: private int suiteID;
39:
40: /**
41: * Constructor
42: *
43: * @param suiteID suite ID
44: * @param midletSuite internal MIDlet suite representation
45: */
46: AutoExternalSuiteDescriptorImpl(int suiteID,
47: MIDletSuiteImpl midletSuite) {
48: super (midletSuite);
49:
50: this .suiteID = suiteID;
51: if (suiteName == null) {
52: suiteName = String.valueOf(suiteID);
53: }
54: }
55:
56: /**
57: * Tests if this suite is external
58: *
59: * @return true, if this suite is external
60: */
61: boolean isExternalSuite() {
62: return true;
63: }
64:
65: /**
66: * Gets suite ID
67: *
68: * @return suite ID as String
69: */
70: int getSuiteID() {
71: return suiteID;
72: }
73:
74: /**
75: * Updates list of suite's MIDlets
76: */
77: void updateMIDletsList() {
78: suiteMIDlets = new Vector(totalMIDlets);
79:
80: for (int i = 1; i <= totalMIDlets; i++) {
81: AutoMIDletDescriptorImpl midlet = null;
82: String midletAttr = midletSuite.getProperty("MIDlet-" + i);
83: midlet = new AutoMIDletDescriptorImpl(this, midletAttr);
84:
85: suiteMIDlets.addElement(midlet);
86: }
87: }
88: }
|