]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Add choosing workign directory
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 26 Jul 2009 20:18:28 +0000 (20:18 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 26 Jul 2009 20:18:28 +0000 (20:18 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2772 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

eclipse/plugins/org.argeo.slc.ui.launch/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.ui.launch/src/main/java/org/argeo/slc/ui/launch/osgi/SlcLaunchShortcut.java

index 38b7b7f7b51c862130156b4da55fcd6d04b921db..3a344ef51526802fab8ed706dbda737dcb17cdfa 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: SLC UI Launch
 Bundle-SymbolicName: org.argeo.slc.ui.launch;singleton:=true
-Bundle-Version: 0.11.3.D20090429_1550
+Bundle-Version: 0.11.4.D20090726_2143
 Bundle-Activator: org.argeo.slc.ui.launch.SlcUiLaunchPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
index 4b596300637e36a9245d6bb01caaa7f3ffc5a624..c135f42a2e14ee568e3ab0d8f0519c6f0301ebf1 100644 (file)
@@ -7,12 +7,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
-import org.argeo.slc.ui.launch.SlcUiLaunchPlugin;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -21,6 +21,8 @@ import org.eclipse.pde.core.plugin.IPluginModelBase;
 import org.eclipse.pde.core.plugin.PluginRegistry;
 import org.eclipse.pde.ui.launcher.IPDELauncherConstants;
 import org.eclipse.pde.ui.launcher.OSGiLaunchShortcut;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 
 public class SlcLaunchShortcut extends OSGiLaunchShortcut {
@@ -82,10 +84,28 @@ public class SlcLaunchShortcut extends OSGiLaunchShortcut {
                        // Update other default information
                        configuration.setAttribute(
                                        IPDELauncherConstants.DEFAULT_AUTO_START, false);
+                       configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA,
+                                       true);
+                       String defaultVmArgs = configuration.getAttribute(
+                                       IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
+                       configuration.setAttribute(
+                                       IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
+                                       defaultVmArgs + " -Xmx256m");
+
+                       // Choose working directory
+                       Shell shell = Display.getCurrent().getActiveShell();
+                       DirectoryDialog dirDialog = new DirectoryDialog(shell);
+                       dirDialog.setText("Working Directory");
+                       dirDialog.setMessage("Choose the working directory");
+                       String dir = dirDialog.open();
+                       if (dir != null)
+                               configuration
+                                               .setAttribute(
+                                                               IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
+                                                               dir);
 
                } catch (CoreException e) {
-                       Shell shell = SlcUiLaunchPlugin.getDefault().getWorkbench()
-                                       .getActiveWorkbenchWindow().getShell();
+                       Shell shell = Display.getCurrent().getActiveShell();
                        ErrorDialog.openError(shell, "Error",
                                        "Cannot execute SLC launch shortcut", e.getStatus());
                }