Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-04-18 23:29:50 -0400
committerIgor Fedorenko2014-04-20 19:04:43 -0400
commitf68db7860dd0d0c7b03349e0dc550733a01844fa (patch)
treefae654514ea87b2b7798f224ff5158804f7e592a /org.eclipse.m2e.launching
parent150c457edc53494dd4d48bb72454f998e08473e7 (diff)
downloadm2e-core-f68db7860dd0d0c7b03349e0dc550733a01844fa.tar.gz
m2e-core-f68db7860dd0d0c7b03349e0dc550733a01844fa.tar.xz
m2e-core-f68db7860dd0d0c7b03349e0dc550733a01844fa.zip
432436 ability to add/edit/use customized workspace runtimes
Change-Id: I6eab67cb7ce7791ee912606fe5754e8402e40721 Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.launching')
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java
index fe8aafc1..297944f9 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -24,6 +25,7 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -50,7 +52,9 @@ public class MavenRuntimeSelector extends Composite {
ComboViewer runtimeComboViewer;
- private static final MavenRuntimeManager runtimeManager = MavenPlugin.getMavenRuntimeManager();
+ private static MavenRuntimeManager getRuntimeManager() {
+ return MavenPlugin.getMavenRuntimeManager();
+ }
public MavenRuntimeSelector(final Composite mainComposite) {
super(mainComposite, SWT.NONE);
@@ -115,14 +119,17 @@ public class MavenRuntimeSelector extends Composite {
configureRuntimesButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnConfigure);
configureRuntimesButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- PreferencesUtil.createPreferenceDialogOn(mainComposite.getShell(),
- "org.eclipse.m2e.core.preferences.MavenInstallationsPreferencePage", null, null).open(); //$NON-NLS-1$
- setInput();
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(mainComposite.getShell(),
+ "org.eclipse.m2e.core.preferences.MavenInstallationsPreferencePage", null, null); //$NON-NLS-1$
+ if(dialog.open() == Window.OK) {
+ setInput();
+ }
}
});
}
protected void setInput() {
+ MavenRuntimeManager runtimeManager = getRuntimeManager();
runtimeComboViewer.setInput(runtimeManager.getMavenRuntimes());
runtimeComboViewer.setSelection(new StructuredSelection(runtimeManager.getDefaultRuntime()));
}
@@ -147,7 +154,7 @@ public class MavenRuntimeSelector extends Composite {
} catch(CoreException ex) {
// TODO log
}
- MavenRuntime runtime = runtimeManager.getRuntimeByName(name);
+ MavenRuntime runtime = getRuntimeManager().getRuntimeByName(name);
if(runtime != null) {
setSelectRuntime(runtime);
}

Back to the top