Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-02-08 16:17:36 -0500
committerIgor Fedorenko2011-02-08 16:17:36 -0500
commit338bfc4789d84256bbb00d622d4699a8fed31499 (patch)
tree10c0bacd0282f08c1caa23d060b18696537b13c7 /org.eclipse.m2e.launching
parent5f53cd39a20f30b84cd3ee25b9388fc85ec279aa (diff)
downloadm2e-core-338bfc4789d84256bbb00d622d4699a8fed31499.tar.gz
m2e-core-338bfc4789d84256bbb00d622d4699a8fed31499.tar.xz
m2e-core-338bfc4789d84256bbb00d622d4699a8fed31499.zip
336555 moved core ui code to a separate bundle
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.launching')
-rw-r--r--org.eclipse.m2e.launching/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java24
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java27
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java3
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java22
5 files changed, 54 insertions, 26 deletions
diff --git a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
index 2b972fcd..774b5eab 100644
--- a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
@@ -23,10 +23,12 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.jdt.junit,
org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
- com.ibm.icu;bundle-version="4.0.1"
+ com.ibm.icu;bundle-version="4.0.1",
+ org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)"
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.m2e.actions;x-internal:=true
Bundle-Activator: org.eclipse.m2e.internal.launch.MavenLaunchPlugin
+Import-Package: org.slf4j
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
index 894f4619..39fdcc83 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
@@ -45,23 +45,23 @@ import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenLogger;
-import org.eclipse.m2e.internal.launch.Messages;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.internal.launch.LaunchingUtils;
+import org.eclipse.m2e.internal.launch.Messages;
import org.eclipse.m2e.ui.internal.launch.MavenLaunchMainTab;
-import org.eclipse.m2e.core.util.Util;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
/**
@@ -158,7 +158,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
}
private Shell getShell() {
- return MavenPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ return M2EUIPluginActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
}
private IContainer findPomXmlBasedir(IContainer dir) {
@@ -282,7 +282,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
ArrayList<ILaunchConfiguration> matchingConfigs = new ArrayList<ILaunchConfiguration>();
for(ILaunchConfiguration configuration : launchConfigurations) {
// substitute variables
- String workDir = Util.substituteVar(configuration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR, (String) null));
+ String workDir = LaunchingUtils.substituteVar(configuration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR, (String) null));
if(workDir == null) {
continue;
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
new file mode 100644
index 00000000..e78938c4
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
@@ -0,0 +1,27 @@
+package org.eclipse.m2e.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LaunchingUtils {
+
+ private static Logger log = LoggerFactory.getLogger(LaunchingUtils.class);
+
+ /**
+ * Substitute any variable
+ */
+ public static String substituteVar(String s) {
+ if(s == null) {
+ return s;
+ }
+ try {
+ return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(s);
+ } catch(CoreException e) {
+ log.error("Could not substitute variable {}.", s, e);
+ return null;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
index d8b1728e..87cab6c4 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -41,7 +41,6 @@ import org.eclipse.m2e.core.core.MavenConsole;
import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
-import org.eclipse.m2e.core.util.Util;
public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaunchConstants {
@@ -190,7 +189,7 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
if(n > -1) {
name = property.substring(0, n);
if(n > 1) {
- value = Util.substituteVar(property.substring(n + 1));
+ value = LaunchingUtils.substituteVar(property.substring(n + 1));
}
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
index 697cdaa7..05f84bd8 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
@@ -36,6 +36,16 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.dialogs.MavenGoalSelectionDialog;
+import org.eclipse.m2e.core.ui.internal.dialogs.MavenPropertyDialog;
+import org.eclipse.m2e.internal.launch.LaunchingUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -60,16 +70,6 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-import org.eclipse.m2e.core.MavenImages;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
-import org.eclipse.m2e.core.core.Messages;
-import org.eclipse.m2e.core.embedder.IMavenConfiguration;
-import org.eclipse.m2e.core.embedder.MavenRuntime;
-import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
-import org.eclipse.m2e.core.ui.dialogs.MavenGoalSelectionDialog;
-import org.eclipse.m2e.core.ui.dialogs.MavenPropertyDialog;
-import org.eclipse.m2e.core.util.Util;
/**
@@ -696,7 +696,7 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
if(name == null || name.trim().length() == 0) {
return false;
}
- String dirName = Util.substituteVar(name);
+ String dirName = LaunchingUtils.substituteVar(name);
if(dirName == null) {
return false;
}

Back to the top