Author: rob.stryker(a)jboss.com
Date: 2008-07-14 18:50:33 -0400 (Mon, 14 Jul 2008)
New Revision: 9136
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
Log:
JBIDE-2483 - decided host must be changed via server editor and runtime config must be
changed via the runtime wizard... not through the launch config.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-07-14
19:26:42 UTC (rev 9135)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-07-14
22:50:33 UTC (rev 9136)
@@ -236,6 +236,10 @@
// misc
public static String ServerSaveFailed;
+ // Launch Config
+ public static String LaunchInvalidConfigChanged;
+ public static String LaunchInvalidHostChanged;
+
static {
NLS.initializeMessages(JBossServerUIPlugin.PLUGIN_ID + ".Messages",
Messages.class);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-07-14
19:26:42 UTC (rev 9135)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-07-14
22:50:33 UTC (rev 9136)
@@ -214,4 +214,8 @@
EditorChangePasswordCommandName=Change Password
# misc
-ServerSaveFailed=Server save failed
\ No newline at end of file
+ServerSaveFailed=Server save failed
+
+#Launch Config
+LaunchInvalidConfigChanged=Configuration can only be changed by modifying the
server's runtime.
+LaunchInvalidHostChanged=The Host can only be changed in the Server Editor.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java 2008-07-14
19:26:42 UTC (rev 9135)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java 2008-07-14
22:50:33 UTC (rev 9136)
@@ -21,6 +21,8 @@
*/
package org.jboss.ide.eclipse.as.ui.launch;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.EnvironmentTab;
@@ -30,6 +32,9 @@
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.ui.Messages;
/**
*
@@ -42,7 +47,7 @@
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[10];
int i = 0;
- tabs[i] = new JavaArgumentsTab();
+ tabs[i] = new JavaArgumentsTabExtension();
tabs[i++].setLaunchConfigurationDialog(dialog);
tabs[i] = new JavaClasspathTab();
tabs[i++].setLaunchConfigurationDialog(dialog);
@@ -60,4 +65,44 @@
System.arraycopy(tabs, 0, tabs2, 0, i);
setTabs(tabs2);
}
+
+ public class JavaArgumentsTabExtension extends JavaArgumentsTab {
+ private String originalHost=null;
+ private String originalConf=null;
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ super.initializeFrom(configuration);
+ try {
+ String startArgs =
configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
(String)null);
+ originalHost = ArgsUtil.getValue(startArgs, "-b", "--host");
+ originalConf = ArgsUtil.getValue(startArgs, "-c",
"--configuration");
+ } catch( CoreException ce ) { }
+ }
+ public boolean isValid(ILaunchConfiguration config) {
+ if( !super.isValid(config))
+ return false;
+ try {
+ String startArgs =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
(String)null);
+ String newHost = ArgsUtil.getValue(startArgs, "-b", "--host");
+ String newConf = ArgsUtil.getValue(startArgs, "-c",
"--configuration");
+ if( newConf == null || !newConf.equals(originalConf))
+ return false;
+ if( newHost == null || !newHost.equals(originalHost))
+ return false;
+ } catch( CoreException ce ) {}
+ return true;
+ }
+ public String getErrorMessage() {
+ String m = super.getErrorMessage();
+ if (m == null) {
+ String startArgs = getAttributeValueFrom(fPrgmArgumentsText);
+ String newHost = ArgsUtil.getValue(startArgs, "-b", "--host");
+ String newConf = ArgsUtil.getValue(startArgs, "-c",
"--configuration");
+ if( newConf == null || !newConf.equals(originalConf))
+ return Messages.LaunchInvalidConfigChanged;
+ if( newHost == null || !newHost.equals(originalHost))
+ return Messages.LaunchInvalidHostChanged;
+ }
+ return m;
+ }
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2008-07-14 19:26:42 UTC
(rev 9135)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2008-07-14 22:50:33 UTC
(rev 9136)
@@ -1,4 +1,2 @@
pluginName=JBoss WTP Server Tools UI Plugin
-jbossLaunchconfigurationTabGroupDescription=Below is the launch configuration properties
\
-for starting, stopping, and polling JBoss Servers for their status.\n If your server
is\
-secure, you will want to ensure the appropriate password parameters are passed in.
\ No newline at end of file
+jbossLaunchconfigurationTabGroupDescription=Below is the launch configuration properties
for starting JBoss Servers.
\ No newline at end of file
Show replies by date