KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > codegen > ecore > templates > editor > PluginProperties


1 package org.eclipse.emf.codegen.ecore.templates.editor;
2
3 import java.util.*;
4 import org.eclipse.emf.codegen.ecore.genmodel.*;
5
6 public class PluginProperties
7 {
8   protected static String JavaDoc nl;
9   public static synchronized PluginProperties create(String JavaDoc lineSeparator)
10   {
11     nl = lineSeparator;
12     PluginProperties result = new PluginProperties();
13     nl = null;
14     return result;
15   }
16
17   protected final String JavaDoc NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18   protected final String JavaDoc TEXT_1 = "";
19   protected final String JavaDoc TEXT_2 = "# <copyright>" + NL + "# </copyright>" + NL + "#" + NL + "# ";
20   protected final String JavaDoc TEXT_3 = "Id";
21   protected final String JavaDoc TEXT_4 = NL + NL + "# ====================================================================" + NL + "# To code developer:" + NL + "# Do NOT change the properties between this line and the" + NL + "# \"%%% END OF TRANSLATED PROPERTIES %%%\" line." + NL + "# Make a new property name, append to the end of the file and change" + NL + "# the code to use the new property." + NL + "# ====================================================================" + NL + "" + NL + "# ====================================================================" + NL + "# %%% END OF TRANSLATED PROPERTIES %%%" + NL + "# ====================================================================" + NL + "" + NL + "pluginName = ";
22   protected final String JavaDoc TEXT_5 = " Editor" + NL + "providerName = www.example.org" + NL;
23   protected final String JavaDoc TEXT_6 = NL + "_UI_";
24   protected final String JavaDoc TEXT_7 = "_menu = &";
25   protected final String JavaDoc TEXT_8 = " Editor";
26   protected final String JavaDoc TEXT_9 = NL;
27   protected final String JavaDoc TEXT_10 = NL + "_UI_CreateChild_menu_item = &New Child" + NL + "_UI_CreateSibling_menu_item = N&ew Sibling" + NL;
28   protected final String JavaDoc TEXT_11 = NL + "_UI_ShowPropertiesView_menu_item = Show &Properties View" + NL + "_UI_RefreshViewer_menu_item = &Refresh" + NL + "" + NL + "_UI_SelectionPage_label = Selection" + NL + "_UI_ParentPage_label = Parent" + NL + "_UI_ListPage_label = List" + NL + "_UI_TreePage_label = Tree" + NL + "_UI_TablePage_label = Table" + NL + "_UI_TreeWithColumnsPage_label = Tree with Columns" + NL + "_UI_ObjectColumn_label = Object" + NL + "_UI_SelfColumn_label = Self" + NL + "" + NL + "_UI_NoObjectSelected = Selected Nothing" + NL + "_UI_SingleObjectSelected = Selected Object: {0}" + NL + "_UI_MultiObjectSelected = Selected {0} Objects" + NL + "" + NL + "_UI_OpenEditorError_label = Open Editor" + NL + "" + NL + "_UI_Wizard_category = Example EMF Model Creation Wizards" + NL;
29   protected final String JavaDoc TEXT_12 = NL + "_UI_";
30   protected final String JavaDoc TEXT_13 = "_label = ";
31   protected final String JavaDoc TEXT_14 = " Model" + NL + "_UI_";
32   protected final String JavaDoc TEXT_15 = "_description = Create a new ";
33   protected final String JavaDoc TEXT_16 = " model" + NL + "" + NL + "_UI_";
34   protected final String JavaDoc TEXT_17 = "_label = ";
35   protected final String JavaDoc TEXT_18 = " Model Editor" + NL + "" + NL + "_UI_";
36   protected final String JavaDoc TEXT_19 = "FilenameDefaultBase = My" + NL + "_UI_";
37   protected final String JavaDoc TEXT_20 = "FilenameExtension = ";
38   protected final String JavaDoc TEXT_21 = NL;
39   protected final String JavaDoc TEXT_22 = NL + "_UI_Wizard_label = New" + NL + "" + NL + "_WARN_FilenameExtension = The file name must end in \".{0}\"" + NL + "" + NL + "_UI_ModelObject = Model Object" + NL + "_UI_XMLEncoding = XML Encoding" + NL + "_UI_XMLEncodingChoices = ";
40   protected final String JavaDoc TEXT_23 = NL + "_UI_Wizard_initial_object_description = Specify a file name and select a model object to create";
41   protected final String JavaDoc TEXT_24 = NL + "_UI_Wizard_initial_object_description = Select a model object to create";
42   protected final String JavaDoc TEXT_25 = NL + NL + "_UI_FileConflict_label = File Conflict" + NL + "_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?" + NL;
43   protected final String JavaDoc TEXT_26 = NL + "_UI_";
44   protected final String JavaDoc TEXT_27 = "_ActionSet_label = ";
45   protected final String JavaDoc TEXT_28 = " Action Set" + NL + "_UI_Perspective_label = ";
46   protected final String JavaDoc TEXT_29 = NL + NL + "_UI_Browse_label = &Browse..." + NL + "_UI_File_label = &File" + NL + "_UI_Question_title = Question" + NL + "_WARN_FileConflict = The file \"{0}\" already exists. Do you want to replace the existing file?" + NL + "_UI_Error_title = Error" + NL + "_WARN_No_Editor = There is no editor registered for the file \"{0}\"." + NL + "" + NL + "_UI_Application_title = ";
47   protected final String JavaDoc TEXT_30 = " Application" + NL + "_UI_Menu_File_label = &File" + NL + "_UI_Menu_New_label = &New" + NL + "_UI_Menu_Open_label = &Open..." + NL + "_UI_Menu_Open_description = Opens a model object file" + NL + "_UI_Menu_OpenURI_label = &Open URI..." + NL + "_UI_Menu_OpenURI_description = Opens a model object loading it from a URI" + NL + "_UI_Menu_Edit_label = &Edit" + NL + "_UI_Menu_Window_label = &Window" + NL + "_UI_Menu_Help_label = &Help" + NL + "_UI_Menu_About_label = ";
48   protected final String JavaDoc TEXT_31 = " &About..." + NL + "_UI_About_title = ";
49   protected final String JavaDoc TEXT_32 = " Application" + NL + "_UI_About_text = ";
50   protected final String JavaDoc TEXT_33 = " Application about box goes here." + NL;
51   protected final String JavaDoc TEXT_34 = NL + "_UI_";
52   protected final String JavaDoc TEXT_35 = "_ActionSet_label = ";
53   protected final String JavaDoc TEXT_36 = " Model Action Set";
54   protected final String JavaDoc TEXT_37 = NL;
55   protected final String JavaDoc TEXT_38 = NL;
56
57   public String JavaDoc generate(Object JavaDoc argument)
58   {
59     StringBuffer JavaDoc stringBuffer = new StringBuffer JavaDoc();
60     
61 /**
62  * <copyright>
63  *
64  * Copyright (c) 2002-2005 IBM Corporation and others.
65  * All rights reserved. This program and the accompanying materials
66  * are made available under the terms of the Eclipse Public License v1.0
67  * which accompanies this distribution, and is available at
68  * http://www.eclipse.org/legal/epl-v10.html
69  *
70  * Contributors:
71  * IBM - Initial API and implementation
72  *
73  * </copyright>
74  */

75
76     GenModel genModel = (GenModel)argument;
77     stringBuffer.append(TEXT_1);
78     stringBuffer.append(TEXT_2);
79     stringBuffer.append("$");
80     stringBuffer.append(TEXT_3);
81     stringBuffer.append("$");
82     stringBuffer.append(TEXT_4);
83     stringBuffer.append(genModel.getModelName());
84     stringBuffer.append(TEXT_5);
85     for (Iterator i = genModel.getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); ) { GenPackage genPackage = (GenPackage)i.next();
86     stringBuffer.append(TEXT_6);
87     stringBuffer.append(genPackage.getEditorClassName());
88     stringBuffer.append(TEXT_7);
89     stringBuffer.append(genPackage.getPrefix());
90     stringBuffer.append(TEXT_8);
91     }
92     stringBuffer.append(TEXT_9);
93     if (genModel.isCreationCommands()) {
94     stringBuffer.append(TEXT_10);
95     }
96     stringBuffer.append(TEXT_11);
97     for (Iterator i = genModel.getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); ) { GenPackage genPackage = (GenPackage)i.next();
98     stringBuffer.append(TEXT_12);
99     stringBuffer.append(genPackage.getModelWizardClassName());
100     stringBuffer.append(TEXT_13);
101     stringBuffer.append(genPackage.getPrefix());
102     stringBuffer.append(TEXT_14);
103     stringBuffer.append(genPackage.getModelWizardClassName());
104     stringBuffer.append(TEXT_15);
105     stringBuffer.append(genPackage.getPrefix());
106     stringBuffer.append(TEXT_16);
107     stringBuffer.append(genPackage.getEditorClassName());
108     stringBuffer.append(TEXT_17);
109     stringBuffer.append(genPackage.getPrefix());
110     stringBuffer.append(TEXT_18);
111     stringBuffer.append(genPackage.getEditorClassName());
112     stringBuffer.append(TEXT_19);
113     stringBuffer.append(genPackage.getEditorClassName());
114     stringBuffer.append(TEXT_20);
115     stringBuffer.append(genPackage.getPrefix().toLowerCase());
116     stringBuffer.append(TEXT_21);
117     }
118     stringBuffer.append(TEXT_22);
119     stringBuffer.append(genModel.getXMLEncodingChoices());
120     if (genModel.isRichClientPlatform()) {
121     stringBuffer.append(TEXT_23);
122     } else {
123     stringBuffer.append(TEXT_24);
124     }
125     stringBuffer.append(TEXT_25);
126     if (genModel.isRichClientPlatform()) {
127     stringBuffer.append(TEXT_26);
128     stringBuffer.append(genModel.getEditorAdvisorClassName());
129     stringBuffer.append(TEXT_27);
130     stringBuffer.append(genModel.getModelName());
131     stringBuffer.append(TEXT_28);
132     stringBuffer.append(genModel.getModelName());
133     stringBuffer.append(TEXT_29);
134     stringBuffer.append(genModel.getModelName());
135     stringBuffer.append(TEXT_30);
136     stringBuffer.append(genModel.getModelName());
137     stringBuffer.append(TEXT_31);
138     stringBuffer.append(genModel.getModelName());
139     stringBuffer.append(TEXT_32);
140     stringBuffer.append(genModel.getModelName());
141     stringBuffer.append(TEXT_33);
142     for (Iterator i = genModel.getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); ) { GenPackage genPackage = (GenPackage)i.next();
143     stringBuffer.append(TEXT_34);
144     stringBuffer.append(genPackage.getModelWizardClassName());
145     stringBuffer.append(TEXT_35);
146     stringBuffer.append(genPackage.getPrefix());
147     stringBuffer.append(TEXT_36);
148     }
149     stringBuffer.append(TEXT_37);
150     }
151     stringBuffer.append(TEXT_38);
152     return stringBuffer.toString();
153   }
154 }
155
Popular Tags