diff options
author | Milos Kleint | 2011-02-21 12:15:07 +0000 |
---|---|---|
committer | Milos Kleint | 2011-02-21 12:15:07 +0000 |
commit | 25831c75a163ac68823fc2a22aa014bbc168c992 (patch) | |
tree | 34c0f2a2fd747681bebcd3376c766105fcf72d6c /org.eclipse.m2e.editor | |
parent | 200e3aad2da1eaa76ccd8f4fbe0ce5c4c95bf917 (diff) | |
download | m2e-core-25831c75a163ac68823fc2a22aa014bbc168c992.tar.gz m2e-core-25831c75a163ac68823fc2a22aa014bbc168c992.tar.xz m2e-core-25831c75a163ac68823fc2a22aa014bbc168c992.zip |
use constants
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r-- | org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java | 16 | ||||
-rw-r--r-- | org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java index 2c583931..2d192f90 100644 --- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java +++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java @@ -254,14 +254,14 @@ public class ManageDependenciesDialog extends AbstractMavenDialog { //First we remove the version from the original dependency final Operation removeVersion = new Operation() { public void process(Document document) { - List<Element> deps = findChilds(findChild(document.getDocumentElement(), "dependencies"), "dependency"); + List<Element> deps = findChilds(findChild(document.getDocumentElement(), DEPENDENCIES), DEPENDENCY); for (Element dep : deps) { - String grid = getTextValue(findChild(dep, "groupId")); - String artid = getTextValue(findChild(dep, "artifactId")); + String grid = getTextValue(findChild(dep, GROUP_ID)); + String artid = getTextValue(findChild(dep, ARTIFACT_ID)); for(Dependency modelDep : modelDeps) { if (modelDep.getGroupId() != null && modelDep.getGroupId().equals(grid) && modelDep.getArtifactId() != null && modelDep.getArtifactId().equals(artid)) { - removeChild(dep, findChild(dep, "version")); + removeChild(dep, findChild(dep, VERSION)); } } } @@ -270,11 +270,11 @@ public class ManageDependenciesDialog extends AbstractMavenDialog { final Operation manage = new Operation() { public void process(Document document) { List<Dependency> modelDependencies = new ArrayList<Dependency>(modelDeps); - Element managedDepsElement = getChild(document.getDocumentElement(), "dependencyManagement", "dependencies"); - List<Element> existing = findChilds(managedDepsElement, "dependency"); + Element managedDepsElement = getChild(document.getDocumentElement(), DEPENDENCY_MANAGEMENT, DEPENDENCIES); + List<Element> existing = findChilds(managedDepsElement, DEPENDENCY); for (Element dep : existing) { - String artifactId = getTextValue(findChild(dep, "artifactId")); - String groupId = getTextValue(findChild(dep, "groupId")); + String artifactId = getTextValue(findChild(dep, ARTIFACT_ID)); + String groupId = getTextValue(findChild(dep, GROUP_ID)); //cloned list, shall not modify shared resource (used by the remove operation) Iterator<Dependency> mdIter = modelDependencies.iterator(); while(mdIter.hasNext()) { diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java index e00bb6bb..e2480a3c 100644 --- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java +++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java @@ -609,10 +609,10 @@ public class OverviewPage extends MavenPomEditorPage { performOnDOMDocument(new OperationTuple(document, new Operation() { public void process(Document document) { Element root = document.getDocumentElement(); - Element modules = findChild(root, "modules"); + Element modules = findChild(root, MODULES); if (modules != null) { for (String module : modulesEditor.getSelection()) { - Element modEl = findChild(modules, "module", textEquals(module)); + Element modEl = findChild(modules, MODULE, textEquals(module)); if (modEl != null) { modules.removeChild(modEl); } @@ -647,7 +647,7 @@ public class OverviewPage extends MavenPomEditorPage { performOnDOMDocument(new OperationTuple(getPomEditor().getDocument(), new Operation() { public void process(Document document) { Element root = document.getDocumentElement(); - Element module = findChild(findChild(root, "modules"), "module", textEquals(oldValue)); + Element module = findChild(findChild(root, MODULES), MODULE, textEquals(oldValue)); if (module != null) { setText(module, value.toString()); } @@ -1333,9 +1333,9 @@ public class OverviewPage extends MavenPomEditorPage { //same with MavenModuleWizard's module adding operation.. public void process(Document document) { Element root = document.getDocumentElement(); - Element modules = getChild(root, "modules"); - if (findChild(modules, "module", textEquals(moduleName)) == null) { - format(createElementWithText(modules, "module", moduleName)); + Element modules = getChild(root, MODULES); + if (findChild(modules, MODULE, textEquals(moduleName)) == null) { + format(createElementWithText(modules, MODULE, moduleName)); } } })); |