Author: rob.stryker(a)jboss.com
Date: 2012-04-19 19:24:21 -0400 (Thu, 19 Apr 2012)
New Revision: 40366
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java
Log:
JBIDE-11587
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-04-19
23:19:28 UTC (rev 40365)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-04-19
23:24:21 UTC (rev 40366)
@@ -45,15 +45,19 @@
boolean detectStartupCommand =
RSELaunchConfigProperties.isDetectStartupCommand(launchConfig, true);
String currentStartupCmd = RSELaunchConfigProperties.getStartupCommand(launchConfig);
+ String defaultStartup = getLaunchCommand(jbossServer, jbossRuntime);
if( detectStartupCommand || !isSet(currentStartupCmd)) {
- RSELaunchConfigProperties.setStartupCommand(getLaunchCommand(jbossServer,
jbossRuntime), launchConfig);
+ RSELaunchConfigProperties.setStartupCommand(defaultStartup, launchConfig);
}
-
+ RSELaunchConfigProperties.setDefaultStartupCommand(defaultStartup, launchConfig);
+
boolean detectShutdownCommand =
RSELaunchConfigProperties.isDetectShutdownCommand(launchConfig, true);
String currentShutdownCmd =
RSELaunchConfigProperties.getShutdownCommand(launchConfig);
+ String defaultShutdownCommand = getShutdownCommand(jbossServer, jbossRuntime);
if( detectShutdownCommand || !isSet(currentShutdownCmd)) {
- RSELaunchConfigProperties.setShutdownCommand(getShutdownCommand(jbossServer,
jbossRuntime), launchConfig);
+ RSELaunchConfigProperties.setShutdownCommand(defaultShutdownCommand, launchConfig);
}
+ RSELaunchConfigProperties.setDefaultShutdownCommand(defaultShutdownCommand,
launchConfig);
}
protected String getShutdownCommand(JBossServer jbossServer, IJBossServerRuntime
jbossRuntime) throws CoreException {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java 2012-04-19
23:19:28 UTC (rev 40365)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java 2012-04-19
23:24:21 UTC (rev 40366)
@@ -20,6 +20,8 @@
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
@@ -53,7 +55,6 @@
public void createControl(Composite parent) {
createUI(parent);
- addListeners();
}
public void createUI(Composite parent) {
@@ -68,7 +69,7 @@
autoStartArgs.setText(RSEUIMessages.RSE_AUTOMATICALLY_CALCULATE);
startText = new Text(startGroup, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 75;
+ gd.heightHint = 120;
gd.widthHint = 100;
startText.setLayoutData(gd);
@@ -102,6 +103,7 @@
RSEUIPlugin.getLog().log(new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID,
"Error loading details from launch configuration", ce));
}
}
+ persistInWorkingCopy(((ILaunchConfigurationWorkingCopy)initialConfig), true);
}
public void widgetDefaultSelected(SelectionEvent e) {
}});
@@ -120,9 +122,17 @@
RSEUIPlugin.getLog().log(new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID,
"Error loading details from launch configuration", ce));
}
}
+ persistInWorkingCopy(((ILaunchConfigurationWorkingCopy)initialConfig), true);
}
public void widgetDefaultSelected(SelectionEvent e) {
}});
+
+ ModifyListener textListener = new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ persistInWorkingCopy(((ILaunchConfigurationWorkingCopy)initialConfig), true);
+ }};
+ startText.addModifyListener(textListener);
+ stopText.addModifyListener(textListener);
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
@@ -151,12 +161,19 @@
// in which case it's a big eclipse issue
RSEUIPlugin.getLog().log(new Status(IStatus.ERROR, RSEUIPlugin.PLUGIN_ID, "Error
loading details from launch configuration", ce));
}
+ addListeners();
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ persistInWorkingCopy(configuration, false);
+ }
+
+ protected void persistInWorkingCopy(ILaunchConfigurationWorkingCopy configuration,
boolean updateButtons) {
RSELaunchConfigProperties.setStartupCommand(startText.getText(), configuration);
RSELaunchConfigProperties.setShutdownCommand(stopText.getText(), configuration);
RSELaunchConfigProperties.setDetectStartupCommand(autoStartArgs.getSelection(),
configuration);
RSELaunchConfigProperties.setDetectShutdownCommand(autoStopArgs.getSelection(),
configuration);
+ if( updateButtons)
+ getLaunchConfigurationDialog().updateButtons();
}
public String getName() {
return RSEUIMessages.RSE_REMOTE_LAUNCH;