Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2011-02-11 05:04:16 -0500
committerMilos Kleint2011-02-11 05:15:27 -0500
commit147f378f7b976e171f0aab72058cf14a25b2402c (patch)
treea8886491936ae80c9837b2e4996f640baa620a0f /org.eclipse.m2e.editor.xml
parent4115ff1f0df6a75bc8df2402fd78417672517f3e (diff)
downloadm2e-core-147f378f7b976e171f0aab72058cf14a25b2402c.tar.gz
m2e-core-147f378f7b976e171f0aab72058cf14a25b2402c.tar.xz
m2e-core-147f378f7b976e171f0aab72058cf14a25b2402c.zip
move pomedits class to core.ui plugin
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.java18
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java5
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java6
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java500
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java16
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java20
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java2
7 files changed, 32 insertions, 535 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 94fcfac6..ab812e06 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
@@ -11,13 +11,13 @@
package org.eclipse.m2e.editor.xml;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.elementAtOffset;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.findChild;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.format;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.getChild;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.insertAt;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.performOnDOMDocument;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.setText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.elementAtOffset;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.insertAt;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.setText;
import java.io.IOException;
@@ -46,9 +46,9 @@ import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.m2e.core.index.IIndex;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
import org.eclipse.m2e.editor.xml.internal.Messages;
-import org.eclipse.m2e.editor.xml.internal.PomEdits.Operation;
-import org.eclipse.m2e.editor.xml.internal.PomEdits.OperationTuple;
import org.eclipse.m2e.editor.xml.internal.XmlUtils;
public class InsertArtifactProposal implements ICompletionProposal, ICompletionProposalExtension4, ICompletionProposalExtension5 {
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
index 128be22a..8ff5e968 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
@@ -44,7 +44,12 @@ import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.internal.markers.IEditorMarkerService;
import org.eclipse.m2e.core.internal.markers.IMarkerLocationService;
import org.eclipse.m2e.core.internal.markers.IMavenMarkerManager;
+<<<<<<< HEAD
import org.eclipse.m2e.editor.xml.internal.PomEdits.Matcher;
+=======
+
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+>>>>>>> move pomedits class to core.ui plugin
/**
* a service impl used by the core module to improve marker locations and addition of our own markers
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java
index 8ecd532a..82c6e266 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java
@@ -15,6 +15,12 @@ import org.w3c.dom.Node;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+/**
+ *A non-editing operation on top of the DOM document, to be used with XmlUtils.performOnRootElement and XmlUtils.performOnCurrentElement
+ * @author mkleint
+ *
+ * @param <T>
+ */
public interface NodeOperation<T extends Node> {
void process(T node, IStructuredDocument structuredDocument);
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java
deleted file mode 100644
index 82c28016..00000000
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.m2e.editor.xml.internal;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-
-/**
- * this class contains tools for editing the pom files using dom tree operations.
- * @author mkleint
- *
- */
-public class PomEdits {
-
-
- public static Element findChild(Element parent, String name) {
- if (parent == null) {
- return null;
- }
- NodeList rootList = parent.getChildNodes();
- for (int i = 0; i < rootList.getLength(); i++) {
- Node nd = rootList.item(i);
- if (nd instanceof Element) {
- Element el = (Element)nd;
- if (name.equals(el.getNodeName())) {
- return el;
- }
- }
- }
- return null;
- }
-
- public static List<Element> findChilds(Element parent, String name) {
- List<Element> toRet = new ArrayList<Element>();
- if (parent != null) {
- NodeList rootList = parent.getChildNodes();
- for (int i = 0; i < rootList.getLength(); i++) {
- Node nd = rootList.item(i);
- if (nd instanceof Element) {
- Element el = (Element)nd;
- if (name.equals(el.getNodeName())) {
- toRet.add(el);
- }
- }
- }
- }
- return toRet;
- }
-
- public static String getTextValue(Node element) {
- if (element == null) return null;
- StringBuffer buff = new StringBuffer();
- NodeList list = element.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child instanceof Text) {
- Text text = (Text)child;
- buff.append(text.getData());
- }
- }
- return buff.toString();
- }
-
- /**
- * finds exactly one (first) occurence of child element with the given name (eg. dependency)
- * that fulfills conditions expressed by the Matchers (eg. groupId/artifactId match)
- * @param parent
- * @param name
- * @param matchers
- * @return
- */
- public static Element findChild(Element parent, String name, Matcher... matchers) {
- OUTTER: for (Element el : findChilds(parent, name)) {
- for (Matcher match : matchers) {
- if (!match.matches(el)) {
- continue OUTTER;
- }
- }
- return el;
- }
- return null;
- }
-
- /**
- * node is expected to be the node containing <dependencies> node, so <project>, <dependencyManagement> etc..
- * @param node
- * @return
- */
- public static List<Element> findDependencies(Element node) {
- return findChilds(findChild(node, "dependencies"), "dependency");
- }
-
- /** for the root <project> node (or equivalent) finds or creates the <dm> and <dependencies> sections.
- * returns the <dependencies> section element.
- *
- * @param root
- * @return
- */
- public static Element getManagedDependencies(Element root) {
- Element toRet = getChild(root, "dependencyManagement");
- toRet = getChild(toRet, "dependencies");
- return toRet;
- }
-
- /**
- * creates and adds new dependency to the parent.
- * @param parentList
- * @param groupId null or value
- * @param artifactId never null
- * @param version null or value
- * @return
- */
- public static Element createDependency(Element parentList, String groupId, String artifactId, String version) {
- Document doc = parentList.getOwnerDocument();
- Element dep = doc.createElement("dependency");
- parentList.appendChild(dep);
-
- if (groupId != null) {
- createElementWithText(dep, "groupId", groupId);
- }
- createElementWithText(dep, "artifactId", artifactId);
- if (version != null) {
- createElementWithText(dep, "version", version);
- }
- format(dep);
- return dep;
- }
-
- /**
- * creates and adds new plugin to the parent. Formats the result.
- * @param parentList
- * @param groupId null or value
- * @param artifactId never null
- * @param version null or value
- * @return
- */
- public static Element createPlugin(Element parentList, String groupId, String artifactId, String version) {
- Document doc = parentList.getOwnerDocument();
- Element plug = doc.createElement("plugin");
- parentList.appendChild(plug);
-
- if (groupId != null) {
- createElementWithText(plug, "groupId", groupId);
- }
- createElementWithText(plug, "artifactId", artifactId);
- if (version != null) {
- createElementWithText(plug, "version", version);
- }
- format(plug);
- return plug;
- }
-
- /**
- * helper method, creates a subelement with text embedded. does not format the result.
- * @param parent
- * @param name
- * @param value
- * @return
- */
- public static Element createElementWithText(Element parent, String name, String value) {
- Document doc = parent.getOwnerDocument();
- Element newElement = doc.createElement(name);
- parent.appendChild(newElement);
- newElement.appendChild(doc.createTextNode(value));
- return newElement;
- }
-
- /**
- * sets text value to the given element. any existing text children are removed and replaced by this new one.
- * @param element
- * @param value
- */
- public static void setText(Element element, String value) {
- NodeList list = element.getChildNodes();
- List<Node> toRemove = new ArrayList<Node>();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- if (child instanceof Text) {
- toRemove.add(child);
- }
- }
- for (Node rm : toRemove) {
- element.removeChild(rm);
- }
- Document doc = element.getOwnerDocument();
- element.appendChild(doc.createTextNode(value));
- }
-
-
- /**
- * unlike the findChild() equivalent, this one creates the element if not present and returns it.
- * Therefore it shall only be invoked within the PomEdits.Operation
- * @param parent
- * @param names chain of element names to find/create
- * @return
- */
- public static Element getChild(Element parent, String... names) {
- Element toFormat = null;
- Element toRet = null;
- if (names.length == 0) {
- throw new IllegalArgumentException("At least one child name has to be specified");
- }
- for (String name : names) {
- toRet = findChild(parent, name);
- if (toRet == null) {
- toRet = parent.getOwnerDocument().createElement(name);
- parent.appendChild(toRet);
- if (toFormat == null) {
- toFormat = toRet;
- }
- }
- parent = toRet;
- }
- if (toFormat != null) {
- format(toFormat);
- }
- return toRet;
- }
-
- /**
- * proper remove of a child element
- * @param parent
- * @param name
- */
- public static void removeChild(Element parent, String name) {
- Element child = PomEdits.findChild(parent, name);
- if (child != null) {
- Node prev = child.getPreviousSibling();
- if (prev instanceof Text) {
- Text txt = (Text)prev;
- int lastnewline = txt.getData().lastIndexOf("\n");
- txt.setData(txt.getData().substring(0, lastnewline));
- }
- parent.removeChild(child);
- }
- }
-
- public static Element insertAt(Element newElement, int offset) {
- Document doc = newElement.getOwnerDocument();
- if (doc instanceof IDOMDocument) {
- IDOMDocument domDoc = (IDOMDocument) doc;
- IndexedRegion ir = domDoc.getModel().getIndexedRegion(offset);
- Node parent = ((Node)ir).getParentNode();
- if (ir instanceof Text) {
- Text txt = (Text)ir;
- String data = txt.getData();
- int dataSplitIndex = offset - ir.getStartOffset();
- String beforeText = data.substring(0, dataSplitIndex);
- String afterText = data.substring(dataSplitIndex);
- Text after = doc.createTextNode(afterText);
- Text before = doc.createTextNode(beforeText);
- parent.replaceChild(after, txt);
- parent.insertBefore(newElement, after);
- parent.insertBefore(before, newElement);
- } else {
- parent.appendChild(newElement);
- }
- } else {
- throw new IllegalArgumentException();
- }
- return newElement;
- }
-
- /**
- * finds the element at offset, if other type of node at offset, will return it's parent element (if any)
- * @param doc
- * @param offset
- * @return
- */
- public static Element elementAtOffset(Document doc, int offset) {
- if (doc instanceof IDOMDocument) {
- IDOMDocument domDoc = (IDOMDocument) doc;
- IndexedRegion ir = domDoc.getModel().getIndexedRegion(offset);
- if (ir instanceof Element) {
- return (Element) ir;
- } else {
- Node parent = ((Node)ir).getParentNode();
- if (parent instanceof Element) {
- return (Element) parent;
- }
- }
- }
- return null;
- }
-
- /**
- * formats the node (and content). please make sure to only format the node you have created..
- * @param newNode
- */
- public static void format(Node newNode) {
- if (newNode.getParentNode() != null && newNode.equals(newNode.getParentNode().getLastChild())) {
- //add a new line to get the newly generated content correctly formatted.
- newNode.getParentNode().appendChild(newNode.getParentNode().getOwnerDocument().createTextNode("\n"));
- }
- FormatProcessorXML formatProcessor = new FormatProcessorXML();
- //ignore any line width settings, causes wrong formatting of <foo>bar</foo>
- formatProcessor.getFormatPreferences().setLineWidth(2000);
- formatProcessor.formatNode(newNode);
- }
-
- /**
- * performs an modifying operation on top the
- * @param file
- * @param operation
- * @throws IOException
- * @throws CoreException
- */
- public static void performOnDOMDocument(PomEdits.OperationTuple... fileOperations) throws IOException, CoreException {
- for(OperationTuple tuple : fileOperations) {
- IDOMModel domModel = null;
- //TODO we might want to attempt iterating opened editors and somehow initialize those
- // that were not yet initialized. Then we could avoid saving a file that is actually opened, but was never used so far (after restart)
- try {
- domModel = tuple.getFile() != null
- ? (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(tuple.getFile())
- : (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(tuple.getDocument()); //existing shall be ok here..
- //let the model know we make changes
- domModel.aboutToChangeModel();
- IStructuredTextUndoManager undo = domModel.getStructuredDocument().getUndoManager();
- DocumentRewriteSession session = null;
- //let the document know we make changes
- if (domModel.getStructuredDocument() instanceof IDocumentExtension4) {
- IDocumentExtension4 ext4 = (IDocumentExtension4)domModel.getStructuredDocument();
- session = ext4.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED_SMALL);
- }
- undo.beginRecording(domModel);
- try {
- tuple.getOperation().process(domModel.getDocument());
- } finally {
- undo.endRecording(domModel);
- if (session != null && domModel.getStructuredDocument() instanceof IDocumentExtension4) {
- IDocumentExtension4 ext4 = (IDocumentExtension4)domModel.getStructuredDocument();
- ext4.stopRewriteSession(session);
- }
- domModel.changedModel();
- }
- } finally {
- if(domModel != null) {
-
- //for ducuments saving shall only happen when the model is not held elsewhere (eg. in opened view)
- //for files, save always
- if(tuple.getFile() != null || domModel.getReferenceCountForEdit() == 1) {
- domModel.save();
- }
- domModel.releaseFromEdit();
- }
- }
- }
- }
-
- public static final class OperationTuple {
- private final PomEdits.Operation operation;
- private final IFile file;
- private final IDocument document;
-
- /**
- * operation on top of IFile is always saved
- * @param file
- * @param operation
- */
- public OperationTuple(IFile file, PomEdits.Operation operation) {
- assert file != null;
- assert operation != null;
- this.file = file;
- this.operation = operation;
- document = null;
- }
- /**
- * operation on top of IDocument is only saved when noone else is editing the document.
- * @param document
- * @param operation
- */
- public OperationTuple(IDocument document, PomEdits.Operation operation) {
- assert operation != null;
- this.document = document;
- this.operation = operation;
- file = null;
- }
-
-
- public IFile getFile() {
- return file;
- }
-
- public PomEdits.Operation getOperation() {
- return operation;
- }
-
- public IDocument getDocument() {
- return document;
- }
-
- }
-
- /**
- * operation to perform on top of the DOM document. see performOnDOMDocument()
- * @author mkleint
- *
- */
- public static interface Operation {
- void process(Document document);
- }
-
- /**
- * an Operation instance that aggregates multiple operations and performs then in given order.
- * @author mkleint
- *
- */
- public static final class CompoundOperation implements Operation {
-
- private final Operation[] operations;
-
- public CompoundOperation(Operation... operations) {
- this.operations = operations;
- }
-
- public void process(Document document) {
- for (Operation oper : operations) {
- oper.process(document);
- }
- }
-
- }
-
- /**
- * an interface for identifying child elements that fulfill conditions expressed by the matcher.
- * @author mkleint
- *
- */
- public static interface Matcher {
- /**
- * returns true if the given element matches the condition.
- * @param child
- * @return
- */
- boolean matches(Element element);
- }
-
- public static Matcher childEquals(final String elementName, final String matchingValue) {
- return new Matcher() {
- public boolean matches(Element child) {
- String toMatch = PomEdits.getTextValue(PomEdits.findChild(child, elementName));
- return toMatch != null && toMatch.trim().equals(matchingValue);
- }
- };
- }
-
- public static Matcher textEquals(final String matchingValue) {
- return new Matcher() {
- public boolean matches(Element child) {
- String toMatch = PomEdits.getTextValue(child);
- return toMatch != null && toMatch.trim().equals(matchingValue);
- }
- };
- }
-
- public static Matcher childMissingOrEqual(final String elementName, final String matchingValue) {
- return new Matcher() {
- public boolean matches(Element child) {
- Element match = PomEdits.findChild(child, elementName);
- if (match == null) {
- return true;
- }
- String toMatch = PomEdits.getTextValue(match);
- return toMatch != null && toMatch.trim().equals(matchingValue);
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
index 31251f6c..924bf505 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
@@ -46,6 +46,7 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits;
/**
*
* @author mkleint
@@ -131,21 +132,6 @@ public class XmlUtils {
}
return null;
}
- /**
- * you are encouraged to use the extractMavenProject(ITextViewer) method instead
- * @param project
- * @return
- */
- public static MavenProject extractMavenProject(IProject project) {
- //TODO we might want to eventually reduce our dependency on IProject
- if (project != null) {
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getProject(project);
- if (facade != null) {
- return facade.getMavenProject();
- }
- }
- return null;
- }
/**
* converts an InputLocation to a file path on the local disk, null if not available.
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
index cfd82e1f..c9e75330 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
@@ -11,15 +11,15 @@
package org.eclipse.m2e.editor.xml.internal.lifecycle;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.childEquals;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.createElementWithText;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.createPlugin;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.findChild;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.findChilds;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.format;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.getChild;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.getTextValue;
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.setText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.childEquals;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElementWithText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createPlugin;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChilds;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getTextValue;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.setText;
import java.util.ArrayList;
import java.util.Arrays;
@@ -36,7 +36,7 @@ import org.w3c.dom.Element;
import org.eclipse.m2e.core.internal.lifecycle.LifecycleMappingFactory;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionAction;
-import org.eclipse.m2e.editor.xml.internal.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
public class LifecycleMappingOperation implements Operation {
private static final Logger log = LoggerFactory.getLogger(LifecycleMappingOperation.class);
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
index b241930b..73367286 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
@@ -23,8 +23,8 @@ import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionAction;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits;
import org.eclipse.m2e.editor.xml.internal.Messages;
-import org.eclipse.m2e.editor.xml.internal.PomEdits;
public class LifecycleMappingProposal implements ICompletionProposal, ICompletionProposalExtension5, IMarkerResolution {
private static final Logger log = LoggerFactory.getLogger(LifecycleMappingProposal.class);

Back to the top