KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > codegen > ecore > templates > model > BuildProperties


1 package org.eclipse.emf.codegen.ecore.templates.model;
2
3 import org.eclipse.emf.codegen.ecore.genmodel.*;
4
5 public class BuildProperties
6 {
7   protected static String JavaDoc nl;
8   public static synchronized BuildProperties create(String JavaDoc lineSeparator)
9   {
10     nl = lineSeparator;
11     BuildProperties result = new BuildProperties();
12     nl = null;
13     return result;
14   }
15
16   protected final String JavaDoc NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17   protected final String JavaDoc TEXT_1 = "";
18   protected final String JavaDoc TEXT_2 = "# <copyright>" + NL + "# </copyright>" + NL + "#" + NL + "# ";
19   protected final String JavaDoc TEXT_3 = "Id";
20   protected final String JavaDoc TEXT_4 = NL + NL + "bin.includes = ";
21   protected final String JavaDoc TEXT_5 = ",\\" + NL + " model/,\\";
22   protected final String JavaDoc TEXT_6 = NL + " icons/,\\";
23   protected final String JavaDoc TEXT_7 = NL + " META-INF/,\\";
24   protected final String JavaDoc TEXT_8 = NL + " plugin.xml,\\" + NL + " plugin.properties" + NL + "jars.compile.order = ";
25   protected final String JavaDoc TEXT_9 = NL + "source.";
26   protected final String JavaDoc TEXT_10 = " = src/" + NL + "output.";
27   protected final String JavaDoc TEXT_11 = " = bin/";
28
29   public String JavaDoc generate(Object JavaDoc argument)
30   {
31     StringBuffer JavaDoc stringBuffer = new StringBuffer JavaDoc();
32     
33 /**
34  * <copyright>
35  *
36  * Copyright (c) 2002-2005 IBM Corporation and others.
37  * All rights reserved. This program and the accompanying materials
38  * are made available under the terms of the Eclipse Public License v1.0
39  * which accompanies this distribution, and is available at
40  * http://www.eclipse.org/legal/epl-v10.html
41  *
42  * Contributors:
43  * IBM - Initial API and implementation
44  *
45  * </copyright>
46  */

47
48     GenModel genModel = (GenModel)argument;
49     String JavaDoc pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getModelPluginID()+".jar" : ".";
50     stringBuffer.append(TEXT_1);
51     stringBuffer.append(TEXT_2);
52     stringBuffer.append("$");
53     stringBuffer.append(TEXT_3);
54     stringBuffer.append("$");
55     stringBuffer.append(TEXT_4);
56     stringBuffer.append(pluginClassesLocation);
57     stringBuffer.append(TEXT_5);
58     if (genModel.sameModelEditProject() || genModel.sameModelEditorProject()) {
59     stringBuffer.append(TEXT_6);
60     }
61     if (genModel.isBundleManifest()) {
62     stringBuffer.append(TEXT_7);
63     }
64     stringBuffer.append(TEXT_8);
65     stringBuffer.append(pluginClassesLocation);
66     stringBuffer.append(TEXT_9);
67     stringBuffer.append(pluginClassesLocation);
68     stringBuffer.append(TEXT_10);
69     stringBuffer.append(pluginClassesLocation);
70     stringBuffer.append(TEXT_11);
71     return stringBuffer.toString();
72   }
73 }
74
Popular Tags