PageRenderTime 73ms CodeModel.GetById 20ms app.highlight 18ms RepoModel.GetById 32ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/net/sourceforge/jarbundler/AppBundleProperties.java

#
Java | 337 lines | 195 code | 85 blank | 57 comment | 5 complexity | 628b6367cdc83cc59724ffe3986f8c0e MD5 | raw file
  1/*
  2 * A Mac OS X Jar Bundler Ant Task.
  3 *
  4 * Copyright (c) 2003, Seth J. Morabito <sethm@loomcom.com> All rights reserved.
  5 *
  6 * This program is free software; you can redistribute it and/or modify it
  7 * under the terms of the GNU General Public License as published by the Free
  8 * Software Foundation; either version 2 of the License, or (at your option)
  9 * any later version.
 10 *
 11 * This program is distributed in the hope that it will be useful, but WITHOUT
 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13 * FITNESS FOR A PARTICULAR PURPOSE.  See  the GNU General Public License for
 14 * more details.
 15 *
 16 * You should have received a copy of the GNU General Public License along with
 17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 18 * Place - Suite 330, Boston, MA  02111-1307, USA.
 19 */
 20
 21
 22package net.sourceforge.jarbundler;
 23
 24// Java Utility
 25import java.util.ArrayList;
 26import java.util.Hashtable;
 27import java.util.List;
 28import java.util.LinkedList;
 29
 30// Java language imports
 31import java.lang.String;
 32
 33public class AppBundleProperties {
 34
 35	// Required
 36	private String mApplicationName;
 37	private String mMainClass;
 38
 39	// Application short name
 40	private String mCFBundleName = null;
 41
 42	// Finder version, with default
 43	private String mCFBundleShortVersionString = "1.0";
 44
 45	// Get Info string, optional
 46	private String mCFBundleGetInfoString = null;
 47
 48	// Build number, optional
 49	private String mCFBundleVersion = null;
 50
 51	// Help Book folder, optional
 52	private String mCFHelpBookFolder = null;
 53
 54	// Help Book name, optional
 55	private String mCFHelpBookName = null;
 56
 57	// Explicit default: false
 58	private boolean mCFBundleAllowMixedLocalizations = false;
 59
 60	// Explicit default: JavaApplicationStub
 61	private String mCFBundleExecutable = "JavaApplicationStub";
 62
 63	// Explicit default: English
 64	private String mCFBundleDevelopmentRegion = "English";
 65
 66	// Explicit default: APPL
 67	private final String mCFBundlePackageType = "APPL";
 68
 69	// Explicit default: ????
 70	private String mCFBundleSignature = "????";
 71
 72	// Explicit default: 1.3+
 73	private String mJVMVersion = "1.3+";
 74
 75	// Explicit default: 6.0
 76	private final String mCFBundleInfoDictionaryVersion = "6.0";
 77
 78	// Optional keys, with no defaults.
 79
 80	private String mCFBundleIconFile = null;
 81	private String mCFBundleIdentifier = null;
 82	private String mVMOptions = null; // Java VM options
 83	private String mWorkingDirectory = null; // Java Working Dir
 84	private String mArguments = null; // Java command line arguments
 85
 86	// Class path and extra class path elements
 87	private List mClassPath = new ArrayList();
 88	private List mExtraClassPath = new ArrayList();
 89
 90	// Java properties
 91	private Hashtable mJavaProperties = new Hashtable();
 92
 93	// Document types
 94	private List mDocumentTypes = new LinkedList();
 95
 96	// Services
 97	private List mServices = new LinkedList();
 98	
 99	// ================================================================================
100
101	/**
102	 * Add a Java runtime property to the properties hashtable.
103	 */
104
105	public void addJavaProperty(String prop, String val) {
106		mJavaProperties.put(prop, val);
107	}
108
109	public Hashtable getJavaProperties() {
110		return mJavaProperties;
111	}
112
113	public void addToClassPath(String s) {
114		mClassPath.add("$JAVAROOT/" + s);
115	}
116
117	public void addToExtraClassPath(String s) {
118		mExtraClassPath.add(s);
119	}
120
121	public List getExtraClassPath() {
122		return mExtraClassPath;
123	}
124
125	public DocumentType createDocumentType() {
126		return new DocumentType();
127	}
128
129	public List getDocumentTypes() {
130		return mDocumentTypes;
131	}
132
133	/**
134	 * Add a document type to the document type list.
135	 */
136	public void addDocumentType(DocumentType documentType) {
137		mDocumentTypes.add(documentType);
138	}
139
140	public Service createService() {
141		return new Service();
142	}
143	
144	public List getServices() {
145		return mServices;
146	}
147	
148	/**
149	 * Add a service to the services list.
150	 */
151	public void addService(Service service) {
152		mServices.add(service);
153	}
154	
155	// ================================================================================
156
157	public void setApplicationName(String s) {
158		mApplicationName = s;
159	}
160
161	public String getApplicationName() {
162		return mApplicationName;
163	}
164
165	// ================================================================================
166	//
167	// Bundle setters and getters
168	//
169
170	public void setCFBundleName(String s) {
171
172		if (s.length() > 16)
173			System.err
174					.println("WARNING: 'shortname' is recommeded to be no more than 16 "
175							+ "charaters long. See usage notes.");
176		mCFBundleName = s;
177	}
178
179	public String getCFBundleName() {
180		if (mCFBundleName == null)
181			return getApplicationName();
182
183		return mCFBundleName;
184	}
185
186	public void setCFBundleVersion(String s) {
187		mCFBundleVersion = s;
188	}
189
190	public String getCFBundleVersion() {
191		return mCFBundleVersion;
192	}
193
194	public void setCFBundleInfoDictionaryVersion(String s) {
195		// mCFBundleInfoDictionaryVersion = s;
196	}
197
198	public String getCFBundleInfoDictionaryVersion() {
199		return mCFBundleInfoDictionaryVersion;
200	}
201
202	public void setCFBundleIdentifier(String s) {
203		mCFBundleIdentifier = s;
204	}
205
206	public String getCFBundleIdentifier() {
207		return mCFBundleIdentifier;
208	}
209
210	public void setCFBundleGetInfoString(String s) {
211		mCFBundleGetInfoString = s;
212	}
213
214	public String getCFBundleGetInfoString() {
215		if (mCFBundleGetInfoString == null)
216			return getCFBundleShortVersionString();
217
218		return mCFBundleGetInfoString;
219	}
220
221	public void setCFBundleShortVersionString(String s) {
222		mCFBundleShortVersionString = s;
223	}
224
225	public String getCFBundleShortVersionString() {
226		return mCFBundleShortVersionString;
227	}
228
229	public void setCFBundleIconFile(String s) {
230		mCFBundleIconFile = s;
231	}
232
233	public String getCFBundleIconFile() {
234		return mCFBundleIconFile;
235	}
236
237	public void setCFBundleAllowMixedLocalizations(boolean b) {
238		mCFBundleAllowMixedLocalizations = b;
239	}
240
241	public boolean getCFBundleAllowMixedLocalizations() {
242		return mCFBundleAllowMixedLocalizations;
243	}
244
245	public void setCFBundleExecutable(String s) {
246		mCFBundleExecutable = s;
247	}
248
249	public String getCFBundleExecutable() {
250		return mCFBundleExecutable;
251	}
252
253	public void setCFBundleDevelopmentRegion(String s) {
254		mCFBundleDevelopmentRegion = s;
255	}
256
257	public String getCFBundleDevelopmentRegion() {
258		return mCFBundleDevelopmentRegion;
259	}
260
261	public void setCFBundlePackageType(String s) {
262		// mCFBundlePackageType = s;
263	}
264
265	public String getCFBundlePackageType() {
266		return mCFBundlePackageType;
267	}
268
269	public void setCFBundleSignature(String s) {
270		mCFBundleSignature = s;
271	}
272
273	public String getCFBundleSignature() {
274		return mCFBundleSignature;
275	}
276
277	public void setCFBundleHelpBookFolder(String s) {
278		mCFHelpBookFolder = s;
279	}
280
281	public String getCFBundleHelpBookFolder() {
282		return mCFHelpBookFolder;
283	}
284
285	public void setCFBundleHelpBookName(String s) {
286		mCFHelpBookName = s;
287	}
288
289	public String getCFBundleHelpBookName() {
290		return mCFHelpBookName;
291	}
292
293	public void setMainClass(String s) {
294		mMainClass = s;
295	}
296
297	public String getMainClass() {
298		return mMainClass;
299	}
300
301	public void setJVMVersion(String s) {
302		mJVMVersion = s;
303	}
304
305	public String getJVMVersion() {
306		return mJVMVersion;
307	}
308
309	public void setVMOptions(String s) {
310		mVMOptions = s;
311	}
312
313	public String getVMOptions() {
314		return mVMOptions;
315	}
316
317	public void setWorkingDirectory(String s) {
318		mWorkingDirectory = s;
319	}
320
321	public String getWorkingDirectory() {
322		return mWorkingDirectory;
323	}
324
325	public void setArguments(String s) {
326		mArguments = s;
327	}
328
329	public String getArguments() {
330		return mArguments;
331	}
332
333	public List getClassPath() {
334		return mClassPath;
335	}
336
337}