Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-02-02 15:49:45 -0500
committeratikhomirov2007-02-02 15:49:45 -0500
commit25ae19357a1bfb9f5f1ba0ff45c2467c2d6a10a9 (patch)
tree8330cc733fc40eca90a06ab2a0c1956b241cdb51
parentbae5638bd1386d9b43b0f88516fbca9282019615 (diff)
downloadorg.eclipse.gmf-tooling-25ae19357a1bfb9f5f1ba0ff45c2467c2d6a10a9.tar.gz
org.eclipse.gmf-tooling-25ae19357a1bfb9f5f1ba0ff45c2467c2d6a10a9.tar.xz
org.eclipse.gmf-tooling-25ae19357a1bfb9f5f1ba0ff45c2467c2d6a10a9.zip
[139733] akarjakina - lack of i18n support. More templates i18n-ed
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/Externalizer.xpt16
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/ExternalizerUtils.ext2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/application/ActionBarAdvisor.xpt58
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/application/WorkbenchWindowAdvisor.xpt12
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/application/extensions.xpt2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/application/i18n.ext51
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/CompartmentEditPart.xpt18
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Utils.ext4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt16
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/OpenDiagram.xpt12
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.ext10
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/preferences/extensions.xpt13
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt16
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt40
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/Utils.ext4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/properties.xpt3
16 files changed, 252 insertions, 25 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/Externalizer.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/Externalizer.xpt
index e477354d2..a7f62cacd 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/Externalizer.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/Externalizer.xpt
@@ -31,14 +31,26 @@ public class «getAccessorName()» extends org.eclipse.osgi.util.NLS {
private «getAccessorName()»() {
}
- «EXPAND xpt::editor::palette::PaletteFactory::i18nAccessors FOR diagram.palette»
+ «EXPAND xpt::editor::palette::PaletteFactory::i18nAccessors FOR diagram.palette-»
+ «EXPAND xpt::application::ActionBarAdvisor::i18nAccessors FOR application-»
+ «EXPAND xpt::application::WorkbenchWindowAdvisor::i18nAccessors FOR application-»
+ «EXPAND xpt::diagram::editparts::CompartmentEditPart::i18nAccessors FOR diagram-»
+ «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::i18nAccessors FOR diagram-»
+ «EXPAND xpt::diagram::editpolicies::OpenDiagram::i18nAccessors FOR diagram-»
+ «EXPAND xpt::navigator::NavigatorContentProvider::i18nAccessors FOR navigator-»
//TODO: put accessor fields manually
}
«ENDDEFINE»
«DEFINE Values FOR gmfgen::GenEditorGenerator»
# TODO: manually put keys and values
-«EXPAND xpt::editor::palette::PaletteFactory::i18nValues FOR diagram.palette»
+«EXPAND xpt::editor::palette::PaletteFactory::i18nValues FOR diagram.palette-»
+«EXPAND xpt::application::ActionBarAdvisor::i18nValues FOR application-»
+«EXPAND xpt::application::WorkbenchWindowAdvisor::i18nValues FOR application-»
+«EXPAND xpt::diagram::editparts::CompartmentEditPart::i18nValues FOR diagram-»
+«EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::i18nValues FOR diagram-»
+«EXPAND xpt::diagram::editpolicies::OpenDiagram::i18nValues FOR diagram-»
+«EXPAND xpt::navigator::NavigatorContentProvider::i18nValues FOR navigator-»
«ENDDEFINE»
«DEFINE accessorField(String key) FOR Object»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/ExternalizerUtils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/ExternalizerUtils.ext
index 2d7b68d8f..00574414d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/ExternalizerUtils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/ExternalizerUtils.ext
@@ -22,7 +22,7 @@ String getAccessorName() :
;
String escapeIllegalKeySymbols(String key) :
- key.replaceAll("[ .=]", "_")
+ key.replaceAll("[=&\"]", "").replaceAll("[ .]", "_")
;
String escapeIllegalMessageSymbols(String message) :
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/ActionBarAdvisor.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/ActionBarAdvisor.xpt
index 5eeb7584f..689d351a9 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/ActionBarAdvisor.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/ActionBarAdvisor.xpt
@@ -13,6 +13,8 @@
«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
+«EXTENSION xpt::application::i18n»
+
«DEFINE ActionBarAdvisor FOR gmfgen::GenApplication-»
«EXPAND xpt::Common::copyright FOR editorGen-»
package «packageName»;
@@ -75,15 +77,20 @@ public class «actionBarAdvisorClassName» extends org.eclipse.ui.application.Acti
org.eclipse.ui.IEditorDescriptor editorDescriptor =
workbench.getEditorRegistry().getDefaultEditor(fileURI.toFileString());
if (editorDescriptor == null) {
- org.eclipse.jface.dialogs.MessageDialog.openError(workbenchWindow.getShell(), "Error",
- org.eclipse.osgi.util.NLS.bind("There is no editor registered for the file ''{0}''", fileURI.toFileString()));
+ org.eclipse.jface.dialogs.MessageDialog.openError(workbenchWindow.getShell(),
+ «EXPAND xpt::Externalizer::accessorCall(editorGen.application.i18nKeyForDefaultFileEditorErrorDialog().titleKey()) FOR editorGen»,
+ org.eclipse.osgi.util.NLS.bind(
+ «EXPAND xpt::Externalizer::accessorCall(editorGen.application.i18nKeyForDefaultFileEditorErrorDialog().messageKey()) FOR editorGen»,
+ fileURI.toFileString()));
return false;
} else {
try {
page.openEditor(new org.eclipse.emf.common.ui.URIEditorInput(fileURI), editorDescriptor.getId());
} catch (org.eclipse.ui.PartInitException exception) {
org.eclipse.jface.dialogs.MessageDialog.openError(
- workbenchWindow.getShell(), "Open Editor", exception.getMessage());
+ workbenchWindow.getShell(),
+ «EXPAND xpt::Externalizer::accessorCall(editorGen.application.i18nKeyForDefaultEditorOpenErrorDialog().titleKey()) FOR editorGen»,
+ exception.getMessage());
return false;
}
}
@@ -118,7 +125,8 @@ public class «actionBarAdvisorClassName» extends org.eclipse.ui.application.Acti
«DEFINE contribute(String managerVar) FOR gmfgen::GenMenuManager»
«LET managerVar + "X" AS menuVar-»
{
- org.eclipse.jface.action.IMenuManager «menuVar» = new org.eclipse.jface.action.MenuManager(«name», «iD»);
+ org.eclipse.jface.action.IMenuManager «menuVar» = new org.eclipse.jface.action.MenuManager(
+ «IF null != name»«EXPAND xpt::Externalizer::accessorCall(i18nKeyForMenu()) FOR this.application.editorGen»«ELSE»null«ENDIF»«IF null != iD», «iD»«ENDIF»);
«EXPAND contribute(menuVar) FOREACH items-»
«managerVar».add(«menuVar»);
}
@@ -212,11 +220,47 @@ public class «actionBarAdvisorClassName» extends org.eclipse.ui.application.Acti
«EXPAND xpt::Common::generatedMemberComment»
public void run(org.eclipse.jface.action.IAction action) {
- org.eclipse.jface.dialogs.MessageDialog.openInformation(getWindow().getShell(), "About",
- "«editorGen.modelID» Diagram Editor");
+ org.eclipse.jface.dialogs.MessageDialog.openInformation(getWindow().getShell(),
+ «EXPAND xpt::Externalizer::accessorCall(i18nKeyForAboutDialog().titleKey()) FOR editorGen»,
+ «EXPAND xpt::Externalizer::accessorCall(i18nKeyForAboutDialog().messageKey()) FOR editorGen»
+ );
}
}
«ENDDEFINE»
«DEFINE additions FOR gmfgen::GenApplication-»
-«ENDDEFINE» \ No newline at end of file
+«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenApplication-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForDefaultFileEditorErrorDialog().titleKey())-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForDefaultFileEditorErrorDialog().messageKey())-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForDefaultEditorOpenErrorDialog().titleKey())-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForAboutDialog().titleKey())-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForAboutDialog().messageKey())-»
+«IF null != mainMenu-»
+«EXPAND internal_i18nAccessors FOR mainMenu-»
+«EXPAND internal_i18nAccessors FOREACH mainMenu.items.collectGenMenuManagers()-»
+«ENDIF»
+«EXPAND internal_i18nAccessors FOREACH sharedContributionItems.collectGenMenuManagers()-»
+«ENDDEFINE»
+
+«DEFINE internal_i18nAccessors FOR gmfgen::GenMenuManager-»
+«IF null != name»«EXPAND xpt::Externalizer::accessorField(i18nKeyForMenu())»«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenApplication-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForDefaultFileEditorErrorDialog().titleKey(), "Error")-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForDefaultFileEditorErrorDialog().messageKey(), "There is no editor registered for the file \"{0}\"")-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForDefaultEditorOpenErrorDialog().titleKey(), "Open Editor")-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForAboutDialog().titleKey(), "About")-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForAboutDialog().messageKey(), editorGen.modelID+" Diagram Editor")-»
+«IF null != mainMenu-»
+«EXPAND internal_i18nValues FOR mainMenu-»
+«EXPAND internal_i18nValues FOREACH mainMenu.items.collectGenMenuManagers()-»
+«ENDIF»
+«EXPAND internal_i18nValues FOREACH sharedContributionItems.collectGenMenuManagers()-»
+«ENDDEFINE»
+
+«DEFINE internal_i18nValues FOR gmfgen::GenMenuManager-»
+«IF null != name»«EXPAND xpt::Externalizer::messageEntry(i18nKeyForMenu(), name)»«ENDIF-»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/WorkbenchWindowAdvisor.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/WorkbenchWindowAdvisor.xpt
index fe1be24b2..b3f241192 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/WorkbenchWindowAdvisor.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/WorkbenchWindowAdvisor.xpt
@@ -13,6 +13,8 @@
«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
+«EXTENSION xpt::application::i18n»
+
«DEFINE WorkbenchWindowAdvisor FOR gmfgen::GenApplication-»
«EXPAND xpt::Common::copyright FOR editorGen-»
package «packageName»;
@@ -45,9 +47,17 @@ public class «workbenchWindowAdvisorClassName» extends org.eclipse.ui.applicatio
public void preWindowOpen() {
org.eclipse.ui.application.IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new org.eclipse.swt.graphics.Point(1000, 700));
- configurer.setTitle("«title»");
+ configurer.setTitle(«EXPAND xpt::Externalizer::accessorCall(i18nKeyForWindowTitle()) FOR editorGen»);
}
«ENDDEFINE»
«DEFINE additions FOR gmfgen::GenApplication-»
«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenApplication-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForWindowTitle())-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenApplication-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForWindowTitle(), title)-»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/extensions.xpt
index 92ca8ee50..c31ce4a85 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/extensions.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/extensions.xpt
@@ -26,7 +26,7 @@
<?gmfgen generated="true"?>
<perspective
id="«perspectiveId»"
- name="«editorGen.modelID» Perspective"
+ name="%perspectiveName"
class="«getPerspectiveQualifiedClassName()»">
</perspective>
</extension>
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/application/i18n.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/i18n.ext
new file mode 100644
index 000000000..7ba7ade97
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/application/i18n.ext
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anna Karjakina (Borland) - initial API and implementation
+ */
+
+import "http://www.eclipse.org/gmf/2005/GenModel/2.0";
+import "http://www.eclipse.org/emf/2002/Ecore";
+
+String i18nKeyForDefaultFileEditorErrorDialog(gmfgen::GenApplication app) :
+ app.actionBarAdvisorClassName+".DefaultFileEditor"
+;
+
+String i18nKeyForDefaultEditorOpenErrorDialog(gmfgen::GenApplication app) :
+ app.actionBarAdvisorClassName+".DefaultEditorOpenError"
+;
+
+String i18nKeyForWindowTitle(gmfgen::GenApplication app) :
+ app.workbenchWindowAdvisorClassName+".Title"
+;
+
+String i18nKeyForAboutDialog(gmfgen::GenApplication app) :
+ app.actionBarAdvisorClassName+".AboutDialog"
+;
+
+String titleKey(String dialogKey) :
+ dialogKey+"Title"
+;
+
+String messageKey(String dialogKey) :
+ dialogKey+"Message"
+;
+
+String i18nKeyForMenu(gmfgen::GenMenuManager menuManager) :
+ "ApplicationMenuName."+menuManager.name
+;
+
+List[gmfgen::GenMenuManager] collectGenMenuManagers(Collection[gmfgen::GenContributionItem] allItems) :
+ collectAllContributionItems(allItems).typeSelect(gmfgen::GenMenuManager)
+;
+
+List[gmfgen::GenContributionManager] collectAllContributionItems(Collection[gmfgen::GenContributionItem] allItems) :
+ let managers = allItems.typeSelect(gmfgen::GenContributionManager) :
+ managers.addAll(managers.collect(item| collectAllContributionItems(item.items)).flatten())
+;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/CompartmentEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/CompartmentEditPart.xpt
index c609b690b..8c82fbd89 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/CompartmentEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/CompartmentEditPart.xpt
@@ -43,7 +43,7 @@ public class «editPartClassName» extends
«EXPAND xpt::Common::generatedMemberComment»
public String getCompartmentName() {
- return "«title»";
+ return «EXPAND xpt::Externalizer::accessorCall(i18nKeyForCompartmentTitle()) FOR getDiagram().editorGen»;
}
«IF !needsTitle-»
@@ -121,4 +121,20 @@ public class «editPartClassName» extends
«ENDIF-»
}
}
+«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenDiagram-»
+«EXPAND internal_i18nAccessors FOREACH compartments»
+«ENDDEFINE»
+
+«DEFINE internal_i18nAccessors FOR gmfgen::GenCompartment-»
+«IF null != title»«EXPAND xpt::Externalizer::accessorField(i18nKeyForCompartmentTitle())»«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenDiagram-»
+«EXPAND internal_i18nValues FOREACH compartments»
+«ENDDEFINE»
+
+«DEFINE internal_i18nValues FOR gmfgen::GenCompartment-»
+«IF null != title»«EXPAND xpt::Externalizer::messageEntry(i18nKeyForCompartmentTitle(), title)»«ENDIF-»
«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Utils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Utils.ext
index 236b77870..8515c1cab 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Utils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Utils.ext
@@ -61,3 +61,7 @@ Boolean needsGraphicalNodeEditPolicy(gmfgen::GenNode node) :
String getSetterName(gmfgen::ParentAssignedViewmap viewmap) :
viewmap.setterName == null ? "setLabel" : viewmap.setterName
;
+
+String i18nKeyForCompartmentTitle(gmfgen::GenCompartment compartment) :
+ compartment.editPartClassName+".title"
+;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
index 060fc23b1..7b6122888 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
@@ -399,7 +399,7 @@ private static boolean evaluate(«getAbstractExpressionQualifiedClassName()» cons
Object val = constraint.evaluate(sourceEnd, evalEnv);
return (val instanceof Boolean) ? ((Boolean) val).booleanValue() : false;
} catch(Exception e) {
- «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
+ «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError(«EXPAND xpt::Externalizer::accessorCall(i18nKeyForLinkConstraintErrorLog()) FOR editorGen», e);
return false;
}
}
@@ -448,4 +448,16 @@ private static class JavaConstraints {
«ERROR "Unrecognized link model facet: " + this-»
«ENDDEFINE»
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE» \ No newline at end of file
+«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenDiagram-»
+«IF null != editorGen.expressionProviders && hasOCLConstraints()-»
+ «EXPAND xpt::Externalizer::accessorField(i18nKeyForLinkConstraintErrorLog())-»
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenDiagram-»
+«IF null != editorGen.expressionProviders && hasOCLConstraints()-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForLinkConstraintErrorLog(), "Link constraint evaluation error")-»
+«ENDIF-»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/OpenDiagram.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/OpenDiagram.xpt
index 7af1b8cec..5a40923e5 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/OpenDiagram.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/OpenDiagram.xpt
@@ -10,6 +10,7 @@
* Artem Tikhomirov (Borland) - initial API and implementation
*/
«IMPORT "http://www.eclipse.org/gmf/2005/GenModel/2.0"»
+«EXTENSION xpt::diagram::editpolicies::Utils»
«DEFINE OpenDiagram FOR gmfgen::OpenDiagramBehaviour»
«EXPAND xpt::Common::copyright FOR subject.getDiagram().editorGen-»
@@ -56,7 +57,7 @@ public class «editPolicyClassName» extends «EXPAND extendsList» {
OpenDiagramCommand(org.eclipse.emf.ecore.EAnnotation annotation) {
// editing domain is taken for original diagram,
// if we open diagram from another file, we should use another editing domain
- super(org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(annotation), "Open diagram", null);
+ super(org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(annotation), «EXPAND xpt::Externalizer::accessorCall(i18nKeyForOpenCommandName()) FOR subject.getDiagram().editorGen», null);
diagramFacet = annotation;
}
@@ -136,3 +137,12 @@ public class «editPolicyClassName» extends «EXPAND extendsList» {
«ENDDEFINE»
«DEFINE additions FOR OpenDiagramBehaviour»«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Externalizer::accessorField(i18nKeyForOpenCommandName())-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForOpenCommandName(), "Open Diagram")-»
+«ENDDEFINE»
+
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.ext
index 6e188e226..92fc81398 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.ext
@@ -103,4 +103,12 @@ private boolean canBeTarget(gmfgen::GenLink link, gmfgen::GenNode node) :
private ecore::EClass getMetaclass(gmfgen::GenNode node) :
node.modelFacet.metaClass.ecoreClass
-; \ No newline at end of file
+;
+
+String i18nKeyForLinkConstraintErrorLog() :
+"EvaluateOCLLinkConstraintError"
+;
+
+String i18nKeyForOpenCommandName() :
+"CommandName.OpenDiagram"
+;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/preferences/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/preferences/extensions.xpt
index bc5978432..4eda3a5e2 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/preferences/extensions.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/preferences/extensions.xpt
@@ -33,7 +33,7 @@
«DEFINE preferencePage FOR gmfgen::GenPreferencePage-»
<page
id="«iD»"
- name="«name»"
+ name="%preference.page.title.«iD»"
«IF null != parent-»
category="«parent.iD»"
«ENDIF-»
@@ -66,3 +66,14 @@ org.eclipse.gmf.runtime.emf.ui.preferences.PathmapsPreferencePage«ELSE-»
«ERROR "Unknown preference page: " + this»
«ENDIF-»
«ENDDEFINE»
+
+«DEFINE i18n FOR gmfgen::GenDiagram-»
+
+# Preferences
+«EXPAND internal_i18n FOREACH preferencePages»
+«ENDDEFINE»
+
+«DEFINE internal_i18n FOR gmfgen::GenPreferencePage-»
+preference.page.title.«iD»=«name»
+«EXPAND internal_i18n FOREACH children-»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
index 3a8786f36..5a305cdff 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
@@ -104,7 +104,7 @@
<metamodelType
id="«uniqueIdentifier»"
«IF null != displayName-»
- name="«displayName»"
+ name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
eclass="«getMetaClass().ecoreClass.name»"
@@ -128,7 +128,7 @@
<specializationType
id="«uniqueIdentifier»"
«IF null != displayName-»
- name="«displayName»"
+ name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
edithelperadvice="«getEditHelperAdviceQualifiedClassName()»">
@@ -141,10 +141,20 @@
<specializationType
id="«uniqueIdentifier»"
«IF null != displayName-»
- name="«displayName»"
+ name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
<specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
<param name="semanticHint" value="«diagramElement.visualID»"/>
</specializationType>
«ENDDEFINE»
+
+«DEFINE i18n FOR gmfgen::GenDiagram-»
+
+# Providers
+«EXPAND internal_i18n FOREACH getElements().elementType»
+«ENDDEFINE»
+
+«DEFINE internal_i18n FOR gmfgen::ElementType-»
+«IF null != displayName && !definedExternally»metatype.name.«diagramElement.getUniqueIdentifier()»=«displayName»«ENDIF»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
index 73f998cf1..bd31fa708 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
@@ -144,7 +144,7 @@ org.eclipse.emf.common.util.URI fileURI = org.eclipse.emf.common.util.URI.create
org.eclipse.emf.ecore.resource.Resource resource = resourceSet.getResource(fileURI, true);
java.util.Collection result = new java.util.ArrayList();
«LET getChildReferencesFrom(this, null) AS references-»
- «EXPAND initGroupVariables(this, references, 'file') FOREACH getGroupNames(references)-»
+ «EXPAND initGroupVariables(this, references, 'file', null) FOREACH getGroupNames(references)-»
«FOREACH references AS ref-»
«EXPAND addNavigatorItemsPrefix FOR ref»selectViewsByType(resource.getContents(), «EXPAND getChildViewType FOR ref.child»)«EXPAND addNavigatorItemsSuffix('file', false) FOR ref-»
«ENDFOREACH-»
@@ -319,8 +319,10 @@ private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notatio
«DEFINE createEditingDomain FOR gmfgen::GenNavigator»(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory.INSTANCE.createEditingDomain()«ENDDEFINE»
-«DEFINE initGroupVariables(gmfgen::GenNavigator navigator, List[gmfgen::GenNavigatorChildReference] references, String parentVarName) FOR String-»
- «navigator.getNavigatorGroupQualifiedClassName()» «asValidJavaIdentifier(this)» = new «navigator.getNavigatorGroupQualifiedClassName()»("«this»", "«getNavigatorReference(this, references).groupIcon»", «parentVarName»);
+«DEFINE initGroupVariables(gmfgen::GenNavigator navigator, List[gmfgen::GenNavigatorChildReference] references, String parentVarName, gmfgen::GenCommonBase contextElement) FOR String-»
+ «navigator.getNavigatorGroupQualifiedClassName()» «asValidJavaIdentifier(this)» = new «navigator.getNavigatorGroupQualifiedClassName()»(
+ «EXPAND xpt::Externalizer::accessorCall(i18nKeyForGroup(this, contextElement)) FOR navigator.editorGen»,
+ "«getNavigatorReference(this, references).groupIcon»", «parentVarName»); //$NON-NLS-1$
«ENDDEFINE»
«DEFINE addNavigatorItemsPrefix FOR gmfgen::GenNavigatorChildReference»«IF isInsideGroup()»«asValidJavaIdentifier(groupName)».addChildren(«ELSE»result.addAll(«ENDIF»createNavigatorItems(«ENDDEFINE»
@@ -348,7 +350,7 @@ case «getEditPartQualifiedClassName()».VISUAL_ID: {
java.util.Collection result = new java.util.ArrayList();
«EXPAND addForeignShortcuts FOR this-»
«LET getChildReferencesFrom(navigator, this) AS references-»
- «EXPAND initGroupVariables(navigator, references, 'parentElement') FOREACH getGroupNames(references)-»
+ «EXPAND initGroupVariables(navigator, references, 'parentElement', this) FOREACH getGroupNames(references)-»
«FOREACH references AS reference ITERATOR referencesIterator-»
«FOREACH reference.findConnectionPaths() AS path ITERATOR pathsIterator-»
«FOREACH path.segments AS segment ITERATOR segmentsIterator-»
@@ -390,3 +392,33 @@ result.addAll(getForeignShortcuts((org.eclipse.gmf.runtime.notation.Diagram) vie
«DEFINE additions FOR gmfgen::GenNavigator-»
«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenNavigator-»
+ «LET getChildReferencesFrom(this, null) AS references-»
+ «EXPAND internal_i18nAccessors(null) FOREACH getGroupNames(references)-»
+ «ENDLET-»
+ «FOREACH getNavigatorNodes(this) AS contextElement-»
+ «LET getChildReferencesFrom(this, contextElement) AS references-»
+ «EXPAND internal_i18nAccessors(contextElement) FOREACH getGroupNames(references)-»
+ «ENDLET-»
+ «ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE internal_i18nAccessors(gmfgen::GenCommonBase contextElement) FOR String-»
+«IF null != this»«EXPAND xpt::Externalizer::accessorField(i18nKeyForGroup(contextElement))»«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenNavigator-»
+«LET getChildReferencesFrom(this, null) AS references-»
+«EXPAND internal_i18nValues(null) FOREACH getGroupNames(references)-»
+«ENDLET-»
+«FOREACH getNavigatorNodes(this) AS contextElement-»
+«LET getChildReferencesFrom(this, contextElement) AS references-»
+«EXPAND internal_i18nValues(contextElement) FOREACH getGroupNames(references)-»
+«ENDLET-»
+«ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE internal_i18nValues(gmfgen::GenCommonBase contextElement) FOR String-»
+«IF null != this»«EXPAND xpt::Externalizer::messageEntry(i18nKeyForGroup(contextElement), this)»«ENDIF-»
+«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/Utils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/Utils.ext
index 14e253594..079d08ec3 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/Utils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/Utils.ext
@@ -42,3 +42,7 @@ List[gmfgen::GenNavigatorChildReference] getChildReferencesFrom(gmfgen::GenNavig
String asValidJavaIdentifier(String identifier) :
JAVA org.eclipse.emf.codegen.util.CodeGenUtil.validJavaIdentifier(java.lang.String)
;
+
+String i18nKeyForGroup(String groupName, gmfgen::GenCommonBase contextElement) :
+"NavigatorGroupName."+ (null != contextElement ? contextElement.getUniqueIdentifier() : "File") + "." + asValidJavaIdentifier(groupName)
+;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/properties.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/properties.xpt
index b6211d943..d3f918c36 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/properties.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/properties.xpt
@@ -38,6 +38,7 @@ createShortcutActionLabel=Create Shortcut...
loadResourceActionLabel=Load Resource...
«IF null != editorGen.application-»
+perspectiveName=«editorGen.modelID» Perspective
applicationActionSetLabel=<«editorGen.modelID» Actions
newDiagramActionLabel=«editorGen.modelID» Diagram
aboutActionLabel=«editorGen.modelID» Diagram About...
@@ -50,4 +51,6 @@ openActionDescription=Open file
navigatorContentName=*.«editorGen.diagramFileExtension» diagram contents
«EXPAND xpt::diagram::properties::extensions::i18n FOR editorGen.propertySheet-»
+«EXPAND xpt::diagram::preferences::extensions::i18n FOR editorGen.diagram-»
+«EXPAND xpt::diagram::providers::extensions::i18n FOR editorGen.diagram-»
«ENDDEFINE»

Back to the top