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 com.sun.midp.midlet.MIDletSuite;
31: import java.util.*;
32: import java.io.*;
33:
34: /**
35: * AutoSuiteDescriptor implementation for internal suite
36: */
37: final class AutoInternalSuiteDescriptorImpl extends
38: AutoSuiteDescriptorImpl {
39:
40: /** Name of the suite's MIDlet class */
41: private String midletClassName;
42:
43: /** Suite ID for all internal suites */
44: static final int INTERNAL_SUITE_ID = MIDletSuite.INTERNAL_SUITE_ID;
45:
46: /**
47: * Constructor
48: *
49: * @param midletClassName name of the suite's MIDlet class
50: * @param midletSuite internal MIDlet suite representation
51: */
52: AutoInternalSuiteDescriptorImpl(String midletClassName,
53: MIDletSuiteImpl midletSuite) {
54: super (midletSuite);
55:
56: this .midletClassName = midletClassName;
57:
58: if (suiteName == null) {
59: suiteName = midletClassName;
60: }
61:
62: // no support for internal suites with more than one MIDlet yet
63: if (totalMIDlets > 1) {
64: totalMIDlets = 1;
65: }
66: }
67:
68: /**
69: * Tests if this suite is external
70: *
71: * @return true, if this suite is external
72: */
73: boolean isExternalSuite() {
74: return false;
75: }
76:
77: /**
78: * Gets suite ID
79: *
80: * @return suite ID as String
81: */
82: int getSuiteID() {
83: return INTERNAL_SUITE_ID;
84: }
85:
86: /**
87: * Updates list of suite's MIDlets
88: */
89: void updateMIDletsList() {
90: suiteMIDlets = new Vector(totalMIDlets);
91:
92: AutoMIDletDescriptorImpl midlet = null;
93: midlet = new AutoMIDletDescriptorImpl(this, suiteName,
94: midletClassName);
95: suiteMIDlets.addElement(midlet);
96: }
97: }
|