diff options
author | Matthew Piggott | 2011-02-28 22:12:07 +0000 |
---|---|---|
committer | Pascal Rapicault | 2011-03-03 21:35:20 +0000 |
commit | b17a45bfe7c5b0a64edb17d9cd68964eadf93063 (patch) | |
tree | 211cac5038ee96a8b9ca853746644332e7e2918c /org.eclipse.m2e.editor.xml | |
parent | ea88d2e22b19a9f914d3acc5f6292216a0a536f3 (diff) | |
download | m2e-core-b17a45bfe7c5b0a64edb17d9cd68964eadf93063.tar.gz m2e-core-b17a45bfe7c5b0a64edb17d9cd68964eadf93063.tar.xz m2e-core-b17a45bfe7c5b0a64edb17d9cd68964eadf93063.zip |
bug 338453 - Jump To Location did not resolve project.version
Diffstat (limited to 'org.eclipse.m2e.editor.xml')
-rw-r--r-- | org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java index f45e3984..b1a1cdf7 100644 --- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java +++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java @@ -15,6 +15,7 @@ import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.ARTIFACT_ID; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCY; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.EXTENSION; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GROUP_ID; +import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.NAME; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PARENT; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGIN; import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PROPERTIES; @@ -378,14 +379,22 @@ public class PomHyperlinkDetector implements IHyperlinkDetector { if(mavprj != null) { //TODO get rid of InputLocation here and use the dom tree to find the property Model mdl = mavprj.getModel(); + InputLocation location = null; if (mdl.getProperties().containsKey(region.property)) { - InputLocation location = mdl.getLocation( PROPERTIES ).getLocation( region.property ); //$NON-NLS-1$ - if (location != null) { - File file = XmlUtils.fileForInputLocation(location, mavprj); - if (file != null) { - IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI()); - openXmlEditor(fileStore, location.getLineNumber(), location.getColumnNumber(), location.getSource().getModelId()); - } + location = mdl.getLocation(PROPERTIES).getLocation(region.property); + } else if(region.property != null && region.property.startsWith("project.")) {//$NON-NLS-1$ + if("project.version".equals(region.property)) { + location = mdl.getLocation(VERSION); + } else if("project.name".equals(region.property)) { + location = mdl.getLocation(NAME); + } + } + if(location != null) { + File file = XmlUtils.fileForInputLocation(location, mavprj); + if(file != null) { + IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI()); + openXmlEditor(fileStore, location.getLineNumber(), location.getColumnNumber(), location.getSource() + .getModelId()); } } } |