diff options
author | ashatalin | 2006-04-06 13:05:14 +0000 |
---|---|---|
committer | ashatalin | 2006-04-06 13:05:14 +0000 |
commit | 3a6bf477a730141a697632df76fa7da1981c73a5 (patch) | |
tree | 0fb96281e62b05ea3c5b6a68a5effb4b4a7f6911 /plugins/org.eclipse.gmf.codegen/templates/editor | |
parent | b4f092e6637a8b76bbc577831aa670ddaf2bcf67 (diff) | |
download | org.eclipse.gmf-tooling-3a6bf477a730141a697632df76fa7da1981c73a5.tar.gz org.eclipse.gmf-tooling-3a6bf477a730141a697632df76fa7da1981c73a5.tar.xz org.eclipse.gmf-tooling-3a6bf477a730141a697632df76fa7da1981c73a5.zip |
#132465 Bidi3.2: [HCG]Encoding of the mindmap diagram is always ASCII
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/editor')
-rw-r--r-- | plugins/org.eclipse.gmf.codegen/templates/editor/DiagramEditorUtil.javajet | 15 | ||||
-rw-r--r-- | plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/DiagramEditorUtil.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/DiagramEditorUtil.javajet index ec236c5f1..b2f0bc110 100644 --- a/plugins/org.eclipse.gmf.codegen/templates/editor/DiagramEditorUtil.javajet +++ b/plugins/org.eclipse.gmf.codegen/templates/editor/DiagramEditorUtil.javajet @@ -67,7 +67,7 @@ public class <%=genDiagram.getDiagramEditorUtilClassName()%> extends IDEEditorUt public static final IFile createNewDiagramFile(DiagramFileCreator diagramFileCreator, IPath containerFullPath, String fileName, InputStream initialContents, String kind, Shell shell, IProgressMonitor progressMonitor) { TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain(); ResourceSet resourceSet = editingDomain.getResourceSet(); - progressMonitor.beginTask("Creating diagram and model files", 2); //$NON-NLS-1$ + progressMonitor.beginTask("Creating diagram and model files", 4); //$NON-NLS-1$ final IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1); final IFile diagramFile = diagramFileCreator.createNewFile(containerFullPath, fileName, initialContents, shell, new IRunnableContext() { public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { @@ -137,6 +137,19 @@ if (genDiagram.getDomainDiagramElement() != null) { <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$ } +<%if (standaloneDomainModel) {%> + try { + modelFile.setCharset("UTF-8", new SubProgressMonitor(progressMonitor, 1)); //$NON-NLS-1$ + } catch (<%=importManager.getImportedName("org.eclipse.core.runtime.CoreException")%> e) { + <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logError("Unable to set charset for model file", e); //$NON-NLS-1$ + } +<%}%> + try { + diagramFile.setCharset("UTF-8", new SubProgressMonitor(progressMonitor, 1)); //$NON-NLS-1$ + } catch (<%=importManager.getImportedName("org.eclipse.core.runtime.CoreException")%> e) { + <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logError("Unable to set charset for diagram file", e); //$NON-NLS-1$ + } + return diagramFile; } } diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet index 43ed78ec4..0801c0eae 100644 --- a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet +++ b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet @@ -108,6 +108,12 @@ public class <%=genDiagram.getNewDiagramFileWizardClassName()%> extends Wizard { } IFile diagramFile = myFileCreationPage.createNewFile(); + try { + diagramFile.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$ + } catch (<%=importManager.getImportedName("org.eclipse.core.runtime.CoreException")%> e) { + <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logError("Unable to set charset for diagram file", e); //$NON-NLS-1$ + } + ResourceSet resourceSet = myEditingDomain.getResourceSet(); final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString())); |