PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. package net.sourceforge.jarbundler;
  21. // Java Utility
  22. import java.util.ArrayList;
  23. import java.util.Hashtable;
  24. import java.util.List;
  25. import java.util.LinkedList;
  26. // Java language imports
  27. import java.lang.String;
  28. public class AppBundleProperties {
  29. // Required
  30. private String mApplicationName;
  31. private String mMainClass;
  32. // Application short name
  33. private String mCFBundleName = null;
  34. // Finder version, with default
  35. private String mCFBundleShortVersionString = "1.0";
  36. // Get Info string, optional
  37. private String mCFBundleGetInfoString = null;
  38. // Build number, optional
  39. private String mCFBundleVersion = null;
  40. // Help Book folder, optional
  41. private String mCFHelpBookFolder = null;
  42. // Help Book name, optional
  43. private String mCFHelpBookName = null;
  44. // Explicit default: false
  45. private boolean mCFBundleAllowMixedLocalizations = false;
  46. // Explicit default: JavaApplicationStub
  47. private String mCFBundleExecutable = "JavaApplicationStub";
  48. // Explicit default: English
  49. private String mCFBundleDevelopmentRegion = "English";
  50. // Explicit default: APPL
  51. private final String mCFBundlePackageType = "APPL";
  52. // Explicit default: ????
  53. private String mCFBundleSignature = "????";
  54. // Explicit default: 1.3+
  55. private String mJVMVersion = "1.3+";
  56. // Explicit default: 6.0
  57. private final String mCFBundleInfoDictionaryVersion = "6.0";
  58. // Optional keys, with no defaults.
  59. private String mCFBundleIconFile = null;
  60. private String mCFBundleIdentifier = null;
  61. private String mVMOptions = null; // Java VM options
  62. private String mWorkingDirectory = null; // Java Working Dir
  63. private String mArguments = null; // Java command line arguments
  64. // Class path and extra class path elements
  65. private List mClassPath = new ArrayList();
  66. private List mExtraClassPath = new ArrayList();
  67. // Java properties
  68. private Hashtable mJavaProperties = new Hashtable();
  69. // Document types
  70. private List mDocumentTypes = new LinkedList();
  71. // Services
  72. private List mServices = new LinkedList();
  73. // ================================================================================
  74. /**
  75. * Add a Java runtime property to the properties hashtable.
  76. */
  77. public void addJavaProperty(String prop, String val) {
  78. mJavaProperties.put(prop, val);
  79. }
  80. public Hashtable getJavaProperties() {
  81. return mJavaProperties;
  82. }
  83. public void addToClassPath(String s) {
  84. mClassPath.add("$JAVAROOT/" + s);
  85. }
  86. public void addToExtraClassPath(String s) {
  87. mExtraClassPath.add(s);
  88. }
  89. public List getExtraClassPath() {
  90. return mExtraClassPath;
  91. }
  92. public DocumentType createDocumentType() {
  93. return new DocumentType();
  94. }
  95. public List getDocumentTypes() {
  96. return mDocumentTypes;
  97. }
  98. /**
  99. * Add a document type to the document type list.
  100. */
  101. public void addDocumentType(DocumentType documentType) {
  102. mDocumentTypes.add(documentType);
  103. }
  104. public Service createService() {
  105. return new Service();
  106. }
  107. public List getServices() {
  108. return mServices;
  109. }
  110. /**
  111. * Add a service to the services list.
  112. */
  113. public void addService(Service service) {
  114. mServices.add(service);
  115. }
  116. // ================================================================================
  117. public void setApplicationName(String s) {
  118. mApplicationName = s;
  119. }
  120. public String getApplicationName() {
  121. return mApplicationName;
  122. }
  123. // ================================================================================
  124. //
  125. // Bundle setters and getters
  126. //
  127. public void setCFBundleName(String s) {
  128. if (s.length() > 16)
  129. System.err
  130. .println("WARNING: 'shortname' is recommeded to be no more than 16 "
  131. + "charaters long. See usage notes.");
  132. mCFBundleName = s;
  133. }
  134. public String getCFBundleName() {
  135. if (mCFBundleName == null)
  136. return getApplicationName();
  137. return mCFBundleName;
  138. }
  139. public void setCFBundleVersion(String s) {
  140. mCFBundleVersion = s;
  141. }
  142. public String getCFBundleVersion() {
  143. return mCFBundleVersion;
  144. }
  145. public void setCFBundleInfoDictionaryVersion(String s) {
  146. // mCFBundleInfoDictionaryVersion = s;
  147. }
  148. public String getCFBundleInfoDictionaryVersion() {
  149. return mCFBundleInfoDictionaryVersion;
  150. }
  151. public void setCFBundleIdentifier(String s) {
  152. mCFBundleIdentifier = s;
  153. }
  154. public String getCFBundleIdentifier() {
  155. return mCFBundleIdentifier;
  156. }
  157. public void setCFBundleGetInfoString(String s) {
  158. mCFBundleGetInfoString = s;
  159. }
  160. public String getCFBundleGetInfoString() {
  161. if (mCFBundleGetInfoString == null)
  162. return getCFBundleShortVersionString();
  163. return mCFBundleGetInfoString;
  164. }
  165. public void setCFBundleShortVersionString(String s) {
  166. mCFBundleShortVersionString = s;
  167. }
  168. public String getCFBundleShortVersionString() {
  169. return mCFBundleShortVersionString;
  170. }
  171. public void setCFBundleIconFile(String s) {
  172. mCFBundleIconFile = s;
  173. }
  174. public String getCFBundleIconFile() {
  175. return mCFBundleIconFile;
  176. }
  177. public void setCFBundleAllowMixedLocalizations(boolean b) {
  178. mCFBundleAllowMixedLocalizations = b;
  179. }
  180. public boolean getCFBundleAllowMixedLocalizations() {
  181. return mCFBundleAllowMixedLocalizations;
  182. }
  183. public void setCFBundleExecutable(String s) {
  184. mCFBundleExecutable = s;
  185. }
  186. public String getCFBundleExecutable() {
  187. return mCFBundleExecutable;
  188. }
  189. public void setCFBundleDevelopmentRegion(String s) {
  190. mCFBundleDevelopmentRegion = s;
  191. }
  192. public String getCFBundleDevelopmentRegion() {
  193. return mCFBundleDevelopmentRegion;
  194. }
  195. public void setCFBundlePackageType(String s) {
  196. // mCFBundlePackageType = s;
  197. }
  198. public String getCFBundlePackageType() {
  199. return mCFBundlePackageType;
  200. }
  201. public void setCFBundleSignature(String s) {
  202. mCFBundleSignature = s;
  203. }
  204. public String getCFBundleSignature() {
  205. return mCFBundleSignature;
  206. }
  207. public void setCFBundleHelpBookFolder(String s) {
  208. mCFHelpBookFolder = s;
  209. }
  210. public String getCFBundleHelpBookFolder() {
  211. return mCFHelpBookFolder;
  212. }
  213. public void setCFBundleHelpBookName(String s) {
  214. mCFHelpBookName = s;
  215. }
  216. public String getCFBundleHelpBookName() {
  217. return mCFHelpBookName;
  218. }
  219. public void setMainClass(String s) {
  220. mMainClass = s;
  221. }
  222. public String getMainClass() {
  223. return mMainClass;
  224. }
  225. public void setJVMVersion(String s) {
  226. mJVMVersion = s;
  227. }
  228. public String getJVMVersion() {
  229. return mJVMVersion;
  230. }
  231. public void setVMOptions(String s) {
  232. mVMOptions = s;
  233. }
  234. public String getVMOptions() {
  235. return mVMOptions;
  236. }
  237. public void setWorkingDirectory(String s) {
  238. mWorkingDirectory = s;
  239. }
  240. public String getWorkingDirectory() {
  241. return mWorkingDirectory;
  242. }
  243. public void setArguments(String s) {
  244. mArguments = s;
  245. }
  246. public String getArguments() {
  247. return mArguments;
  248. }
  249. public List getClassPath() {
  250. return mClassPath;
  251. }
  252. }