View | Details | Raw Unified | Return to bug 154708 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/PackageExample.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/PluginXML.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
19
  protected final String TEXT_2 = NL;
19
  protected final String TEXT_2 = NL;
20
  protected final String TEXT_3 = "<!--";
20
  protected final String TEXT_3 = "<!--";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/PluginProperties.java (-13 / +15 lines)
Lines 13-26 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "# ";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
18
  protected final String TEXT_2 = NL + "# ";
19
  protected final String TEXT_3 = NL + "#" + NL + "# ";
19
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
20
  protected final String TEXT_4 = "Id";
20
  protected final String TEXT_4 = NL + "#" + NL + "# ";
21
  protected final String TEXT_5 = 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 = ";
21
  protected final String TEXT_5 = "Id";
22
  protected final String TEXT_6 = " Tests" + NL + "providerName = www.example.org";
22
  protected final String TEXT_6 = 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 = ";
23
  protected final String TEXT_7 = NL;
23
  protected final String TEXT_7 = " Tests" + NL + "providerName = www.example.org";
24
  protected final String TEXT_8 = NL;
24
25
25
  public String generate(Object argument)
26
  public String generate(Object argument)
26
  {
27
  {
Lines 42-62 Link Here
42
 */
43
 */
43
44
44
    GenModel genModel = (GenModel)argument;
45
    GenModel genModel = (GenModel)argument;
46
    stringBuffer.append(TEXT_1);
45
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
47
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
46
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
48
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
47
    stringBuffer.append(TEXT_1);
49
    stringBuffer.append(TEXT_2);
48
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
50
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
49
    } else {
51
    } else {
50
    stringBuffer.append(TEXT_2);
51
    }}
52
    stringBuffer.append(TEXT_3);
52
    stringBuffer.append(TEXT_3);
53
    stringBuffer.append("$");
53
    }}
54
    stringBuffer.append(TEXT_4);
54
    stringBuffer.append(TEXT_4);
55
    stringBuffer.append("$");
55
    stringBuffer.append("$");
56
    stringBuffer.append(TEXT_5);
56
    stringBuffer.append(TEXT_5);
57
    stringBuffer.append(genModel.getModelName());
57
    stringBuffer.append("$");
58
    stringBuffer.append(TEXT_6);
58
    stringBuffer.append(TEXT_6);
59
    stringBuffer.append(genModel.getModelName());
59
    stringBuffer.append(TEXT_7);
60
    stringBuffer.append(TEXT_7);
61
    stringBuffer.append(TEXT_8);
60
    return stringBuffer.toString();
62
    return stringBuffer.toString();
61
  }
63
  }
62
}
64
}
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/BuildProperties.java (-21 / +23 lines)
Lines 13-31 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "# ";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
18
  protected final String TEXT_2 = NL + "# ";
19
  protected final String TEXT_3 = NL + "#" + NL + "# ";
19
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
20
  protected final String TEXT_4 = "Id";
20
  protected final String TEXT_4 = NL + "#" + NL + "# ";
21
  protected final String TEXT_5 = NL + NL + "bin.includes = ";
21
  protected final String TEXT_5 = "Id";
22
  protected final String TEXT_6 = ",\\";
22
  protected final String TEXT_6 = NL + NL + "bin.includes = ";
23
  protected final String TEXT_7 = NL + "               META-INF/,\\";
23
  protected final String TEXT_7 = ",\\";
24
  protected final String TEXT_8 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
24
  protected final String TEXT_8 = NL + "               META-INF/,\\";
25
  protected final String TEXT_9 = NL + "source.";
25
  protected final String TEXT_9 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
26
  protected final String TEXT_10 = " = src/" + NL + "output.";
26
  protected final String TEXT_10 = NL + "source.";
27
  protected final String TEXT_11 = " = bin/";
27
  protected final String TEXT_11 = " = src/" + NL + "output.";
28
  protected final String TEXT_12 = NL;
28
  protected final String TEXT_12 = " = bin/";
29
  protected final String TEXT_13 = NL;
29
30
30
  public String generate(Object argument)
31
  public String generate(Object argument)
31
  {
32
  {
Lines 48-78 Link Here
48
49
49
    GenModel genModel = (GenModel)argument;
50
    GenModel genModel = (GenModel)argument;
50
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getTestsPluginID()+".jar" : ".";
51
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getTestsPluginID()+".jar" : ".";
52
    stringBuffer.append(TEXT_1);
51
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
53
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
52
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
54
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
53
    stringBuffer.append(TEXT_1);
55
    stringBuffer.append(TEXT_2);
54
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
56
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
55
    } else {
57
    } else {
56
    stringBuffer.append(TEXT_2);
57
    }}
58
    stringBuffer.append(TEXT_3);
58
    stringBuffer.append(TEXT_3);
59
    stringBuffer.append("$");
59
    }}
60
    stringBuffer.append(TEXT_4);
60
    stringBuffer.append(TEXT_4);
61
    stringBuffer.append("$");
61
    stringBuffer.append("$");
62
    stringBuffer.append(TEXT_5);
62
    stringBuffer.append(TEXT_5);
63
    stringBuffer.append(pluginClassesLocation);
63
    stringBuffer.append("$");
64
    stringBuffer.append(TEXT_6);
64
    stringBuffer.append(TEXT_6);
65
    if (genModel.isBundleManifest()) {
65
    stringBuffer.append(pluginClassesLocation);
66
    stringBuffer.append(TEXT_7);
66
    stringBuffer.append(TEXT_7);
67
    }
67
    if (genModel.isBundleManifest()) {
68
    stringBuffer.append(TEXT_8);
68
    stringBuffer.append(TEXT_8);
69
    stringBuffer.append(pluginClassesLocation);
69
    }
70
    stringBuffer.append(TEXT_9);
70
    stringBuffer.append(TEXT_9);
71
    stringBuffer.append(pluginClassesLocation);
71
    stringBuffer.append(pluginClassesLocation);
72
    stringBuffer.append(TEXT_10);
72
    stringBuffer.append(TEXT_10);
73
    stringBuffer.append(pluginClassesLocation);
73
    stringBuffer.append(pluginClassesLocation);
74
    stringBuffer.append(TEXT_11);
74
    stringBuffer.append(TEXT_11);
75
    stringBuffer.append(pluginClassesLocation);
75
    stringBuffer.append(TEXT_12);
76
    stringBuffer.append(TEXT_12);
77
    stringBuffer.append(TEXT_13);
76
    return stringBuffer.toString();
78
    return stringBuffer.toString();
77
  }
79
  }
78
}
80
}
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/ModelTestSuite.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/PackageTestSuite.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/ManifestMF.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
20
  protected final String TEXT_3 = ".jar";
20
  protected final String TEXT_3 = ".jar";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/tests/TestCase.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/ManifestMF.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
20
  protected final String TEXT_3 = ".jar";
20
  protected final String TEXT_3 = ".jar";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/Plugin.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/PluginProperties.java (-83 / +109 lines)
Lines 14-62 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "# ";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
19
  protected final String TEXT_2 = NL + "# ";
20
  protected final String TEXT_3 = NL + "#" + NL + "# ";
20
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
21
  protected final String TEXT_4 = "Id";
21
  protected final String TEXT_4 = NL + "#" + NL + "# ";
22
  protected final String TEXT_5 = 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 TEXT_5 = "Id";
23
  protected final String TEXT_6 = " Editor" + NL + "providerName = www.example.org" + NL;
23
  protected final String TEXT_6 = 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 = ";
24
  protected final String TEXT_7 = NL + "_UI_";
24
  protected final String TEXT_7 = " Editor" + NL + "providerName = www.example.org" + NL;
25
  protected final String TEXT_8 = "_menu = &";
25
  protected final String TEXT_8 = NL + "_UI_";
26
  protected final String TEXT_9 = " Editor";
26
  protected final String TEXT_9 = "_menu = &";
27
  protected final String TEXT_10 = NL;
27
  protected final String TEXT_10 = " Editor";
28
  protected final String TEXT_11 = NL + "_UI_CreateChild_menu_item = &New Child" + NL + "_UI_CreateSibling_menu_item = N&ew Sibling" + NL;
28
  protected final String TEXT_11 = NL;
29
  protected final String TEXT_12 = NL + "_UI_ShowPropertiesView_menu_item = Show &Properties View" + NL + "_UI_RefreshViewer_menu_item = &Refresh" + NL + "" + NL + "_UI_SelectionPage_label = Selection";
29
  protected final String TEXT_12 = NL + "_UI_CreateChild_menu_item = &New Child" + NL + "_UI_CreateSibling_menu_item = N&ew Sibling" + NL;
30
  protected final String TEXT_13 = 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";
30
  protected final String TEXT_13 = NL + "_UI_ShowPropertiesView_menu_item = Show &Properties View" + NL + "_UI_RefreshViewer_menu_item = &Refresh" + NL + "" + NL + "_UI_SelectionPage_label = Selection";
31
  protected final String TEXT_14 = 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 + "" + NL + "_UI_CreateModelError_message = Problems encountered in file \"{0}\"" + NL;
31
  protected final String TEXT_14 = 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";
32
  protected final String TEXT_15 = NL + "_UI_";
32
  protected final String TEXT_15 = 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 + "" + NL + "_UI_CreateModelError_message = Problems encountered in file \"{0}\"" + NL;
33
  protected final String TEXT_16 = "_label = ";
33
  protected final String TEXT_16 = NL + "_UI_";
34
  protected final String TEXT_17 = " Model" + NL + "_UI_";
34
  protected final String TEXT_17 = "_label = ";
35
  protected final String TEXT_18 = "_description = Create a new ";
35
  protected final String TEXT_18 = " Model" + NL + "_UI_";
36
  protected final String TEXT_19 = " model" + NL;
36
  protected final String TEXT_19 = "_description = Create a new ";
37
  protected final String TEXT_20 = NL + "_UI_";
37
  protected final String TEXT_20 = " model" + NL;
38
  protected final String TEXT_21 = "_label = ";
38
  protected final String TEXT_21 = NL + "_UI_";
39
  protected final String TEXT_22 = " Model Editor" + NL + "" + NL + "_UI_";
39
  protected final String TEXT_22 = "_label = ";
40
  protected final String TEXT_23 = "FilenameDefaultBase = My" + NL + "_UI_";
40
  protected final String TEXT_23 = " Model Editor" + NL + "" + NL + "_UI_";
41
  protected final String TEXT_24 = "FilenameExtension = ";
41
  protected final String TEXT_24 = "FilenameDefaultBase = My" + NL + "_UI_";
42
  protected final String TEXT_25 = NL;
42
  protected final String TEXT_25 = "FilenameExtension = ";
43
  protected final String TEXT_26 = 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 = ";
43
  protected final String TEXT_26 = NL + NL + "_UI_";
44
  protected final String TEXT_27 = NL + "_UI_Wizard_initial_object_description = Specify a file name and select a model object to create";
44
  protected final String TEXT_27 = "_label = ";
45
  protected final String TEXT_28 = NL + "_UI_Wizard_initial_object_description = Select a model object to create";
45
  protected final String TEXT_28 = " Editor Preferences" + NL + "_UI_";
46
  protected final String TEXT_29 = 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;
46
  protected final String TEXT_29 = "_description = ";
47
  protected final String TEXT_30 = NL + "_UI_";
47
  protected final String TEXT_30 = " Editor XML saving preferences." + NL + "_UI_";
48
  protected final String TEXT_31 = "_ActionSet_label = ";
48
  protected final String TEXT_31 = "TypeInformation_label = Save type information" + NL + "_UI_";
49
  protected final String TEXT_32 = " Action Set" + NL + "_UI_Perspective_label = ";
49
  protected final String TEXT_32 = "SaveDoctype_label = Save doctype declaration" + NL + "_UI_";
50
  protected final String TEXT_33 = 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 = ";
50
  protected final String TEXT_33 = "Formatted_label = Output formatted XML" + NL + "_UI_";
51
  protected final String TEXT_34 = " 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 = ";
51
  protected final String TEXT_34 = "LineWidth_label = XML file line width" + NL;
52
  protected final String TEXT_35 = " &About..." + NL + "_UI_About_title = ";
52
  protected final String TEXT_35 = 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 = ";
53
  protected final String TEXT_36 = " Application" + NL + "_UI_About_text = ";
53
  protected final String TEXT_36 = NL + "_UI_Wizard_initial_object_description = Specify a file name and select a model object to create";
54
  protected final String TEXT_37 = " Application about box goes here." + NL;
54
  protected final String TEXT_37 = NL + "_UI_Wizard_initial_object_description = Select a model object to create";
55
  protected final String TEXT_38 = NL + "_UI_";
55
  protected final String TEXT_38 = 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;
56
  protected final String TEXT_39 = "_ActionSet_label = ";
56
  protected final String TEXT_39 = NL + "_UI_";
57
  protected final String TEXT_40 = " Model Action Set";
57
  protected final String TEXT_40 = "_ActionSet_label = ";
58
  protected final String TEXT_41 = NL;
58
  protected final String TEXT_41 = " Action Set" + NL + "_UI_Perspective_label = ";
59
  protected final String TEXT_42 = NL;
59
  protected final String TEXT_42 = 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 = ";
60
  protected final String TEXT_43 = " 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 = ";
61
  protected final String TEXT_44 = " &About..." + NL + "_UI_About_title = ";
62
  protected final String TEXT_45 = " Application" + NL + "_UI_About_text = ";
63
  protected final String TEXT_46 = " Application about box goes here." + NL;
64
  protected final String TEXT_47 = NL + "_UI_";
65
  protected final String TEXT_48 = "_ActionSet_label = ";
66
  protected final String TEXT_49 = " Model Action Set";
67
  protected final String TEXT_50 = NL;
68
  protected final String TEXT_51 = NL;
60
69
61
  public String generate(Object argument)
70
  public String generate(Object argument)
62
  {
71
  {
Lines 78-172 Link Here
78
 */
87
 */
79
88
80
    GenModel genModel = (GenModel)argument; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
89
    GenModel genModel = (GenModel)argument; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
90
    stringBuffer.append(TEXT_1);
81
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
91
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
82
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
92
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
83
    stringBuffer.append(TEXT_1);
93
    stringBuffer.append(TEXT_2);
84
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
94
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
85
    } else {
95
    } else {
86
    stringBuffer.append(TEXT_2);
87
    }}
88
    stringBuffer.append(TEXT_3);
96
    stringBuffer.append(TEXT_3);
89
    stringBuffer.append("$");
97
    }}
90
    stringBuffer.append(TEXT_4);
98
    stringBuffer.append(TEXT_4);
91
    stringBuffer.append("$");
99
    stringBuffer.append("$");
92
    stringBuffer.append(TEXT_5);
100
    stringBuffer.append(TEXT_5);
93
    stringBuffer.append(genModel.getModelName());
101
    stringBuffer.append("$");
94
    stringBuffer.append(TEXT_6);
102
    stringBuffer.append(TEXT_6);
103
    stringBuffer.append(genModel.getModelName());
104
    stringBuffer.append(TEXT_7);
95
    boolean hasMultiPageEditor = false;
105
    boolean hasMultiPageEditor = false;
96
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isMultipleEditorPages()) { hasMultiPageEditor = true; }
106
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isMultipleEditorPages()) { hasMultiPageEditor = true; }
97
    stringBuffer.append(TEXT_7);
98
    stringBuffer.append(genPackage.getEditorClassName());
99
    stringBuffer.append(TEXT_8);
107
    stringBuffer.append(TEXT_8);
100
    stringBuffer.append(genPackage.getPrefix());
108
    stringBuffer.append(genPackage.getEditorClassName());
101
    stringBuffer.append(TEXT_9);
109
    stringBuffer.append(TEXT_9);
102
    }
110
    stringBuffer.append(genPackage.getPrefix());
103
    stringBuffer.append(TEXT_10);
111
    stringBuffer.append(TEXT_10);
104
    if (genModel.isCreationCommands()) {
105
    stringBuffer.append(TEXT_11);
106
    }
112
    }
113
    stringBuffer.append(TEXT_11);
114
    if (genModel.isCreationCommands()) {
107
    stringBuffer.append(TEXT_12);
115
    stringBuffer.append(TEXT_12);
108
    if (hasMultiPageEditor) {
109
    stringBuffer.append(TEXT_13);
110
    }
116
    }
117
    stringBuffer.append(TEXT_13);
118
    if (hasMultiPageEditor) {
111
    stringBuffer.append(TEXT_14);
119
    stringBuffer.append(TEXT_14);
120
    }
121
    stringBuffer.append(TEXT_15);
112
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {
122
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {
113
    if (genPackage.isGenerateModelWizard()) {
123
    if (genPackage.isGenerateModelWizard()) {
114
    stringBuffer.append(TEXT_15);
115
    stringBuffer.append(genPackage.getModelWizardClassName());
116
    stringBuffer.append(TEXT_16);
124
    stringBuffer.append(TEXT_16);
117
    stringBuffer.append(genPackage.getPrefix());
118
    stringBuffer.append(TEXT_17);
119
    stringBuffer.append(genPackage.getModelWizardClassName());
125
    stringBuffer.append(genPackage.getModelWizardClassName());
120
    stringBuffer.append(TEXT_18);
126
    stringBuffer.append(TEXT_17);
121
    stringBuffer.append(genPackage.getPrefix());
127
    stringBuffer.append(genPackage.getPrefix());
128
    stringBuffer.append(TEXT_18);
129
    stringBuffer.append(genPackage.getModelWizardClassName());
122
    stringBuffer.append(TEXT_19);
130
    stringBuffer.append(TEXT_19);
123
    }
131
    stringBuffer.append(genPackage.getPrefix());
124
    stringBuffer.append(TEXT_20);
132
    stringBuffer.append(TEXT_20);
125
    stringBuffer.append(genPackage.getEditorClassName());
133
    }
126
    stringBuffer.append(TEXT_21);
134
    stringBuffer.append(TEXT_21);
127
    stringBuffer.append(genPackage.getPrefix());
128
    stringBuffer.append(TEXT_22);
129
    stringBuffer.append(genPackage.getEditorClassName());
135
    stringBuffer.append(genPackage.getEditorClassName());
136
    stringBuffer.append(TEXT_22);
137
    stringBuffer.append(genPackage.getPrefix());
130
    stringBuffer.append(TEXT_23);
138
    stringBuffer.append(TEXT_23);
131
    stringBuffer.append(genPackage.getEditorClassName());
139
    stringBuffer.append(genPackage.getEditorClassName());
132
    stringBuffer.append(TEXT_24);
140
    stringBuffer.append(TEXT_24);
133
    stringBuffer.append(genPackage.getPrefix().toLowerCase());
141
    stringBuffer.append(genPackage.getEditorClassName());
134
    stringBuffer.append(TEXT_25);
142
    stringBuffer.append(TEXT_25);
135
    }
143
    stringBuffer.append(genPackage.getPrefix().toLowerCase());
136
    stringBuffer.append(TEXT_26);
144
    stringBuffer.append(TEXT_26);
145
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
146
    stringBuffer.append(TEXT_27);
147
    stringBuffer.append(genPackage.getPrefix());
148
    stringBuffer.append(TEXT_28);
149
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
150
    stringBuffer.append(TEXT_29);
151
    stringBuffer.append(genPackage.getPrefix());
152
    stringBuffer.append(TEXT_30);
153
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
154
    stringBuffer.append(TEXT_31);
155
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
156
    stringBuffer.append(TEXT_32);
157
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
158
    stringBuffer.append(TEXT_33);
159
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
160
    stringBuffer.append(TEXT_34);
161
    }
162
    stringBuffer.append(TEXT_35);
137
    stringBuffer.append(genModel.getXMLEncodingChoices());
163
    stringBuffer.append(genModel.getXMLEncodingChoices());
138
    if (genModel.isRichClientPlatform()) {
164
    if (genModel.isRichClientPlatform()) {
139
    stringBuffer.append(TEXT_27);
165
    stringBuffer.append(TEXT_36);
140
    } else {
166
    } else {
141
    stringBuffer.append(TEXT_28);
167
    stringBuffer.append(TEXT_37);
142
    }
168
    }
143
    stringBuffer.append(TEXT_29);
169
    stringBuffer.append(TEXT_38);
144
    if (genModel.isRichClientPlatform()) {
170
    if (genModel.isRichClientPlatform()) {
145
    stringBuffer.append(TEXT_30);
171
    stringBuffer.append(TEXT_39);
146
    stringBuffer.append(genModel.getEditorAdvisorClassName());
172
    stringBuffer.append(genModel.getEditorAdvisorClassName());
147
    stringBuffer.append(TEXT_31);
173
    stringBuffer.append(TEXT_40);
148
    stringBuffer.append(genModel.getModelName());
174
    stringBuffer.append(genModel.getModelName());
149
    stringBuffer.append(TEXT_32);
175
    stringBuffer.append(TEXT_41);
150
    stringBuffer.append(genModel.getModelName());
176
    stringBuffer.append(genModel.getModelName());
151
    stringBuffer.append(TEXT_33);
177
    stringBuffer.append(TEXT_42);
152
    stringBuffer.append(genModel.getModelName());
178
    stringBuffer.append(genModel.getModelName());
153
    stringBuffer.append(TEXT_34);
179
    stringBuffer.append(TEXT_43);
154
    stringBuffer.append(genModel.getModelName());
180
    stringBuffer.append(genModel.getModelName());
155
    stringBuffer.append(TEXT_35);
181
    stringBuffer.append(TEXT_44);
156
    stringBuffer.append(genModel.getModelName());
182
    stringBuffer.append(genModel.getModelName());
157
    stringBuffer.append(TEXT_36);
183
    stringBuffer.append(TEXT_45);
158
    stringBuffer.append(genModel.getModelName());
184
    stringBuffer.append(genModel.getModelName());
159
    stringBuffer.append(TEXT_37);
185
    stringBuffer.append(TEXT_46);
160
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isGenerateModelWizard()) {
186
    for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isGenerateModelWizard()) {
161
    stringBuffer.append(TEXT_38);
187
    stringBuffer.append(TEXT_47);
162
    stringBuffer.append(genPackage.getModelWizardClassName());
188
    stringBuffer.append(genPackage.getModelWizardClassName());
163
    stringBuffer.append(TEXT_39);
189
    stringBuffer.append(TEXT_48);
164
    stringBuffer.append(genPackage.getPrefix());
190
    stringBuffer.append(genPackage.getPrefix());
165
    stringBuffer.append(TEXT_40);
191
    stringBuffer.append(TEXT_49);
166
    }}
192
    }}
167
    stringBuffer.append(TEXT_41);
193
    stringBuffer.append(TEXT_50);
168
    }
194
    }
169
    stringBuffer.append(TEXT_42);
195
    stringBuffer.append(TEXT_51);
170
    return stringBuffer.toString();
196
    return stringBuffer.toString();
171
  }
197
  }
172
}
198
}
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/Advisor.java (-1 / +1 lines)
Lines 15-21 Link Here
15
    return result;
15
    return result;
16
  }
16
  }
17
17
18
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
19
  protected final String TEXT_1 = "";
19
  protected final String TEXT_1 = "";
20
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_2 = "/**";
21
  protected final String TEXT_3 = NL + " * ";
21
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/Editor.java (-119 / +128 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
Lines 26-32 Link Here
26
  protected final String TEXT_9 = NL + NL + "import org.eclipse.core.resources.IFile;" + NL + "import org.eclipse.core.resources.IMarker;" + NL + "import org.eclipse.core.resources.IResource;" + NL + "import org.eclipse.core.resources.IResourceChangeEvent;" + NL + "import org.eclipse.core.resources.IResourceChangeListener;" + NL + "import org.eclipse.core.resources.IResourceDelta;" + NL + "import org.eclipse.core.resources.IResourceDeltaVisitor;" + NL + "import org.eclipse.core.resources.ResourcesPlugin;";
26
  protected final String TEXT_9 = NL + NL + "import org.eclipse.core.resources.IFile;" + NL + "import org.eclipse.core.resources.IMarker;" + NL + "import org.eclipse.core.resources.IResource;" + NL + "import org.eclipse.core.resources.IResourceChangeEvent;" + NL + "import org.eclipse.core.resources.IResourceChangeListener;" + NL + "import org.eclipse.core.resources.IResourceDelta;" + NL + "import org.eclipse.core.resources.IResourceDeltaVisitor;" + NL + "import org.eclipse.core.resources.ResourcesPlugin;";
27
  protected final String TEXT_10 = NL;
27
  protected final String TEXT_10 = NL;
28
  protected final String TEXT_11 = NL + "import org.eclipse.core.runtime.CoreException;" + NL + "import org.eclipse.core.runtime.IPath;";
28
  protected final String TEXT_11 = NL + "import org.eclipse.core.runtime.CoreException;" + NL + "import org.eclipse.core.runtime.IPath;";
29
  protected final String TEXT_12 = NL + "import org.eclipse.core.runtime.IProgressMonitor;" + NL + "import org.eclipse.core.runtime.NullProgressMonitor;" + NL + "" + NL + "import org.eclipse.jface.action.IMenuListener;" + NL + "import org.eclipse.jface.action.IMenuManager;" + NL + "import org.eclipse.jface.action.IStatusLineManager;" + NL + "import org.eclipse.jface.action.IToolBarManager;" + NL + "import org.eclipse.jface.action.MenuManager;" + NL + "import org.eclipse.jface.action.Separator;" + NL + "" + NL + "import org.eclipse.jface.dialogs.MessageDialog;" + NL + "import org.eclipse.jface.dialogs.ProgressMonitorDialog;" + NL;
29
  protected final String TEXT_12 = NL + "import org.eclipse.core.runtime.IProgressMonitor;" + NL + "import org.eclipse.core.runtime.NullProgressMonitor;" + NL + "" + NL + "import org.eclipse.jface.action.IMenuListener;" + NL + "import org.eclipse.jface.action.IMenuManager;" + NL + "import org.eclipse.jface.action.IStatusLineManager;" + NL + "import org.eclipse.jface.action.IToolBarManager;" + NL + "import org.eclipse.jface.action.MenuManager;" + NL + "import org.eclipse.jface.action.Separator;" + NL + "" + NL + "import org.eclipse.jface.dialogs.MessageDialog;" + NL + "import org.eclipse.jface.dialogs.ProgressMonitorDialog;" + NL + "" + NL + "import org.eclipse.jface.preference.IPreferenceStore;" + NL;
30
  protected final String TEXT_13 = NL + "import org.eclipse.jface.viewers.ColumnWeightData;";
30
  protected final String TEXT_13 = NL + "import org.eclipse.jface.viewers.ColumnWeightData;";
31
  protected final String TEXT_14 = NL + "import org.eclipse.jface.viewers.ISelection;" + NL + "import org.eclipse.jface.viewers.ISelectionChangedListener;" + NL + "import org.eclipse.jface.viewers.ISelectionProvider;" + NL + "import org.eclipse.jface.viewers.IStructuredSelection;";
31
  protected final String TEXT_14 = NL + "import org.eclipse.jface.viewers.ISelection;" + NL + "import org.eclipse.jface.viewers.ISelectionChangedListener;" + NL + "import org.eclipse.jface.viewers.ISelectionProvider;" + NL + "import org.eclipse.jface.viewers.IStructuredSelection;";
32
  protected final String TEXT_15 = NL + "import org.eclipse.jface.viewers.ListViewer;";
32
  protected final String TEXT_15 = NL + "import org.eclipse.jface.viewers.ListViewer;";
Lines 40-46 Link Here
40
  protected final String TEXT_23 = NL + "import org.eclipse.swt.widgets.TreeColumn;";
40
  protected final String TEXT_23 = NL + "import org.eclipse.swt.widgets.TreeColumn;";
41
  protected final String TEXT_24 = NL + NL + "import org.eclipse.ui.IActionBars;" + NL + "import org.eclipse.ui.IEditorInput;" + NL + "import org.eclipse.ui.IEditorPart;" + NL + "import org.eclipse.ui.IEditorSite;";
41
  protected final String TEXT_24 = NL + NL + "import org.eclipse.ui.IActionBars;" + NL + "import org.eclipse.ui.IEditorInput;" + NL + "import org.eclipse.ui.IEditorPart;" + NL + "import org.eclipse.ui.IEditorSite;";
42
  protected final String TEXT_25 = NL + "import org.eclipse.ui.IFileEditorInput;";
42
  protected final String TEXT_25 = NL + "import org.eclipse.ui.IFileEditorInput;";
43
  protected final String TEXT_26 = NL + "import org.eclipse.ui.IPartListener;" + NL + "import org.eclipse.ui.IWorkbenchPart;" + NL + "import org.eclipse.ui.PartInitException;";
43
  protected final String TEXT_26 = NL + "import org.eclipse.ui.IPartListener;" + NL + "import org.eclipse.ui.IWorkbenchPart;" + NL + "import org.eclipse.ui.PartInitException;" + NL + "import org.eclipse.ui.PlatformUI;";
44
  protected final String TEXT_27 = NL + NL + "import org.eclipse.ui.dialogs.SaveAsDialog;" + NL + "" + NL + "import org.eclipse.ui.ide.IGotoMarker;";
44
  protected final String TEXT_27 = NL + NL + "import org.eclipse.ui.dialogs.SaveAsDialog;" + NL + "" + NL + "import org.eclipse.ui.ide.IGotoMarker;";
45
  protected final String TEXT_28 = NL;
45
  protected final String TEXT_28 = NL;
46
  protected final String TEXT_29 = NL + "import org.eclipse.ui.part.FileEditorInput;";
46
  protected final String TEXT_29 = NL + "import org.eclipse.ui.part.FileEditorInput;";
Lines 51-57 Link Here
51
  protected final String TEXT_34 = NL + "import org.eclipse.emf.ecore.EObject;" + NL + "import org.eclipse.emf.ecore.EValidator;";
51
  protected final String TEXT_34 = NL + "import org.eclipse.emf.ecore.EObject;" + NL + "import org.eclipse.emf.ecore.EValidator;";
52
  protected final String TEXT_35 = NL + NL + "import org.eclipse.emf.ecore.resource.Resource;";
52
  protected final String TEXT_35 = NL + NL + "import org.eclipse.emf.ecore.resource.Resource;";
53
  protected final String TEXT_36 = NL + "import org.eclipse.emf.ecore.resource.ResourceSet;";
53
  protected final String TEXT_36 = NL + "import org.eclipse.emf.ecore.resource.ResourceSet;";
54
  protected final String TEXT_37 = NL + NL + "import org.eclipse.emf.ecore.util.EContentAdapter;" + NL + "import org.eclipse.emf.ecore.util.EcoreUtil;" + NL + "" + NL + "import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;" + NL + "import org.eclipse.emf.edit.domain.EditingDomain;" + NL + "import org.eclipse.emf.edit.domain.IEditingDomainProvider;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;" + NL + "import org.eclipse.emf.edit.provider.ComposedAdapterFactory;" + NL + "import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;" + NL + "import org.eclipse.emf.edit.ui.dnd.LocalTransfer;" + NL + "import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;";
54
  protected final String TEXT_37 = NL + NL + "import org.eclipse.emf.ecore.util.EContentAdapter;" + NL + "import org.eclipse.emf.ecore.util.EcoreUtil;" + NL + "" + NL + "import org.eclipse.emf.ecore.xmi.XMLResource;" + NL + "" + NL + "import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;" + NL + "import org.eclipse.emf.edit.domain.EditingDomain;" + NL + "import org.eclipse.emf.edit.domain.IEditingDomainProvider;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;" + NL + "import org.eclipse.emf.edit.provider.ComposedAdapterFactory;" + NL + "import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;" + NL + "import org.eclipse.emf.edit.ui.dnd.LocalTransfer;" + NL + "import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;";
55
  protected final String TEXT_38 = NL + NL + "import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;";
55
  protected final String TEXT_38 = NL + NL + "import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;";
56
  protected final String TEXT_39 = NL + NL + "import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;" + NL + "" + NL + "import ";
56
  protected final String TEXT_39 = NL + NL + "import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;" + NL + "" + NL + "import ";
57
  protected final String TEXT_40 = ";" + NL;
57
  protected final String TEXT_40 = ";" + NL;
Lines 243-309 Link Here
243
  protected final String TEXT_226 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
243
  protected final String TEXT_226 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
244
  protected final String TEXT_227 = NL + "\t@Override";
244
  protected final String TEXT_227 = NL + "\t@Override";
245
  protected final String TEXT_228 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal ";
245
  protected final String TEXT_228 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal ";
246
  protected final String TEXT_229 = " saveOptions = new ";
246
  protected final String TEXT_229 = " saveOptions = getPreferences();" + NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);" + NL + "\t\t;" + NL + "" + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t";
247
  protected final String TEXT_230 = "();" + NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);" + NL + "" + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t";
247
  protected final String TEXT_230 = " operation =" + NL + "\t\t\tnew ";
248
  protected final String TEXT_231 = " operation =" + NL + "\t\t\tnew ";
248
  protected final String TEXT_231 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//";
249
  protected final String TEXT_232 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//";
249
  protected final String TEXT_232 = NL + "\t\t\t\t@Override";
250
  protected final String TEXT_233 = NL + "\t\t\t\t@Override";
250
  protected final String TEXT_233 = NL + "\t\t\t\tpublic void ";
251
  protected final String TEXT_234 = NL + "\t\t\t\tpublic void ";
251
  protected final String TEXT_234 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;";
252
  protected final String TEXT_235 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;";
252
  protected final String TEXT_235 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())";
253
  protected final String TEXT_236 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())";
253
  protected final String TEXT_236 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )";
254
  protected final String TEXT_237 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )";
254
  protected final String TEXT_237 = NL + "\t\t\t\t\t{";
255
  protected final String TEXT_238 = NL + "\t\t\t\t\t{";
255
  protected final String TEXT_238 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();";
256
  protected final String TEXT_239 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();";
256
  protected final String TEXT_239 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t";
257
  protected final String TEXT_240 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t";
257
  protected final String TEXT_240 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Determine save options from properties and set them in map. Options already set in map will" + NL + "\t * be overwritten it they are specified in preferences." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
258
  protected final String TEXT_241 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns wether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream. " + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
258
  protected final String TEXT_241 = " getPreferences() {" + NL + "\t\t";
259
  protected final String TEXT_242 = NL + "\t@Override";
259
  protected final String TEXT_242 = " options = new ";
260
  protected final String TEXT_243 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
260
  protected final String TEXT_243 = "();" + NL + "\t\tIPreferenceStore defaultsStore = PlatformUI.getPreferenceStore();" + NL + "\t\tIPreferenceStore store = ";
261
  protected final String TEXT_244 = NL + "\t@Override";
261
  protected final String TEXT_244 = ".getPlugin().getPreferenceStore();" + NL + "\t\t\t\t" + NL + "\t\tString key = XMLResource.OPTION_SAVE_TYPE_INFORMATION;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t\t\t" + NL + "\t\tkey = XMLResource.OPTION_SAVE_DOCTYPE;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t\t\t" + NL + "\t\tkey = XMLResource.OPTION_FORMATTED;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t" + NL + "\t\tkey = XMLResource.OPTION_LINE_WIDTH;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getInt(key));" + NL + "\t\t" + NL + "\t\treturn options;" + NL + "\t}" + NL + "\t\t\t\t" + NL + "\t/**" + NL + "\t * Returns first store that contains given key" + NL + "\t */" + NL + "\tprivate IPreferenceStore getStore(IPreferenceStore primary, IPreferenceStore secondary, String key) {" + NL + "\t\treturn (primary.contains(key)) ? primary : secondary;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns wether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream. " + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
262
  protected final String TEXT_245 = NL + "\tpublic void doSaveAs()" + NL + "\t{";
262
  protected final String TEXT_245 = NL + "\t@Override";
263
  protected final String TEXT_246 = NL + "\t\tString fileExtension = getString(\"_UI_";
263
  protected final String TEXT_246 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
264
  protected final String TEXT_247 = "FilenameExtension\");";
264
  protected final String TEXT_247 = NL + "\t@Override";
265
  protected final String TEXT_248 = NL + "\t\tString file = ";
265
  protected final String TEXT_248 = NL + "\tpublic void doSaveAs()" + NL + "\t{";
266
  protected final String TEXT_249 = ".openFilePathDialog(getSite().getShell(), \"*.\" + fileExtension, ";
266
  protected final String TEXT_249 = NL + "\t\tString fileExtension = getString(\"_UI_";
267
  protected final String TEXT_250 = ".SAVE);";
267
  protected final String TEXT_250 = "FilenameExtension\");";
268
  protected final String TEXT_251 = NL + "\t\tif (file != null)" + NL + "\t\t{" + NL + "\t\t\tif (!file.endsWith(\".\" + fileExtension))";
268
  protected final String TEXT_251 = NL + "\t\tString file = ";
269
  protected final String TEXT_252 = NL + "\t\t\t{" + NL + "\t\t\t\tfile = file + \".\" + fileExtension;";
269
  protected final String TEXT_252 = ".openFilePathDialog(getSite().getShell(), \"*.\" + fileExtension, ";
270
  protected final String TEXT_253 = NL + "\t\t\t}" + NL + "\t\t\tURI uri = URI.createFileURI(file);" + NL + "\t\t\tdoSaveAs(uri, new ";
270
  protected final String TEXT_253 = ".SAVE);";
271
  protected final String TEXT_254 = "(uri));" + NL + "\t\t}";
271
  protected final String TEXT_254 = NL + "\t\tif (file != null)" + NL + "\t\t{" + NL + "\t\t\tif (!file.endsWith(\".\" + fileExtension))";
272
  protected final String TEXT_255 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}";
272
  protected final String TEXT_255 = NL + "\t\t\t{" + NL + "\t\t\t\tfile = file + \".\" + fileExtension;";
273
  protected final String TEXT_256 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t(";
273
  protected final String TEXT_256 = NL + "\t\t\t}" + NL + "\t\t\tURI uri = URI.createFileURI(file);" + NL + "\t\t\tdoSaveAs(uri, new ";
274
  protected final String TEXT_257 = "(Resource)";
274
  protected final String TEXT_257 = "(uri));" + NL + "\t\t}";
275
  protected final String TEXT_258 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew ";
275
  protected final String TEXT_258 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}";
276
  protected final String TEXT_259 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}";
276
  protected final String TEXT_259 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t(";
277
  protected final String TEXT_260 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.getType().equals(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t";
277
  protected final String TEXT_260 = "(Resource)";
278
  protected final String TEXT_261 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t}";
278
  protected final String TEXT_261 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew ";
279
  protected final String TEXT_262 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
279
  protected final String TEXT_262 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}";
280
  protected final String TEXT_263 = NL + "\t@Override";
280
  protected final String TEXT_263 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.getType().equals(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t  setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t";
281
  protected final String TEXT_264 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);";
281
  protected final String TEXT_264 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t}";
282
  protected final String TEXT_265 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);";
282
  protected final String TEXT_265 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
283
  protected final String TEXT_266 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
283
  protected final String TEXT_266 = NL + "\t@Override";
284
  protected final String TEXT_267 = NL + "\t@Override";
284
  protected final String TEXT_267 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);";
285
  protected final String TEXT_268 = NL + "\tpublic void setFocus()" + NL + "\t{";
285
  protected final String TEXT_268 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);";
286
  protected final String TEXT_269 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}";
286
  protected final String TEXT_269 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
287
  protected final String TEXT_270 = NL + "\t\tgetControl(getActivePage()).setFocus();";
287
  protected final String TEXT_270 = NL + "\t@Override";
288
  protected final String TEXT_271 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL;
288
  protected final String TEXT_271 = NL + "\tpublic void setFocus()" + NL + "\t{";
289
  protected final String TEXT_272 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)";
289
  protected final String TEXT_272 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}";
290
  protected final String TEXT_273 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )";
290
  protected final String TEXT_273 = NL + "\t\tgetControl(getActivePage()).setFocus();";
291
  protected final String TEXT_274 = NL + "\t\t{";
291
  protected final String TEXT_274 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL;
292
  protected final String TEXT_275 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();";
292
  protected final String TEXT_275 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)";
293
  protected final String TEXT_276 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t";
293
  protected final String TEXT_276 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )";
294
  protected final String TEXT_277 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));";
294
  protected final String TEXT_277 = NL + "\t\t{";
295
  protected final String TEXT_278 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));";
295
  protected final String TEXT_278 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();";
296
  protected final String TEXT_279 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));";
296
  protected final String TEXT_279 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t";
297
  protected final String TEXT_280 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");";
297
  protected final String TEXT_280 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));";
298
  protected final String TEXT_281 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn ";
298
  protected final String TEXT_281 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));";
299
  protected final String TEXT_282 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn ";
299
  protected final String TEXT_282 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));";
300
  protected final String TEXT_283 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
300
  protected final String TEXT_283 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");";
301
  protected final String TEXT_284 = NL + "\t@Override";
301
  protected final String TEXT_284 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn ";
302
  protected final String TEXT_285 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL;
302
  protected final String TEXT_285 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn ";
303
  protected final String TEXT_286 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL;
303
  protected final String TEXT_286 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
304
  protected final String TEXT_287 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL + "" + NL + "\t\tif (propertySheetPage != null)" + NL + "\t\t{" + NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn ";
304
  protected final String TEXT_287 = NL + "\t@Override";
305
  protected final String TEXT_288 = ";" + NL + "\t}" + NL + "}";
305
  protected final String TEXT_288 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL;
306
  protected final String TEXT_289 = NL;
306
  protected final String TEXT_289 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL;
307
  protected final String TEXT_290 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL + "" + NL + "\t\tif (propertySheetPage != null)" + NL + "\t\t{" + NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn ";
308
  protected final String TEXT_291 = ";" + NL + "\t}" + NL + "}";
309
  protected final String TEXT_292 = NL;
307
310
308
  public String generate(Object argument)
311
  public String generate(Object argument)
309
  {
312
  {
Lines 809-934 Link Here
809
    stringBuffer.append(TEXT_228);
812
    stringBuffer.append(TEXT_228);
810
    stringBuffer.append(_MapOfObjectToObject);
813
    stringBuffer.append(_MapOfObjectToObject);
811
    stringBuffer.append(TEXT_229);
814
    stringBuffer.append(TEXT_229);
812
    stringBuffer.append(_HashMapOfObjectToObject);
815
    stringBuffer.append(importedOperationClassName);
813
    stringBuffer.append(TEXT_230);
816
    stringBuffer.append(TEXT_230);
814
    stringBuffer.append(importedOperationClassName);
817
    stringBuffer.append(importedOperationClassName);
815
    stringBuffer.append(TEXT_231);
818
    stringBuffer.append(TEXT_231);
816
    stringBuffer.append(importedOperationClassName);
817
    stringBuffer.append(TEXT_232);
818
    if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) {
819
    if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) {
819
    stringBuffer.append(TEXT_233);
820
    stringBuffer.append(TEXT_232);
820
    }
821
    }
821
    stringBuffer.append(TEXT_234);
822
    stringBuffer.append(TEXT_233);
822
    stringBuffer.append(operationMethodName);
823
    stringBuffer.append(operationMethodName);
823
    stringBuffer.append(TEXT_235);
824
    stringBuffer.append(TEXT_234);
824
    if (genModel.useGenerics()) {
825
    if (genModel.useGenerics()) {
825
    stringBuffer.append(TEXT_236);
826
    stringBuffer.append(TEXT_235);
826
    } else {
827
    } else {
827
    stringBuffer.append(TEXT_237);
828
    stringBuffer.append(TEXT_236);
828
    }
829
    }
829
    stringBuffer.append(TEXT_238);
830
    stringBuffer.append(TEXT_237);
830
    if (!genModel.useGenerics()) {
831
    if (!genModel.useGenerics()) {
831
    stringBuffer.append(TEXT_239);
832
    stringBuffer.append(TEXT_238);
832
    }
833
    }
833
    stringBuffer.append(TEXT_240);
834
    stringBuffer.append(TEXT_239);
834
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
835
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
836
    stringBuffer.append(TEXT_240);
837
    stringBuffer.append(_MapOfObjectToObject);
835
    stringBuffer.append(TEXT_241);
838
    stringBuffer.append(TEXT_241);
836
    if (genModel.useClassOverrideAnnotation()) {
839
    stringBuffer.append(_MapOfObjectToObject);
837
    stringBuffer.append(TEXT_242);
840
    stringBuffer.append(TEXT_242);
838
    }
841
    stringBuffer.append(_HashMapOfObjectToObject);
839
    stringBuffer.append(TEXT_243);
842
    stringBuffer.append(TEXT_243);
840
    if (genModel.useClassOverrideAnnotation()) {
843
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
841
    stringBuffer.append(TEXT_244);
844
    stringBuffer.append(TEXT_244);
842
    }
845
    if (genModel.useClassOverrideAnnotation()) {
843
    stringBuffer.append(TEXT_245);
846
    stringBuffer.append(TEXT_245);
844
    if (genModel.isRichClientPlatform()) {
847
    }
845
    stringBuffer.append(TEXT_246);
848
    stringBuffer.append(TEXT_246);
846
    stringBuffer.append(genPackage.getEditorClassName());
849
    if (genModel.useClassOverrideAnnotation()) {
847
    stringBuffer.append(TEXT_247);
850
    stringBuffer.append(TEXT_247);
848
    stringBuffer.append(genModel.getNonNLS());
851
    }
849
    stringBuffer.append(TEXT_248);
852
    stringBuffer.append(TEXT_248);
850
    stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName()));
853
    if (genModel.isRichClientPlatform()) {
851
    stringBuffer.append(TEXT_249);
854
    stringBuffer.append(TEXT_249);
852
    stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT"));
855
    stringBuffer.append(genPackage.getEditorClassName());
853
    stringBuffer.append(TEXT_250);
856
    stringBuffer.append(TEXT_250);
854
    stringBuffer.append(genModel.getNonNLS());
857
    stringBuffer.append(genModel.getNonNLS());
855
    stringBuffer.append(TEXT_251);
858
    stringBuffer.append(TEXT_251);
856
    stringBuffer.append(genModel.getNonNLS());
859
    stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName()));
857
    stringBuffer.append(TEXT_252);
860
    stringBuffer.append(TEXT_252);
858
    stringBuffer.append(genModel.getNonNLS());
861
    stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT"));
859
    stringBuffer.append(TEXT_253);
862
    stringBuffer.append(TEXT_253);
860
    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
863
    stringBuffer.append(genModel.getNonNLS());
861
    stringBuffer.append(TEXT_254);
864
    stringBuffer.append(TEXT_254);
862
    } else {
865
    stringBuffer.append(genModel.getNonNLS());
863
    stringBuffer.append(TEXT_255);
866
    stringBuffer.append(TEXT_255);
864
    }
867
    stringBuffer.append(genModel.getNonNLS());
865
    stringBuffer.append(TEXT_256);
868
    stringBuffer.append(TEXT_256);
866
    if (!genModel.useGenerics()) {
869
    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
867
    stringBuffer.append(TEXT_257);
870
    stringBuffer.append(TEXT_257);
868
    }
871
    } else {
869
    stringBuffer.append(TEXT_258);
872
    stringBuffer.append(TEXT_258);
870
    stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor"));
873
    }
871
    stringBuffer.append(TEXT_259);
874
    stringBuffer.append(TEXT_259);
872
    if (!genModel.isRichClientPlatform()) {
875
    if (!genModel.useGenerics()) {
873
    stringBuffer.append(TEXT_260);
876
    stringBuffer.append(TEXT_260);
874
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
875
    stringBuffer.append(TEXT_261);
876
    }
877
    }
878
    stringBuffer.append(TEXT_261);
879
    stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor"));
877
    stringBuffer.append(TEXT_262);
880
    stringBuffer.append(TEXT_262);
878
    if (genModel.useClassOverrideAnnotation()) {
881
    if (!genModel.isRichClientPlatform()) {
879
    stringBuffer.append(TEXT_263);
882
    stringBuffer.append(TEXT_263);
880
    }
883
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
881
    stringBuffer.append(TEXT_264);
884
    stringBuffer.append(TEXT_264);
882
    if (!genModel.isRichClientPlatform()) {
883
    stringBuffer.append(TEXT_265);
884
    }
885
    }
885
    stringBuffer.append(TEXT_266);
886
    stringBuffer.append(TEXT_265);
886
    if (genModel.useClassOverrideAnnotation()) {
887
    if (genModel.useClassOverrideAnnotation()) {
887
    stringBuffer.append(TEXT_267);
888
    stringBuffer.append(TEXT_266);
888
    }
889
    }
890
    stringBuffer.append(TEXT_267);
891
    if (!genModel.isRichClientPlatform()) {
889
    stringBuffer.append(TEXT_268);
892
    stringBuffer.append(TEXT_268);
890
    if (genPackage.isMultipleEditorPages()) {
893
    }
891
    stringBuffer.append(TEXT_269);
894
    stringBuffer.append(TEXT_269);
892
    } else {
895
    if (genModel.useClassOverrideAnnotation()) {
893
    stringBuffer.append(TEXT_270);
896
    stringBuffer.append(TEXT_270);
894
    }
897
    }
895
    stringBuffer.append(TEXT_271);
898
    stringBuffer.append(TEXT_271);
896
    if (genModel.useGenerics()) {
899
    if (genPackage.isMultipleEditorPages()) {
897
    stringBuffer.append(TEXT_272);
900
    stringBuffer.append(TEXT_272);
898
    } else {
901
    } else {
899
    stringBuffer.append(TEXT_273);
902
    stringBuffer.append(TEXT_273);
900
    }
903
    }
901
    stringBuffer.append(TEXT_274);
904
    stringBuffer.append(TEXT_274);
902
    if (!genModel.useGenerics()) {
905
    if (genModel.useGenerics()) {
903
    stringBuffer.append(TEXT_275);
906
    stringBuffer.append(TEXT_275);
904
    }
907
    } else {
905
    stringBuffer.append(TEXT_276);
908
    stringBuffer.append(TEXT_276);
906
    stringBuffer.append(_CollectionOfAnything);
909
    }
907
    stringBuffer.append(TEXT_277);
910
    stringBuffer.append(TEXT_277);
908
    stringBuffer.append(genModel.getNonNLS());
911
    if (!genModel.useGenerics()) {
909
    stringBuffer.append(TEXT_278);
912
    stringBuffer.append(TEXT_278);
910
    stringBuffer.append(genModel.getNonNLS());
913
    }
911
    stringBuffer.append(TEXT_279);
914
    stringBuffer.append(TEXT_279);
912
    stringBuffer.append(genModel.getNonNLS());
915
    stringBuffer.append(_CollectionOfAnything);
913
    stringBuffer.append(TEXT_280);
916
    stringBuffer.append(TEXT_280);
914
    stringBuffer.append(genModel.getNonNLS());
917
    stringBuffer.append(genModel.getNonNLS());
915
    stringBuffer.append(TEXT_281);
918
    stringBuffer.append(TEXT_281);
916
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
919
    stringBuffer.append(genModel.getNonNLS());
917
    stringBuffer.append(TEXT_282);
920
    stringBuffer.append(TEXT_282);
918
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
921
    stringBuffer.append(genModel.getNonNLS());
919
    stringBuffer.append(TEXT_283);
922
    stringBuffer.append(TEXT_283);
920
    if (genModel.useClassOverrideAnnotation()) {
923
    stringBuffer.append(genModel.getNonNLS());
921
    stringBuffer.append(TEXT_284);
924
    stringBuffer.append(TEXT_284);
922
    }
925
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
923
    stringBuffer.append(TEXT_285);
926
    stringBuffer.append(TEXT_285);
924
    if (!genModel.isRichClientPlatform()) {
927
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
925
    stringBuffer.append(TEXT_286);
928
    stringBuffer.append(TEXT_286);
926
    }
929
    if (genModel.useClassOverrideAnnotation()) {
927
    stringBuffer.append(TEXT_287);
930
    stringBuffer.append(TEXT_287);
928
    stringBuffer.append(genPackage.isMultipleEditorPages());
931
    }
929
    stringBuffer.append(TEXT_288);
932
    stringBuffer.append(TEXT_288);
930
    genModel.emitSortedImports();
933
    if (!genModel.isRichClientPlatform()) {
931
    stringBuffer.append(TEXT_289);
934
    stringBuffer.append(TEXT_289);
935
    }
936
    stringBuffer.append(TEXT_290);
937
    stringBuffer.append(genPackage.isMultipleEditorPages());
938
    stringBuffer.append(TEXT_291);
939
    genModel.emitSortedImports();
940
    stringBuffer.append(TEXT_292);
932
    return stringBuffer.toString();
941
    return stringBuffer.toString();
933
  }
942
  }
934
}
943
}
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/PluginXML.java (-6 / +15 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
19
  protected final String TEXT_2 = NL;
19
  protected final String TEXT_2 = NL;
20
  protected final String TEXT_3 = "<!--";
20
  protected final String TEXT_3 = "<!--";
Lines 91-99 Link Here
91
  protected final String TEXT_74 = "ModelFile.gif\"" + NL + "        extensions = \"";
91
  protected final String TEXT_74 = "ModelFile.gif\"" + NL + "        extensions = \"";
92
  protected final String TEXT_75 = "\"" + NL + "        class = \"";
92
  protected final String TEXT_75 = "\"" + NL + "        class = \"";
93
  protected final String TEXT_76 = "\" " + NL + "        contributorClass=\"";
93
  protected final String TEXT_76 = "\" " + NL + "        contributorClass=\"";
94
  protected final String TEXT_77 = "\" >" + NL + "    </editor>" + NL + "  </extension>    ";
94
  protected final String TEXT_77 = "\" >" + NL + "    </editor>" + NL + "  </extension>   " + NL + "  " + NL + "  <extension" + NL + "    point=\"org.eclipse.ui.preferencePages\">" + NL + "    <page" + NL + "      id=\"";
95
  protected final String TEXT_78 = NL + "</plugin>";
95
  protected final String TEXT_78 = "ID\"" + NL + "      class=\"";
96
  protected final String TEXT_79 = NL;
96
  protected final String TEXT_79 = "\"" + NL + "      name=\"%_UI_";
97
  protected final String TEXT_80 = "_label\" " + NL + "      category=\"org.eclipse.emf.edit.ui.XMIEditingPreferences\" >" + NL + "    </page>" + NL + "  </extension> ";
98
  protected final String TEXT_81 = NL + "</plugin>";
99
  protected final String TEXT_82 = NL;
97
100
98
  public String generate(Object argument)
101
  public String generate(Object argument)
99
  {
102
  {
Lines 281-290 Link Here
281
    stringBuffer.append(TEXT_76);
284
    stringBuffer.append(TEXT_76);
282
    stringBuffer.append(genPackage.getQualifiedActionBarContributorClassName());
285
    stringBuffer.append(genPackage.getQualifiedActionBarContributorClassName());
283
    stringBuffer.append(TEXT_77);
286
    stringBuffer.append(TEXT_77);
284
    }
287
    stringBuffer.append(genPackage.getQualifiedEditorPreferencePageClassName());
285
    }
286
    stringBuffer.append(TEXT_78);
288
    stringBuffer.append(TEXT_78);
289
    stringBuffer.append(genPackage.getQualifiedEditorPreferencePageClassName());
287
    stringBuffer.append(TEXT_79);
290
    stringBuffer.append(TEXT_79);
291
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
292
    stringBuffer.append(TEXT_80);
293
    }
294
    }
295
    stringBuffer.append(TEXT_81);
296
    stringBuffer.append(TEXT_82);
288
    return stringBuffer.toString();
297
    return stringBuffer.toString();
289
  }
298
  }
290
}
299
}
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/ActionBarContributor.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/ModelWizard.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/BuildProperties.java (-21 / +23 lines)
Lines 13-31 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "# ";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
18
  protected final String TEXT_2 = NL + "# ";
19
  protected final String TEXT_3 = NL + "#" + NL + "# ";
19
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
20
  protected final String TEXT_4 = "Id";
20
  protected final String TEXT_4 = NL + "#" + NL + "# ";
21
  protected final String TEXT_5 = NL + NL + "bin.includes = ";
21
  protected final String TEXT_5 = "Id";
22
  protected final String TEXT_6 = ",\\" + NL + "               icons/,\\";
22
  protected final String TEXT_6 = NL + NL + "bin.includes = ";
23
  protected final String TEXT_7 = NL + "               META-INF/,\\";
23
  protected final String TEXT_7 = ",\\" + NL + "               icons/,\\";
24
  protected final String TEXT_8 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
24
  protected final String TEXT_8 = NL + "               META-INF/,\\";
25
  protected final String TEXT_9 = NL + "source.";
25
  protected final String TEXT_9 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
26
  protected final String TEXT_10 = " = src/" + NL + "output.";
26
  protected final String TEXT_10 = NL + "source.";
27
  protected final String TEXT_11 = " = bin/";
27
  protected final String TEXT_11 = " = src/" + NL + "output.";
28
  protected final String TEXT_12 = NL;
28
  protected final String TEXT_12 = " = bin/";
29
  protected final String TEXT_13 = NL;
29
30
30
  public String generate(Object argument)
31
  public String generate(Object argument)
31
  {
32
  {
Lines 48-78 Link Here
48
49
49
    GenModel genModel = (GenModel)argument;
50
    GenModel genModel = (GenModel)argument;
50
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getEditorPluginID()+".jar" : ".";
51
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getEditorPluginID()+".jar" : ".";
52
    stringBuffer.append(TEXT_1);
51
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
53
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
52
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
54
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
53
    stringBuffer.append(TEXT_1);
55
    stringBuffer.append(TEXT_2);
54
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
56
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
55
    } else {
57
    } else {
56
    stringBuffer.append(TEXT_2);
57
    }}
58
    stringBuffer.append(TEXT_3);
58
    stringBuffer.append(TEXT_3);
59
    stringBuffer.append("$");
59
    }}
60
    stringBuffer.append(TEXT_4);
60
    stringBuffer.append(TEXT_4);
61
    stringBuffer.append("$");
61
    stringBuffer.append("$");
62
    stringBuffer.append(TEXT_5);
62
    stringBuffer.append(TEXT_5);
63
    stringBuffer.append(pluginClassesLocation);
63
    stringBuffer.append("$");
64
    stringBuffer.append(TEXT_6);
64
    stringBuffer.append(TEXT_6);
65
    if (genModel.isBundleManifest()) {
65
    stringBuffer.append(pluginClassesLocation);
66
    stringBuffer.append(TEXT_7);
66
    stringBuffer.append(TEXT_7);
67
    }
67
    if (genModel.isBundleManifest()) {
68
    stringBuffer.append(TEXT_8);
68
    stringBuffer.append(TEXT_8);
69
    stringBuffer.append(pluginClassesLocation);
69
    }
70
    stringBuffer.append(TEXT_9);
70
    stringBuffer.append(TEXT_9);
71
    stringBuffer.append(pluginClassesLocation);
71
    stringBuffer.append(pluginClassesLocation);
72
    stringBuffer.append(TEXT_10);
72
    stringBuffer.append(TEXT_10);
73
    stringBuffer.append(pluginClassesLocation);
73
    stringBuffer.append(pluginClassesLocation);
74
    stringBuffer.append(TEXT_11);
74
    stringBuffer.append(TEXT_11);
75
    stringBuffer.append(pluginClassesLocation);
75
    stringBuffer.append(TEXT_12);
76
    stringBuffer.append(TEXT_12);
77
    stringBuffer.append(TEXT_13);
76
    return stringBuffer.toString();
78
    return stringBuffer.toString();
77
  }
79
  }
78
}
80
}
(-)src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/edit/PluginProperties.java (-51 / +53 lines)
Lines 14-46 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "# ";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
19
  protected final String TEXT_2 = NL + "# ";
20
  protected final String TEXT_3 = NL + "#" + NL + "# ";
20
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
21
  protected final String TEXT_4 = "Id";
21
  protected final String TEXT_4 = NL + "#" + NL + "# ";
22
  protected final String TEXT_5 = 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 TEXT_5 = "Id";
23
  protected final String TEXT_6 = " Edit Support" + NL + "providerName = www.example.org" + NL;
23
  protected final String TEXT_6 = 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 = ";
24
  protected final String TEXT_7 = NL + "_UI_CreateChild_text = {0}" + NL + "_UI_CreateChild_text2 = {1} ";
24
  protected final String TEXT_7 = " Edit Support" + NL + "providerName = www.example.org" + NL;
25
  protected final String TEXT_8 = "| ";
25
  protected final String TEXT_8 = NL + "_UI_CreateChild_text = {0}" + NL + "_UI_CreateChild_text2 = {1} ";
26
  protected final String TEXT_9 = "{0}" + NL + "_UI_CreateChild_text3 = {1}" + NL + "_UI_CreateChild_tooltip = Create New {0} Under {1} Feature" + NL + "_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}." + NL + "_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent." + NL;
26
  protected final String TEXT_9 = "| ";
27
  protected final String TEXT_10 = NL + "_UI_PropertyDescriptor_description = The {0} of the {1}" + NL;
27
  protected final String TEXT_10 = "{0}" + NL + "_UI_CreateChild_text3 = {1}" + NL + "_UI_CreateChild_tooltip = Create New {0} Under {1} Feature" + NL + "_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}." + NL + "_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent." + NL;
28
  protected final String TEXT_11 = NL + "_UI_";
28
  protected final String TEXT_11 = NL + "_UI_PropertyDescriptor_description = The {0} of the {1}" + NL;
29
  protected final String TEXT_12 = "_type = ";
29
  protected final String TEXT_12 = NL + "_UI_";
30
  protected final String TEXT_13 = NL + "_UI_Unknown_type = Object" + NL + "" + NL + "_UI_Unknown_datatype= Value" + NL;
30
  protected final String TEXT_13 = "_type = ";
31
  protected final String TEXT_14 = NL + "_UI_";
31
  protected final String TEXT_14 = NL + "_UI_Unknown_type = Object" + NL + "" + NL + "_UI_Unknown_datatype= Value" + NL;
32
  protected final String TEXT_15 = "_";
32
  protected final String TEXT_15 = NL + "_UI_";
33
  protected final String TEXT_16 = "_feature = ";
33
  protected final String TEXT_16 = "_";
34
  protected final String TEXT_17 = NL + "_UI_";
34
  protected final String TEXT_17 = "_feature = ";
35
  protected final String TEXT_18 = "_";
35
  protected final String TEXT_18 = NL + "_UI_";
36
  protected final String TEXT_19 = "_description = ";
36
  protected final String TEXT_19 = "_";
37
  protected final String TEXT_20 = NL + "_UI_Unknown_feature = Unspecified" + NL;
37
  protected final String TEXT_20 = "_description = ";
38
  protected final String TEXT_21 = NL + "_UI_";
38
  protected final String TEXT_21 = NL + "_UI_Unknown_feature = Unspecified" + NL;
39
  protected final String TEXT_22 = "_";
39
  protected final String TEXT_22 = NL + "_UI_";
40
  protected final String TEXT_23 = "_literal = ";
40
  protected final String TEXT_23 = "_";
41
  protected final String TEXT_24 = NL;
41
  protected final String TEXT_24 = "_literal = ";
42
  protected final String TEXT_25 = " = ";
42
  protected final String TEXT_25 = NL;
43
  protected final String TEXT_26 = NL;
43
  protected final String TEXT_26 = " = ";
44
  protected final String TEXT_27 = NL;
44
45
45
  public String generate(Object argument)
46
  public String generate(Object argument)
46
  {
47
  {
Lines 62-138 Link Here
62
 */
63
 */
63
64
64
    GenModel genModel = (GenModel)argument; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
65
    GenModel genModel = (GenModel)argument; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
66
    stringBuffer.append(TEXT_1);
65
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
67
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
66
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
68
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
67
    stringBuffer.append(TEXT_1);
69
    stringBuffer.append(TEXT_2);
68
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
70
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
69
    } else {
71
    } else {
70
    stringBuffer.append(TEXT_2);
71
    }}
72
    stringBuffer.append(TEXT_3);
72
    stringBuffer.append(TEXT_3);
73
    stringBuffer.append("$");
73
    }}
74
    stringBuffer.append(TEXT_4);
74
    stringBuffer.append(TEXT_4);
75
    stringBuffer.append("$");
75
    stringBuffer.append("$");
76
    stringBuffer.append(TEXT_5);
76
    stringBuffer.append(TEXT_5);
77
    stringBuffer.append(genModel.getModelName());
77
    stringBuffer.append("$");
78
    stringBuffer.append(TEXT_6);
78
    stringBuffer.append(TEXT_6);
79
    if (genModel.isCreationCommands()) {
79
    stringBuffer.append(genModel.getModelName());
80
    stringBuffer.append(TEXT_7);
80
    stringBuffer.append(TEXT_7);
81
    if (genModel.isCreationSubmenus()) {
81
    if (genModel.isCreationCommands()) {
82
    stringBuffer.append(TEXT_8);
82
    stringBuffer.append(TEXT_8);
83
    }
83
    if (genModel.isCreationSubmenus()) {
84
    stringBuffer.append(TEXT_9);
84
    stringBuffer.append(TEXT_9);
85
    }
85
    }
86
    stringBuffer.append(TEXT_10);
86
    stringBuffer.append(TEXT_10);
87
    }
88
    stringBuffer.append(TEXT_11);
87
    for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {
89
    for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {
88
    if (genPackage.getGenModel() == genModel || !genPackage.getGenModel().hasEditSupport()) { 
90
    if (genPackage.getGenModel() == genModel || !genPackage.getGenModel().hasEditSupport()) { 
89
    for (GenClass genClass : genPackage.getGenClasses()) {
91
    for (GenClass genClass : genPackage.getGenClasses()) {
90
    stringBuffer.append(TEXT_11);
91
    stringBuffer.append(genClass.getName());
92
    stringBuffer.append(TEXT_12);
92
    stringBuffer.append(TEXT_12);
93
    stringBuffer.append(genClass.getName());
94
    stringBuffer.append(TEXT_13);
93
    stringBuffer.append(genClass.getFormattedName());
95
    stringBuffer.append(genClass.getFormattedName());
94
    }
96
    }
95
    }
97
    }
96
    }
98
    }
97
    stringBuffer.append(TEXT_13);
98
    for (GenFeature genFeature : genModel.getFilteredAllGenFeatures()) { String description = genFeature.getPropertyDescription();
99
    stringBuffer.append(TEXT_14);
99
    stringBuffer.append(TEXT_14);
100
    stringBuffer.append(genFeature.getGenClass().getName());
100
    for (GenFeature genFeature : genModel.getFilteredAllGenFeatures()) { String description = genFeature.getPropertyDescription();
101
    stringBuffer.append(TEXT_15);
101
    stringBuffer.append(TEXT_15);
102
    stringBuffer.append(genFeature.getName());
102
    stringBuffer.append(genFeature.getGenClass().getName());
103
    stringBuffer.append(TEXT_16);
103
    stringBuffer.append(TEXT_16);
104
    stringBuffer.append(genFeature.getName());
105
    stringBuffer.append(TEXT_17);
104
    stringBuffer.append(genFeature.getFormattedName());
106
    stringBuffer.append(genFeature.getFormattedName());
105
    if (description != null && description.length() > 0) {
107
    if (description != null && description.length() > 0) {
106
    stringBuffer.append(TEXT_17);
107
    stringBuffer.append(genFeature.getGenClass().getName());
108
    stringBuffer.append(TEXT_18);
108
    stringBuffer.append(TEXT_18);
109
    stringBuffer.append(genFeature.getName());
109
    stringBuffer.append(genFeature.getGenClass().getName());
110
    stringBuffer.append(TEXT_19);
110
    stringBuffer.append(TEXT_19);
111
    stringBuffer.append(genFeature.getName());
112
    stringBuffer.append(TEXT_20);
111
    stringBuffer.append(description);
113
    stringBuffer.append(description);
112
    }
114
    }
113
    }
115
    }
114
    stringBuffer.append(TEXT_20);
116
    stringBuffer.append(TEXT_21);
115
    for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {
117
    for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {
116
    if (genPackage.getGenModel() == genModel || !genPackage.getGenModel().hasEditSupport()) {
118
    if (genPackage.getGenModel() == genModel || !genPackage.getGenModel().hasEditSupport()) {
117
    for (GenEnum genEnum : genPackage.getGenEnums()) {
119
    for (GenEnum genEnum : genPackage.getGenEnums()) {
118
    for (GenEnumLiteral genEnumLiteral : genEnum.getGenEnumLiterals()) {
120
    for (GenEnumLiteral genEnumLiteral : genEnum.getGenEnumLiterals()) {
119
    stringBuffer.append(TEXT_21);
120
    stringBuffer.append(genEnum.getName());
121
    stringBuffer.append(TEXT_22);
121
    stringBuffer.append(TEXT_22);
122
    stringBuffer.append(genEnumLiteral.getName());
122
    stringBuffer.append(genEnum.getName());
123
    stringBuffer.append(TEXT_23);
123
    stringBuffer.append(TEXT_23);
124
    stringBuffer.append(genEnumLiteral.getName());
125
    stringBuffer.append(TEXT_24);
124
    stringBuffer.append(genEnumLiteral.getLiteral());
126
    stringBuffer.append(genEnumLiteral.getLiteral());
125
    }
127
    }
126
    }
128
    }
127
    }
129
    }
128
    }
130
    }
129
    for (String category : genModel.getPropertyCategories()) {
131
    for (String category : genModel.getPropertyCategories()) {
130
    stringBuffer.append(TEXT_24);
131
    stringBuffer.append(genModel.getPropertyCategoryKey(category));
132
    stringBuffer.append(TEXT_25);
132
    stringBuffer.append(TEXT_25);
133
    stringBuffer.append(genModel.getPropertyCategoryKey(category));
134
    stringBuffer.append(TEXT_26);
133
    stringBuffer.append(category);
135
    stringBuffer.append(category);
134
    }
136
    }
135
    stringBuffer.append(TEXT_26);
137
    stringBuffer.append(TEXT_27);
136
    return stringBuffer.toString();
138
    return stringBuffer.toString();
137
  }
139
  }
138
}
140
}
(-)src/org/eclipse/emf/codegen/ecore/templates/edit/ManifestMF.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
20
  protected final String TEXT_3 = ".jar";
20
  protected final String TEXT_3 = ".jar";
(-)templates/editor/plugin.propertiesjet (+7 lines)
Lines 78-83 Link Here
78
_UI_<%=genPackage.getEditorClassName()%>FilenameDefaultBase = My
78
_UI_<%=genPackage.getEditorClassName()%>FilenameDefaultBase = My
79
_UI_<%=genPackage.getEditorClassName()%>FilenameExtension = <%=genPackage.getPrefix().toLowerCase()%>
79
_UI_<%=genPackage.getEditorClassName()%>FilenameExtension = <%=genPackage.getPrefix().toLowerCase()%>
80
80
81
_UI_<%=genPackage.getEditorPreferencePageClassName()%>_label = <%=genPackage.getPrefix()%> Editor Preferences
82
_UI_<%=genPackage.getEditorPreferencePageClassName()%>_description = <%=genPackage.getPrefix()%> Editor XML saving preferences.
83
_UI_<%=genPackage.getEditorPreferencePageClassName()%>TypeInformation_label = Save type information
84
_UI_<%=genPackage.getEditorPreferencePageClassName()%>SaveDoctype_label = Save doctype declaration
85
_UI_<%=genPackage.getEditorPreferencePageClassName()%>Formatted_label = Output formatted XML
86
_UI_<%=genPackage.getEditorPreferencePageClassName()%>LineWidth_label = XML file line width
87
81
<%}%>
88
<%}%>
82
_UI_Wizard_label = New
89
_UI_Wizard_label = New
83
90
(-)templates/editor/Editor.javajet (-1 / +41 lines)
Lines 76-81 Link Here
76
import org.eclipse.jface.dialogs.MessageDialog;
76
import org.eclipse.jface.dialogs.MessageDialog;
77
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
77
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
78
78
79
import org.eclipse.jface.preference.IPreferenceStore;
80
79
<%if (genPackage.isMultipleEditorPages()) {%>
81
<%if (genPackage.isMultipleEditorPages()) {%>
80
import org.eclipse.jface.viewers.ColumnWeightData;
82
import org.eclipse.jface.viewers.ColumnWeightData;
81
<%}%>
83
<%}%>
Lines 133-138 Link Here
133
import org.eclipse.ui.IPartListener;
135
import org.eclipse.ui.IPartListener;
134
import org.eclipse.ui.IWorkbenchPart;
136
import org.eclipse.ui.IWorkbenchPart;
135
import org.eclipse.ui.PartInitException;
137
import org.eclipse.ui.PartInitException;
138
import org.eclipse.ui.PlatformUI;
136
<%if (!genModel.isRichClientPlatform()) {%>
139
<%if (!genModel.isRichClientPlatform()) {%>
137
140
138
import org.eclipse.ui.dialogs.SaveAsDialog;
141
import org.eclipse.ui.dialogs.SaveAsDialog;
Lines 189-194 Link Here
189
import org.eclipse.emf.ecore.util.EContentAdapter;
192
import org.eclipse.emf.ecore.util.EContentAdapter;
190
import org.eclipse.emf.ecore.util.EcoreUtil;
193
import org.eclipse.emf.ecore.util.EcoreUtil;
191
194
195
import org.eclipse.emf.ecore.xmi.XMLResource;
196
192
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
197
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
193
import org.eclipse.emf.edit.domain.EditingDomain;
198
import org.eclipse.emf.edit.domain.EditingDomain;
194
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
199
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
Lines 1845-1852 Link Here
1845
	{
1850
	{
1846
		// Save only resources that have actually changed.
1851
		// Save only resources that have actually changed.
1847
		//
1852
		//
1848
		final <%=_MapOfObjectToObject%> saveOptions = new <%=_HashMapOfObjectToObject%>();
1853
		final <%=_MapOfObjectToObject%> saveOptions = getPreferences();
1849
		saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
1854
		saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
1855
		;
1850
1856
1851
		// Do the work within an operation because this is a long running activity that modifies the workbench.
1857
		// Do the work within an operation because this is a long running activity that modifies the workbench.
1852
		//
1858
		//
Lines 1912-1917 Link Here
1912
	}
1918
	}
1913
1919
1914
	/**
1920
	/**
1921
	 * Determine save options from properties and set them in map. Options already set in map will
1922
	 * be overwritten it they are specified in preferences.
1923
	 * <!-- begin-user-doc -->
1924
	 * <!-- end-user-doc -->
1925
	 * @generated
1926
	 */
1927
	private <%=_MapOfObjectToObject%> getPreferences() {
1928
		<%=_MapOfObjectToObject%> options = new <%=_HashMapOfObjectToObject%>();
1929
		IPreferenceStore defaultsStore = PlatformUI.getPreferenceStore();
1930
		IPreferenceStore store = <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getPreferenceStore();
1931
				
1932
		String key = XMLResource.OPTION_SAVE_TYPE_INFORMATION;
1933
		options.put(key, getStore(store, defaultsStore, key).getBoolean(key));
1934
				
1935
		key = XMLResource.OPTION_SAVE_DOCTYPE;
1936
		options.put(key, getStore(store, defaultsStore, key).getBoolean(key));
1937
				
1938
		key = XMLResource.OPTION_FORMATTED;
1939
		options.put(key, getStore(store, defaultsStore, key).getBoolean(key));
1940
		
1941
		key = XMLResource.OPTION_LINE_WIDTH;
1942
		options.put(key, getStore(store, defaultsStore, key).getInt(key));
1943
		
1944
		return options;
1945
	}
1946
				
1947
	/**
1948
	 * Returns first store that contains given key
1949
	 */
1950
	private IPreferenceStore getStore(IPreferenceStore primary, IPreferenceStore secondary, String key) {
1951
		return (primary.contains(key)) ? primary : secondary;
1952
	}
1953
1954
	/**
1915
	 * This returns wether something has been persisted to the URI of the specified resource.
1955
	 * This returns wether something has been persisted to the URI of the specified resource.
1916
	 * The implementation uses the URI converter from the editor's resource set to try to open an input stream. 
1956
	 * The implementation uses the URI converter from the editor's resource set to try to open an input stream. 
1917
	 * <!-- begin-user-doc -->
1957
	 * <!-- begin-user-doc -->
(-)templates/editor/plugin.xmljet (-1 / +11 lines)
Lines 205-211 Link Here
205
        class = "<%=genPackage.getQualifiedEditorClassName()%>" 
205
        class = "<%=genPackage.getQualifiedEditorClassName()%>" 
206
        contributorClass="<%=genPackage.getQualifiedActionBarContributorClassName()%>" >
206
        contributorClass="<%=genPackage.getQualifiedActionBarContributorClassName()%>" >
207
    </editor>
207
    </editor>
208
  </extension>    
208
  </extension>   
209
  
210
  <extension
211
    point="org.eclipse.ui.preferencePages">
212
    <page
213
      id="<%=genPackage.getQualifiedEditorPreferencePageClassName()%>ID"
214
      class="<%=genPackage.getQualifiedEditorPreferencePageClassName()%>"
215
      name="%_UI_<%=genPackage.getEditorPreferencePageClassName()%>_label" 
216
      category="org.eclipse.emf.edit.ui.XMIEditingPreferences" >
217
    </page>
218
  </extension> 
209
  <%}%>
219
  <%}%>
210
<%}%>
220
<%}%>
211
</plugin>
221
</plugin>
(-)src/org/eclipse/emf/codegen/ecore/templates/model/EnumClass.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/ManifestMF.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
18
  protected final String TEXT_1 = "Manifest-Version: 1.0" + NL + "Bundle-ManifestVersion: 2" + NL + "Bundle-Name: %pluginName" + NL + "Bundle-SymbolicName: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
19
  protected final String TEXT_2 = "; singleton:=true" + NL + "Bundle-Version: 1.0.0" + NL + "Bundle-ClassPath: ";
20
  protected final String TEXT_3 = ".jar";
20
  protected final String TEXT_3 = ".jar";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/SwitchClass.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/PackageClass.java (-1 / +1 lines)
Lines 17-23 Link Here
17
    return result;
17
    return result;
18
  }
18
  }
19
19
20
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
20
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
21
  protected final String TEXT_1 = "";
21
  protected final String TEXT_1 = "";
22
  protected final String TEXT_2 = "/**";
22
  protected final String TEXT_2 = "/**";
23
  protected final String TEXT_3 = NL + " * ";
23
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/ResourceClass.java (-1 / +1 lines)
Lines 17-23 Link Here
17
    return result;
17
    return result;
18
  }
18
  }
19
19
20
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
20
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
21
  protected final String TEXT_1 = "";
21
  protected final String TEXT_1 = "";
22
  protected final String TEXT_2 = "/**";
22
  protected final String TEXT_2 = "/**";
23
  protected final String TEXT_3 = NL + " * ";
23
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/Class.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/XMLProcessorClass.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/ValidatorClass.java (-1 / +1 lines)
Lines 15-21 Link Here
15
    return result;
15
    return result;
16
  }
16
  }
17
17
18
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
19
  protected final String TEXT_1 = "";
19
  protected final String TEXT_1 = "";
20
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_2 = "/**";
21
  protected final String TEXT_3 = NL + " * ";
21
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/ResourceFactoryClass.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/BuildProperties.java (-23 / +25 lines)
Lines 13-32 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "# ";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
18
  protected final String TEXT_2 = NL + "# ";
19
  protected final String TEXT_3 = NL + "#" + NL + "# ";
19
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
20
  protected final String TEXT_4 = "Id";
20
  protected final String TEXT_4 = NL + "#" + NL + "# ";
21
  protected final String TEXT_5 = NL + NL + "bin.includes = ";
21
  protected final String TEXT_5 = "Id";
22
  protected final String TEXT_6 = ",\\" + NL + "               model/,\\";
22
  protected final String TEXT_6 = NL + NL + "bin.includes = ";
23
  protected final String TEXT_7 = NL + "               icons/,\\";
23
  protected final String TEXT_7 = ",\\" + NL + "               model/,\\";
24
  protected final String TEXT_8 = NL + "               META-INF/,\\";
24
  protected final String TEXT_8 = NL + "               icons/,\\";
25
  protected final String TEXT_9 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
25
  protected final String TEXT_9 = NL + "               META-INF/,\\";
26
  protected final String TEXT_10 = NL + "source.";
26
  protected final String TEXT_10 = NL + "               plugin.xml,\\" + NL + "               plugin.properties" + NL + "jars.compile.order = ";
27
  protected final String TEXT_11 = " = src/" + NL + "output.";
27
  protected final String TEXT_11 = NL + "source.";
28
  protected final String TEXT_12 = " = bin/";
28
  protected final String TEXT_12 = " = src/" + NL + "output.";
29
  protected final String TEXT_13 = NL;
29
  protected final String TEXT_13 = " = bin/";
30
  protected final String TEXT_14 = NL;
30
31
31
  public String generate(Object argument)
32
  public String generate(Object argument)
32
  {
33
  {
Lines 49-82 Link Here
49
50
50
    GenModel genModel = (GenModel)argument;
51
    GenModel genModel = (GenModel)argument;
51
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getModelPluginID()+".jar" : ".";
52
    String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getModelPluginID()+".jar" : ".";
53
    stringBuffer.append(TEXT_1);
52
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
54
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
53
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
55
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
54
    stringBuffer.append(TEXT_1);
56
    stringBuffer.append(TEXT_2);
55
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
57
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
56
    } else {
58
    } else {
57
    stringBuffer.append(TEXT_2);
58
    }}
59
    stringBuffer.append(TEXT_3);
59
    stringBuffer.append(TEXT_3);
60
    stringBuffer.append("$");
60
    }}
61
    stringBuffer.append(TEXT_4);
61
    stringBuffer.append(TEXT_4);
62
    stringBuffer.append("$");
62
    stringBuffer.append("$");
63
    stringBuffer.append(TEXT_5);
63
    stringBuffer.append(TEXT_5);
64
    stringBuffer.append(pluginClassesLocation);
64
    stringBuffer.append("$");
65
    stringBuffer.append(TEXT_6);
65
    stringBuffer.append(TEXT_6);
66
    if (genModel.sameModelEditProject() || genModel.sameModelEditorProject()) {
66
    stringBuffer.append(pluginClassesLocation);
67
    stringBuffer.append(TEXT_7);
67
    stringBuffer.append(TEXT_7);
68
    }
68
    if (genModel.sameModelEditProject() || genModel.sameModelEditorProject()) {
69
    if (genModel.isBundleManifest()) {
70
    stringBuffer.append(TEXT_8);
69
    stringBuffer.append(TEXT_8);
71
    }
70
    }
71
    if (genModel.isBundleManifest()) {
72
    stringBuffer.append(TEXT_9);
72
    stringBuffer.append(TEXT_9);
73
    stringBuffer.append(pluginClassesLocation);
73
    }
74
    stringBuffer.append(TEXT_10);
74
    stringBuffer.append(TEXT_10);
75
    stringBuffer.append(pluginClassesLocation);
75
    stringBuffer.append(pluginClassesLocation);
76
    stringBuffer.append(TEXT_11);
76
    stringBuffer.append(TEXT_11);
77
    stringBuffer.append(pluginClassesLocation);
77
    stringBuffer.append(pluginClassesLocation);
78
    stringBuffer.append(TEXT_12);
78
    stringBuffer.append(TEXT_12);
79
    stringBuffer.append(pluginClassesLocation);
79
    stringBuffer.append(TEXT_13);
80
    stringBuffer.append(TEXT_13);
81
    stringBuffer.append(TEXT_14);
80
    return stringBuffer.toString();
82
    return stringBuffer.toString();
81
  }
83
  }
82
}
84
}
(-)src/org/eclipse/emf/codegen/ecore/templates/model/AdapterFactoryClass.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/Plugin.java (-1 / +1 lines)
Lines 13-19 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = "/**";
18
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_3 = NL + " * ";
19
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/FactoryClass.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
20
  protected final String TEXT_3 = NL + " * ";
(-)src/org/eclipse/emf/codegen/ecore/templates/model/PluginProperties.java (-13 / +15 lines)
Lines 13-26 Link Here
13
    return result;
13
    return result;
14
  }
14
  }
15
15
16
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "# ";
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL + "# <copyright>" + NL + "# </copyright>";
18
  protected final String TEXT_2 = NL + "# ";
19
  protected final String TEXT_3 = NL + "#" + NL + "# ";
19
  protected final String TEXT_3 = NL + "# <copyright>" + NL + "# </copyright>";
20
  protected final String TEXT_4 = "Id";
20
  protected final String TEXT_4 = NL + "#" + NL + "# ";
21
  protected final String TEXT_5 = 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 = ";
21
  protected final String TEXT_5 = "Id";
22
  protected final String TEXT_6 = " Model" + NL + "providerName = www.example.org";
22
  protected final String TEXT_6 = 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 = ";
23
  protected final String TEXT_7 = NL;
23
  protected final String TEXT_7 = " Model" + NL + "providerName = www.example.org";
24
  protected final String TEXT_8 = NL;
24
25
25
  public String generate(Object argument)
26
  public String generate(Object argument)
26
  {
27
  {
Lines 42-62 Link Here
42
 */
43
 */
43
44
44
    GenModel genModel = (GenModel)argument;
45
    GenModel genModel = (GenModel)argument;
46
    stringBuffer.append(TEXT_1);
45
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
47
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
46
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
48
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
47
    stringBuffer.append(TEXT_1);
49
    stringBuffer.append(TEXT_2);
48
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
50
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
49
    } else {
51
    } else {
50
    stringBuffer.append(TEXT_2);
51
    }}
52
    stringBuffer.append(TEXT_3);
52
    stringBuffer.append(TEXT_3);
53
    stringBuffer.append("$");
53
    }}
54
    stringBuffer.append(TEXT_4);
54
    stringBuffer.append(TEXT_4);
55
    stringBuffer.append("$");
55
    stringBuffer.append("$");
56
    stringBuffer.append(TEXT_5);
56
    stringBuffer.append(TEXT_5);
57
    stringBuffer.append(genModel.getModelName());
57
    stringBuffer.append("$");
58
    stringBuffer.append(TEXT_6);
58
    stringBuffer.append(TEXT_6);
59
    stringBuffer.append(genModel.getModelName());
59
    stringBuffer.append(TEXT_7);
60
    stringBuffer.append(TEXT_7);
61
    stringBuffer.append(TEXT_8);
60
    return stringBuffer.toString();
62
    return stringBuffer.toString();
61
  }
63
  }
62
}
64
}
(-)src/org/eclipse/emf/codegen/ecore/templates/model/PluginXML.java (-1 / +1 lines)
Lines 14-20 Link Here
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
18
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<?eclipse version=\"3.0\"?>" + NL;
19
  protected final String TEXT_2 = NL;
19
  protected final String TEXT_2 = NL;
20
  protected final String TEXT_3 = "<!--";
20
  protected final String TEXT_3 = "<!--";
(-)src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenPackageImpl.java (+10 lines)
Lines 3181-3186 Link Here
3181
  {
3181
  {
3182
    return getGenModel().getImportedName(getQualifiedActionBarContributorClassName());
3182
    return getGenModel().getImportedName(getQualifiedActionBarContributorClassName());
3183
  }
3183
  }
3184
  
3185
  public String getEditorPreferencePageClassName()
3186
  {
3187
	return getPrefixedName("PreferencesPage");
3188
  }
3189
  
3190
  public String getQualifiedEditorPreferencePageClassName()
3191
  {
3192
	  return getPresentationPackageName() + "." + getEditorPreferencePageClassName();
3193
  }
3184
3194
3185
  public String getAdapterFactoryDelegateName(GenPackage genDelegate)
3195
  public String getAdapterFactoryDelegateName(GenPackage genDelegate)
3186
  {
3196
  {
(-)src/org/eclipse/emf/codegen/ecore/genmodel/generator/GenPackageGeneratorAdapter.java (-2 / +26 lines)
Lines 73-79 Link Here
73
  protected static final int ACTION_BAR_CONTRIBUTOR_ID = 11;
73
  protected static final int ACTION_BAR_CONTRIBUTOR_ID = 11;
74
  protected static final int PACKAGE_TEST_SUITE_ID = 12;
74
  protected static final int PACKAGE_TEST_SUITE_ID = 12;
75
  protected static final int PACKAGE_EXAMPLE_ID = 13;
75
  protected static final int PACKAGE_EXAMPLE_ID = 13;
76
76
  protected static final int EDITOR_PREFERENCES_ID = 14;
77
  
77
  private static final JETEmitterDescriptor[] JET_EMITTER_DESCRIPTORS =
78
  private static final JETEmitterDescriptor[] JET_EMITTER_DESCRIPTORS =
78
  {
79
  {
79
    new JETEmitterDescriptor("model/PackageClass.javajet", "org.eclipse.emf.codegen.ecore.templates.model.PackageClass"),
80
    new JETEmitterDescriptor("model/PackageClass.javajet", "org.eclipse.emf.codegen.ecore.templates.model.PackageClass"),
Lines 89-95 Link Here
89
    new JETEmitterDescriptor("editor/ModelWizard.javajet", "org.eclipse.emf.codegen.ecore.templates.editor.ModelWizard"),
90
    new JETEmitterDescriptor("editor/ModelWizard.javajet", "org.eclipse.emf.codegen.ecore.templates.editor.ModelWizard"),
90
    new JETEmitterDescriptor("editor/ActionBarContributor.javajet", "org.eclipse.emf.codegen.ecore.templates.editor.ActionBarContributor"),
91
    new JETEmitterDescriptor("editor/ActionBarContributor.javajet", "org.eclipse.emf.codegen.ecore.templates.editor.ActionBarContributor"),
91
    new JETEmitterDescriptor("model.tests/PackageTestSuite.javajet", "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageTestSuite"),
92
    new JETEmitterDescriptor("model.tests/PackageTestSuite.javajet", "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageTestSuite"),
92
    new JETEmitterDescriptor("model.tests/PackageExample.javajet", "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageExample")
93
    new JETEmitterDescriptor("model.tests/PackageExample.javajet", "org.eclipse.emf.codegen.ecore.templates.model.tests.PackageExample"),
94
    new JETEmitterDescriptor("editor/EditorPreferencesPage.javajet", "org.eclipse.emf.codegen.ecore.templates.editor.EditorPreferencesPage")
93
  };
95
  };
94
96
95
  /**
97
  /**
Lines 644-649 Link Here
644
    generateActionBarContributor(genPackage, monitor);
646
    generateActionBarContributor(genPackage, monitor);
645
    generateModelIcon(genPackage, monitor);
647
    generateModelIcon(genPackage, monitor);
646
    generateModelWizardIcon(genPackage, monitor);
648
    generateModelWizardIcon(genPackage, monitor);
649
    generateEditorPreferencesPage(genPackage, monitor);
647
650
648
    return Diagnostic.OK_INSTANCE;
651
    return Diagnostic.OK_INSTANCE;
649
  }
652
  }
Lines 668-673 Link Here
668
      monitor.worked(1);
671
      monitor.worked(1);
669
    }
672
    }
670
  }
673
  }
674
  
675
  protected void generateEditorPreferencesPage(GenPackage genPackage, Monitor monitor)
676
  {
677
    if (genPackage.hasConcreteClasses())
678
    {
679
      message = CodeGenEcorePlugin.INSTANCE.getString
680
        ("_UI_GeneratingJavaClass_message", new Object[] { genPackage.getQualifiedEditorPreferencePageClassName() });
681
      monitor.subTask(message);
682
      generateJava
683
        (genPackage.getGenModel().getEditorDirectory(),
684
         genPackage.getPresentationPackageName(),
685
         genPackage.getEditorPreferencePageClassName(),
686
         getJETEmitter(getJETEmitterDescriptors(), EDITOR_PREFERENCES_ID),
687
         null,
688
         createMonitor(monitor, 1)); 
689
    }
690
    else
691
    {
692
      monitor.worked(1);
693
    }
694
  }
671
695
672
  protected void generateModelWizard(GenPackage genPackage, Monitor monitor)
696
  protected void generateModelWizard(GenPackage genPackage, Monitor monitor)
673
  {
697
  {
(-)src/org/eclipse/emf/codegen/ecore/genmodel/GenPackage.java (+2 lines)
Lines 832-837 Link Here
832
  String getActionBarContributorClassName();
832
  String getActionBarContributorClassName();
833
  String getQualifiedActionBarContributorClassName();
833
  String getQualifiedActionBarContributorClassName();
834
  String getImportedActionBarContributorClassName();
834
  String getImportedActionBarContributorClassName();
835
  String getEditorPreferencePageClassName();
836
  String getQualifiedEditorPreferencePageClassName();
835
837
836
  String getAdapterFactoryDelegateName(GenPackage genDelegate);
838
  String getAdapterFactoryDelegateName(GenPackage genDelegate);
837
  String getUncapAdapterFactoryDelegateName(GenPackage genDelegate);
839
  String getUncapAdapterFactoryDelegateName(GenPackage genDelegate);
(-)src/org/eclipse/emf/codegen/ecore/templates/editor/EditorPreferencesPage.java (+139 lines)
Added Link Here
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 EditorPreferencesPage
7
{
8
  protected static String nl;
9
  public static synchronized EditorPreferencesPage create(String lineSeparator)
10
  {
11
    nl = lineSeparator;
12
    EditorPreferencesPage result = new EditorPreferencesPage();
13
    nl = null;
14
    return result;
15
  }
16
17
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = "";
19
  protected final String TEXT_2 = "/**";
20
  protected final String TEXT_3 = NL + " * ";
21
  protected final String TEXT_4 = NL + " * <copyright>" + NL + " * </copyright>";
22
  protected final String TEXT_5 = NL + " *" + NL + " * ";
23
  protected final String TEXT_6 = "Id";
24
  protected final String TEXT_7 = NL + " */" + NL + "package ";
25
  protected final String TEXT_8 = ";" + NL + "" + NL + "import org.eclipse.emf.edit.ui.preferences.GenericEditPreferencePage;" + NL + "" + NL + "/**" + NL + " * This is an example of a ";
26
  protected final String TEXT_9 = " model editor preferences." + NL + " * <!-- begin-user-doc -->" + NL + " * <!-- end-user-doc -->" + NL + " * @generated" + NL + " */" + NL + "public class ";
27
  protected final String TEXT_10 = " extends GenericEditPreferencePage {";
28
  protected final String TEXT_11 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
29
  protected final String TEXT_12 = " copyright = \"";
30
  protected final String TEXT_13 = "\";";
31
  protected final String TEXT_14 = NL;
32
  protected final String TEXT_15 = NL + "    /**" + NL + "\t * Create the instance." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
33
  protected final String TEXT_16 = "() {" + NL + "\t\tsuper();" + NL + "\t\tsetDescription(";
34
  protected final String TEXT_17 = ".INSTANCE.getString(\"_UI_";
35
  protected final String TEXT_18 = "_description\"));" + NL + "\t\tsetPreferenceStore(";
36
  protected final String TEXT_19 = ".getPlugin().getPreferenceStore());" + NL + "\t}" + NL + "" + NL + "    /**" + NL + "\t * Create the preference page contents." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */\t" + NL + "\t@Override" + NL + "\tprotected void createFieldEditors() {" + NL + "\t\taddSaveTypeInformationField(";
37
  protected final String TEXT_20 = ".INSTANCE.getString(\"_UI_";
38
  protected final String TEXT_21 = "TypeInformation_label\"));" + NL + "\t\taddSaveDoctypeField(";
39
  protected final String TEXT_22 = ".INSTANCE.getString(\"_UI_";
40
  protected final String TEXT_23 = "SaveDoctype_label\"));" + NL + "\t\taddFormattedField(";
41
  protected final String TEXT_24 = ".INSTANCE.getString(\"_UI_";
42
  protected final String TEXT_25 = "Formatted_label\"));" + NL + "\t\taddLineWidthField(";
43
  protected final String TEXT_26 = ".INSTANCE.getString(\"_UI_";
44
  protected final String TEXT_27 = "LineWidth_label\"));" + NL + "\t}" + NL + "}";
45
  protected final String TEXT_28 = NL;
46
47
  public String generate(Object argument)
48
  {
49
    final StringBuffer stringBuffer = new StringBuffer();
50
    
51
/**
52
 * <copyright>
53
 *
54
 * Copyright (c) 2002-2007 IBM Corporation and others.
55
 * All rights reserved.   This program and the accompanying materials
56
 * are made available under the terms of the Eclipse Public License v1.0
57
 * which accompanies this distribution, and is available at
58
 * http://www.eclipse.org/legal/epl-v10.html
59
 *
60
 * Contributors:
61
 *   IBM - Initial API and implementation
62
 *
63
 * </copyright>
64
 */
65
66
    GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();
67
String importedOperationClassName = genModel.getImportedName(genModel.isRichClientPlatform() ? "org.eclipse.jface.operation.IRunnableWithProgress" : "org.eclipse.ui.actions.WorkspaceModifyOperation");
68
String operationMethodName = genModel.isRichClientPlatform() ? "run" : "execute"; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
69
70
    String _ArrayListOfObject = "ArrayList" + (genModel.useGenerics() ? "<Object>" : "");
71
    String _ArrayListOfAdapterFactory = "ArrayList" + (genModel.useGenerics() ? "<AdapterFactory>" : "");
72
    String _ListOfAdapterFactory = "List" + (genModel.useGenerics() ? "<AdapterFactory>" : "");
73
    String _ArrayListOfSelectionChangedListener = "ArrayList" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");
74
    String _CollectionOfSelectionChangedListener = "Collection" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");
75
    String _ArrayListOfResource = "ArrayList" + (genModel.useGenerics() ? "<Resource>" : "");
76
    String _CollectionOfResource = "Collection" + (genModel.useGenerics() ? "<Resource>" : "");
77
    String _MapOfResourceToDiagnostic = "Map" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");
78
    String _HashMapOfResourceToBoolean = "HashMap" + (genModel.useGenerics() ? "<Resource, Boolean>" : "");
79
    String _LinkedHashMapOfResourceToDiagnostic = "LinkedHashMap" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");
80
    String _CollectionOfAnything = "Collection" + (genModel.useGenerics() ? "<?>" : "");
81
    String _ListOfAnything = "List" + (genModel.useGenerics() ? "<?>" : "");
82
    stringBuffer.append(TEXT_1);
83
    stringBuffer.append(TEXT_2);
84
    {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
85
    if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
86
    stringBuffer.append(TEXT_3);
87
    stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
88
    } else {
89
    stringBuffer.append(TEXT_4);
90
    }}
91
    stringBuffer.append(TEXT_5);
92
    stringBuffer.append("$");
93
    stringBuffer.append(TEXT_6);
94
    stringBuffer.append("$");
95
    stringBuffer.append(TEXT_7);
96
    stringBuffer.append(genPackage.getPresentationPackageName());
97
    stringBuffer.append(TEXT_8);
98
    stringBuffer.append(genPackage.getPrefix());
99
    stringBuffer.append(TEXT_9);
100
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
101
    stringBuffer.append(TEXT_10);
102
    if (genModel.getCopyrightText() != null) {
103
    stringBuffer.append(TEXT_11);
104
    stringBuffer.append(genModel.getImportedName("java.lang.String"));
105
    stringBuffer.append(TEXT_12);
106
    stringBuffer.append(genModel.getCopyrightText());
107
    stringBuffer.append(TEXT_13);
108
    stringBuffer.append(genModel.getNonNLS());
109
    stringBuffer.append(TEXT_14);
110
    }
111
    stringBuffer.append(TEXT_15);
112
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
113
    stringBuffer.append(TEXT_16);
114
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
115
    stringBuffer.append(TEXT_17);
116
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
117
    stringBuffer.append(TEXT_18);
118
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
119
    stringBuffer.append(TEXT_19);
120
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
121
    stringBuffer.append(TEXT_20);
122
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
123
    stringBuffer.append(TEXT_21);
124
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
125
    stringBuffer.append(TEXT_22);
126
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
127
    stringBuffer.append(TEXT_23);
128
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
129
    stringBuffer.append(TEXT_24);
130
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
131
    stringBuffer.append(TEXT_25);
132
    stringBuffer.append(genPackage.getImportedEditorPluginClassName());
133
    stringBuffer.append(TEXT_26);
134
    stringBuffer.append(genPackage.getEditorPreferencePageClassName());
135
    stringBuffer.append(TEXT_27);
136
    stringBuffer.append(TEXT_28);
137
    return stringBuffer.toString();
138
  }
139
}
(-)templates/editor/EditorPreferencesPage.javajet (+80 lines)
Added Link Here
1
<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="EditorPreferencesPage" version="" %>
2
<%
3
/**
4
 * <copyright>
5
 *
6
 * Copyright (c) 2002-2007 IBM Corporation and others.
7
 * All rights reserved.   This program and the accompanying materials
8
 * are made available under the terms of the Eclipse Public License v1.0
9
 * which accompanies this distribution, and is available at
10
 * http://www.eclipse.org/legal/epl-v10.html
11
 *
12
 * Contributors:
13
 *   IBM - Initial API and implementation
14
 *
15
 * </copyright>
16
 */
17
%>
18
<%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();
19
String importedOperationClassName = genModel.getImportedName(genModel.isRichClientPlatform() ? "org.eclipse.jface.operation.IRunnableWithProgress" : "org.eclipse.ui.actions.WorkspaceModifyOperation");
20
String operationMethodName = genModel.isRichClientPlatform() ? "run" : "execute"; if (false) {/* Trick to import java.util.* without warnings */Iterator.class.getName();}
21
%>
22
<%String _ArrayListOfObject = "ArrayList" + (genModel.useGenerics() ? "<Object>" : "");%>
23
<%String _ArrayListOfAdapterFactory = "ArrayList" + (genModel.useGenerics() ? "<AdapterFactory>" : "");%>
24
<%String _ListOfAdapterFactory = "List" + (genModel.useGenerics() ? "<AdapterFactory>" : "");%>
25
<%String _ArrayListOfSelectionChangedListener = "ArrayList" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");%>
26
<%String _CollectionOfSelectionChangedListener = "Collection" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");%>
27
<%String _ArrayListOfResource = "ArrayList" + (genModel.useGenerics() ? "<Resource>" : "");%>
28
<%String _CollectionOfResource = "Collection" + (genModel.useGenerics() ? "<Resource>" : "");%>
29
<%String _MapOfResourceToDiagnostic = "Map" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");%>
30
<%String _HashMapOfResourceToBoolean = "HashMap" + (genModel.useGenerics() ? "<Resource, Boolean>" : "");%>
31
<%String _LinkedHashMapOfResourceToDiagnostic = "LinkedHashMap" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");%>
32
<%String _CollectionOfAnything = "Collection" + (genModel.useGenerics() ? "<?>" : "");%>
33
<%String _ListOfAnything = "List" + (genModel.useGenerics() ? "<?>" : "");%>
34
<%@ include file="../Header.javajetinc"%>
35
package <%=genPackage.getPresentationPackageName()%>;
36
37
import org.eclipse.emf.edit.ui.preferences.GenericEditPreferencePage;
38
39
/**
40
 * This is an example of a <%=genPackage.getPrefix()%> model editor preferences.
41
 * <!-- begin-user-doc -->
42
 * <!-- end-user-doc -->
43
 * @generated
44
 */
45
public class <%=genPackage.getEditorPreferencePageClassName()%> extends GenericEditPreferencePage {
46
<%if (genModel.getCopyrightText() != null) {%>
47
	/**
48
	 * <!-- begin-user-doc -->
49
	 * <!-- end-user-doc -->
50
	 * @generated
51
	 */
52
	public static final <%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>
53
54
<%}%>
55
    /**
56
	 * Create the instance.
57
	 * <!-- begin-user-doc -->
58
	 * <!-- end-user-doc -->
59
	 * @generated
60
	 */
61
	public <%=genPackage.getEditorPreferencePageClassName()%>() {
62
		super();
63
		setDescription(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorPreferencePageClassName()%>_description"));
64
		setPreferenceStore(<%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getPreferenceStore());
65
	}
66
67
    /**
68
	 * Create the preference page contents.
69
	 * <!-- begin-user-doc -->
70
	 * <!-- end-user-doc -->
71
	 * @generated
72
	 */	
73
	@Override
74
	protected void createFieldEditors() {
75
		addSaveTypeInformationField(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorPreferencePageClassName()%>TypeInformation_label"));
76
		addSaveDoctypeField(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorPreferencePageClassName()%>SaveDoctype_label"));
77
		addFormattedField(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorPreferencePageClassName()%>Formatted_label"));
78
		addLineWidthField(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorPreferencePageClassName()%>LineWidth_label"));
79
	}
80
}
(-)META-INF/MANIFEST.MF (-2 / +4 lines)
Lines 1-7 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.emf.edit.ui
4
Bundle-SymbolicName: org.eclipse.emf.edit.ui;singleton:=true
5
Bundle-Version: 2.3.0.qualifier
5
Bundle-Version: 2.3.0.qualifier
6
Bundle-ClassPath: edit.ui.jar
6
Bundle-ClassPath: edit.ui.jar
7
Bundle-Activator: org.eclipse.emf.edit.ui.EMFEditUIPlugin$Implementation
7
Bundle-Activator: org.eclipse.emf.edit.ui.EMFEditUIPlugin$Implementation
Lines 12-17 Link Here
12
 org.eclipse.emf.edit.ui.action,
12
 org.eclipse.emf.edit.ui.action,
13
 org.eclipse.emf.edit.ui.celleditor,
13
 org.eclipse.emf.edit.ui.celleditor,
14
 org.eclipse.emf.edit.ui.dnd,
14
 org.eclipse.emf.edit.ui.dnd,
15
 org.eclipse.emf.edit.ui.preferences,
15
 org.eclipse.emf.edit.ui.provider,
16
 org.eclipse.emf.edit.ui.provider,
16
 org.eclipse.emf.edit.ui.util,
17
 org.eclipse.emf.edit.ui.util,
17
 org.eclipse.emf.edit.ui.view
18
 org.eclipse.emf.edit.ui.view
Lines 21-25 Link Here
21
 org.eclipse.emf.edit;visibility:=reexport,
22
 org.eclipse.emf.edit;visibility:=reexport,
22
 org.eclipse.emf.common.ui;visibility:=reexport,
23
 org.eclipse.emf.common.ui;visibility:=reexport,
23
 org.eclipse.core.resources;resolution:=optional,
24
 org.eclipse.core.resources;resolution:=optional,
24
 org.eclipse.ui.ide;resolution:=optional
25
 org.eclipse.ui.ide;resolution:=optional,
26
 org.eclipse.emf.ecore.xmi
25
Eclipse-LazyStart: true
27
Eclipse-LazyStart: true
(-)plugin.properties (+7 lines)
Lines 97-99 Link Here
97
_UI_MarkerLocation = line {0}, column {1}
97
_UI_MarkerLocation = line {0}, column {1}
98
98
99
_UI_MultiLineInputDialog_message = Enter a value:
99
_UI_MultiLineInputDialog_message = Enter a value:
100
101
_UI_EditorPreferencesPage_label = XMI Editors Preferences
102
_UI_EditorPreference_description = Default XMI Editors preferences apply whenever no editors specific options are set.
103
_UI_EditorPreferenceTypeInformation_label = Save type information
104
_UI_EditorPreferenceSaveDoctype_label = Save doctype declaration
105
_UI_EditorPreferenceFormatted_label = Output formatted XML
106
_UI_EditorPreferenceLineWidth_label = XML file line width
(-)plugin.xml (-1 / +10 lines)
Lines 1-3 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
2
<?eclipse version="3.0"?>
3
<plugin />
3
<plugin>
4
  <extension
5
    point="org.eclipse.ui.preferencePages">
6
    <page
7
          class="org.eclipse.emf.edit.ui.preferences.DefaultEditPreferencesPage"
8
          id="org.eclipse.emf.edit.ui.XMIEditingPreferences"
9
          name="%_UI_EditorPreferencesPage_label">
10
    </page>
11
  </extension> 
12
</plugin>
(-)src/org/eclipse/emf/edit/ui/preferences/DefaultEditPreferencesPage.java (+20 lines)
Added Link Here
1
package org.eclipse.emf.edit.ui.preferences;
2
3
import org.eclipse.emf.edit.ui.EMFEditUIPlugin;
4
import org.eclipse.ui.PlatformUI;
5
6
public class DefaultEditPreferencesPage extends GenericEditPreferencePage {
7
8
		public DefaultEditPreferencesPage() {
9
			super();
10
			setDescription(EMFEditUIPlugin.INSTANCE.getString("_UI_EditorPreference_description"));
11
			setPreferenceStore(PlatformUI.getPreferenceStore());
12
		}
13
14
		protected void createFieldEditors() {
15
			addSaveTypeInformationField(EMFEditUIPlugin.INSTANCE.getString("_UI_EditorPreferenceTypeInformation_label"));
16
			addSaveDoctypeField(EMFEditUIPlugin.INSTANCE.getString("_UI_EditorPreferenceSaveDoctype_label"));
17
			addFormattedField(EMFEditUIPlugin.INSTANCE.getString("_UI_EditorPreferenceFormatted_label"));
18
			addLineWidthField(EMFEditUIPlugin.INSTANCE.getString("_UI_EditorPreferenceLineWidth_label"));
19
		}
20
}
(-)src/org/eclipse/emf/edit/ui/preferences/GenericEditPreferencePage.java (+64 lines)
Added Link Here
1
package org.eclipse.emf.edit.ui.preferences;
2
3
import org.eclipse.emf.ecore.xmi.XMLResource;
4
import org.eclipse.jface.preference.BooleanFieldEditor;
5
import org.eclipse.jface.preference.FieldEditor;
6
import org.eclipse.jface.preference.FieldEditorPreferencePage;
7
import org.eclipse.jface.preference.IPreferenceStore;
8
import org.eclipse.jface.preference.IntegerFieldEditor;
9
import org.eclipse.ui.IWorkbench;
10
import org.eclipse.ui.IWorkbenchPreferencePage;
11
12
/**
13
 * 
14
 */
15
public abstract class GenericEditPreferencePage extends
16
		FieldEditorPreferencePage implements IWorkbenchPreferencePage {
17
18
	protected GenericEditPreferencePage() {
19
		super(GRID);
20
	}
21
22
	/**
23
	 * Adds field with XMLResource.OPTION_SAVE_TYPE_INFORMATION option.
24
	 */
25
	protected void addSaveTypeInformationField(String label) {
26
		FieldEditor saveTypeInformation = new BooleanFieldEditor(XMLResource.OPTION_SAVE_TYPE_INFORMATION, label, getFieldEditorParent());
27
		addField(saveTypeInformation);
28
	}
29
30
	/**
31
	 * Adds field with XMLResource.OPTION_SAVE_DOCTYPE option.
32
	 */
33
	protected void addSaveDoctypeField(String label) {
34
		FieldEditor saveDoctype = new BooleanFieldEditor(XMLResource.OPTION_SAVE_DOCTYPE, label, getFieldEditorParent());
35
		addField(saveDoctype);
36
	}
37
38
	/**
39
	 * Adds field with XMLResource.OPTION_FORMATTED option.
40
	 */
41
	protected void addFormattedField(String label) {
42
		FieldEditor formatted = new BooleanFieldEditor(XMLResource.OPTION_FORMATTED, label, getFieldEditorParent());
43
		addField(formatted);
44
	}
45
46
	/**
47
	 * Adds field with XMLResource.OPTION_LINE_WIDTH option.
48
	 */
49
	protected void addLineWidthField(String label) {
50
		IPreferenceStore store = getPreferenceStore();
51
		if (! store.contains(XMLResource.OPTION_LINE_WIDTH)) {
52
			store.setDefault(XMLResource.OPTION_LINE_WIDTH, 100);
53
		}
54
		IntegerFieldEditor lineWidth = new IntegerFieldEditor(XMLResource.OPTION_LINE_WIDTH, label, getFieldEditorParent());
55
		lineWidth.setTextLimit(5);
56
		addField(lineWidth);
57
	}
58
59
	public void init(IWorkbench workbench) {
60
		// no init code
61
	}
62
	
63
	
64
}

Return to bug 154708