Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.releng.tools')
-rw-r--r--plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
new file mode 100644
index 00000000000..94fdc097862
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.releng.tools/src/org/eclipse/papyrus/releng/tools/internal/popup/actions/PomPropertiesUpdater.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - Support updating of multiple selected files
+ *****************************************************************************/
+package org.eclipse.papyrus.releng.tools.internal.popup.actions;
+
+import java.util.Map;
+
+import org.eclipse.b3.aggregator.Contribution;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.swt.widgets.Shell;
+import org.w3c.dom.Node;
+
+
+public class PomPropertiesUpdater extends DependencyUpdater {
+
+ public PomPropertiesUpdater() {
+ super();
+ }
+
+ @Override
+ public boolean canUpdate(IFile file) {
+ return "xml".equals(file.getFileExtension()) && file.getName().contains("pom"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ protected String getXpath() {
+ return "/project/properties/*[substring(name(), string-length(name()) - 8) = '.repo.url']"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected String getCurrentLocation(Node uri) {
+ return uri.getTextContent();
+ }
+
+ @Override
+ protected void updateUri(Node uri, String location) {
+ uri.setTextContent(location);
+ }
+
+}

Back to the top