Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-02 17:02:09 +0000
committercletavernie2013-05-02 17:02:09 +0000
commitd6ccc58a7bc604352ed98ab02e72619a2c2bf19a (patch)
tree02892217a2d0381343237278b91701e4be402ba8 /plugins
parentb552be37bd195b12428bd5e6b287616a2cc94913 (diff)
downloadorg.eclipse.papyrus-d6ccc58a7bc604352ed98ab02e72619a2c2bf19a.tar.gz
org.eclipse.papyrus-d6ccc58a7bc604352ed98ab02e72619a2c2bf19a.tar.xz
org.eclipse.papyrus-d6ccc58a7bc604352ed98ab02e72619a2c2bf19a.zip
399855: [Comments] Papyrus shall enable to reference model elements within free-text of comments.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399855
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/TextReferencesHelper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/TextReferencesHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/TextReferencesHelper.java
index b569c9463e7..e3ac8d92d7e 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/TextReferencesHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/TextReferencesHelper.java
@@ -130,7 +130,14 @@ public abstract class TextReferencesHelper {
}
//Use a Javadoc-like @link tag
- String reference = "{@link " + EcoreUtil.getURI(toElement) + "}"; //The URI is already encoded
+ URI elementURI = EcoreUtil.getURI(toElement);
+ if(baseResource != null) {
+ URI baseURI = baseResource.getURI();
+ if(baseURI != null) {
+ elementURI = elementURI.deresolve(baseURI);
+ }
+ }
+ String reference = "{@link " + elementURI + "}"; //The URI is already encoded
if(atPosition == 0) {
return reference + result; //At the beginning

Back to the top