Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356828 - Editor title is not decoded last segment of resource URI
Summary: Editor title is not decoded last segment of resource URI
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Juno M2 Theme_bugs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-06 11:27 EDT by Filippo Rossoni CLA
Modified: 2012-06-28 10:42 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments
restore previus version of org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refreshTitle() (311.15 KB, application/octet-stream)
2011-09-06 11:36 EDT, Filippo Rossoni CLA
no flags Details
fix editor name patch (1.61 KB, patch)
2011-09-06 11:44 EDT, Filippo Rossoni CLA
no flags Details | Diff
fix editor name patch (1.56 KB, patch)
2011-09-06 11:50 EDT, Filippo Rossoni CLA
michael.wenz: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filippo Rossoni CLA 2011-09-06 11:27:42 EDT
Build Identifier: 730ab5024235058a25e77f37a4b0af7d54863eb6

the diagram editor title is changed from Diagram name to last segment of resource URI
for example if the file contains space the title contains %20

Reproducible: Always

Steps to Reproduce:
1.create a diagram with a diagram name diffrent from file name wich contains space
2.open editor
3.
Comment 1 Filippo Rossoni CLA 2011-09-06 11:36:37 EDT
Created attachment 202816 [details]
restore previus version of org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refreshTitle()

restore previus version of org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refreshTitle()
Comment 2 Filippo Rossoni CLA 2011-09-06 11:44:24 EDT
Created attachment 202818 [details]
fix editor name patch

restore old org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refreshTitle()
Comment 3 Filippo Rossoni CLA 2011-09-06 11:48:38 EDT
Comment on attachment 202818 [details]
fix editor name patch

>From 7820306c01d1bbdd66b74766f8d5d5493453f6e9 Tue, 6 Sep 2011 17:41:47 +0200
>From: rossonifi <filippo.rossoni@valueteam.com>
>Date: Tue, 6 Sep 2011 17:41:27 +0200
>Subject: [PATCH] fix editor name
>
>diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
>index 540f6ba..82c4136 100644
>--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
>+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
>@@ -38,6 +38,7 @@
> import org.eclipse.draw2d.geometry.Dimension;
> import org.eclipse.draw2d.geometry.Point;
> import org.eclipse.emf.common.command.CommandStackListener;
>+import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
>@@ -1390,8 +1391,15 @@
> 	}
> 
> 	private void refreshTitle() {
>-		String lastSegment = getDiagramTypeProvider().getDiagram().eResource().getURI().lastSegment();
>-		setPartName(lastSegment);
>+		String name = getConfigurationProvider().getDiagramTypeProvider().getDiagramTitle();
>+		if (name == null || name.length() == 0) {
>+			name = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
>+		}
>+		if (name == null || name.length() == 0) {
>+			name = URI.decode(getDiagramTypeProvider().getDiagram().eResource().getURI().lastSegment());
>+		setPartName(name);
> 	}
> 
> 	@Override
Comment 4 Filippo Rossoni CLA 2011-09-06 11:50:26 EDT
Created attachment 202819 [details]
fix editor name patch

restore previus org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.refreshTitle()
Comment 5 Michael Wenz CLA 2011-09-07 09:23:38 EDT
Correct, what we edit in the Diagram editor is the diagram not the file.
Comment 6 Michael Wenz CLA 2011-09-08 08:36:45 EDT
I have taken over the attached patch, committed and pushed it to Eclipse. Additionally I have created a SWT bot test for this.

commit 4db838b29c0b56526d66e8170104d69c3989e6d3
Author: mwenz <michael.wenz@sap.com> 2011-09-08 14:31:57
Committer: mwenz <michael.wenz@sap.com> 2011-09-08 14:32:54
Parent: 0fd452f7f562e3f43ccc561fd9ef95f5d41af8be (IGaService#ignoreAll renamed to resetAll())
Branches: master
Comment 7 Michael Wenz CLA 2012-04-11 10:35:15 EDT
Bookkeeping: Set target release
Comment 8 Michael Wenz CLA 2012-06-28 10:42:24 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)