Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2011-02-07 09:43:32 -0500
committerMilos Kleint2011-02-07 09:43:32 -0500
commit2aa255066f2ffc5878b3dc9a867d34465f01e6d3 (patch)
treede46b57a2e87e6ff4ea49236a1c35030ecc7b438 /org.eclipse.m2e.editor.xml
parentf2668594ae8c90ef851cf5a9be8712c29d7030a2 (diff)
downloadm2e-core-2aa255066f2ffc5878b3dc9a867d34465f01e6d3.tar.gz
m2e-core-2aa255066f2ffc5878b3dc9a867d34465f01e6d3.tar.xz
m2e-core-2aa255066f2ffc5878b3dc9a867d34465f01e6d3.zip
335725 have the xml dialog show the coordinate entry fields
Diffstat (limited to 'org.eclipse.m2e.editor.xml')
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
index 82f39f0d..24657dc4 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
@@ -50,6 +50,7 @@ import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.index.IIndex;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.dialogs.AddDependencyDialog;
import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
import org.eclipse.m2e.editor.xml.internal.Messages;
import org.eclipse.m2e.editor.xml.internal.PomEdits.Operation;
@@ -91,7 +92,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
}
//TODO also collect the used plugins list
}
+ boolean showScope = false;
if (config.getType() == SearchType.DEPENDENCY) {
+ showScope = true;
//only populate the lists when in dependency search..
// and when in dependency management or plugin section use the different set than elsewhere to get different visual effect.
String path = XmlUtils.pathUp(config.getCurrentNode(), 2);
@@ -108,10 +111,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
}
//TODO also collect the used dependency list
}
-
- MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(sourceViewer.getTextWidget().getShell(),
+ final MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(sourceViewer.getTextWidget().getShell(),
config.getType().getWindowTitle(), config.getType().getIIndexType(),
- usedKeys, managedKeys, false);
+ usedKeys, managedKeys, showScope);
if (config.getInitiaSearchString() != null) {
dialog.setQuery(config.getInitiaSearchString());
}
@@ -233,6 +235,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
if (!skipVersion(dependency.getParentNode(), af, managedKeys, config.getType())) {
setText(getChild(dependency, "version"), af.version);
}
+ if (dialog.getSelectedScope() != null && !"compile".equals(dialog.getSelectedScope())) {
+ setText(getChild(dependency, "scope"), dialog.getSelectedScope());
+ }
format(toFormat);
generatedOffset = ((IndexedRegion)toFormat).getStartOffset();
generatedLength = ((IndexedRegion)toFormat).getEndOffset() - generatedOffset;

Back to the top