JBoss Tools SVN: r32416 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-28 12:30:57 -0400 (Tue, 28 Jun 2011)
New Revision: 32416
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
Log:
[JBIDE-9263] restored missing setupLaunchConfig functionality
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 16:10:31 UTC (rev 32415)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 16:30:57 UTC (rev 32416)
@@ -23,7 +23,6 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.shells.IHostOutput;
import org.eclipse.rse.services.shells.IHostShell;
@@ -44,7 +43,6 @@
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -150,7 +148,17 @@
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server)
throws CoreException {
- new RSELaunchConfigurator(server).configure(workingCopy);
+ boolean detectStartupCommand = RSELaunchConfigUtils.isDetectStartupCommand(workingCopy, true);
+ String currentStartupCmd = RSELaunchConfigUtils.getStartupCommand(workingCopy);
+ if( detectStartupCommand || currentStartupCmd == null || "".equals(currentStartupCmd)) {
+ RSELaunchConfigUtils.setStartupCommand(getDefaultLaunchCommand(workingCopy), workingCopy);
+ }
+
+ boolean detectShutdownCommand = RSELaunchConfigUtils.isDetectShutdownCommand(workingCopy, true);
+ String currentStopCmd = RSELaunchConfigUtils.getShutdownCommand(workingCopy);
+ if( detectShutdownCommand || currentStopCmd == null || "".equals(currentStopCmd)) {
+ RSELaunchConfigUtils.setShutdownCommand(getDefaultStopCommand(server), workingCopy);
+ }
/*
* /usr/lib/jvm/jre/bin/java -Dprogram.name=run.sh -server -Xms1530M -Xmx1530M
* -XX:PermSize=425M -XX:MaxPermSize=425M -Dorg.jboss.resolver.warning=true
14 years, 9 months
JBoss Tools SVN: r32415 - in trunk/forge/plugins/org.jboss.tools.forge.ui: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-28 12:10:31 -0400 (Tue, 28 Jun 2011)
New Revision: 32415
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF
trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties
Log:
removed unnecessary dependency on jline.jar
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF 2011-06-28 16:02:27 UTC (rev 32414)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/META-INF/MANIFEST.MF 2011-06-28 16:10:31 UTC (rev 32415)
@@ -18,5 +18,4 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.jboss.tools.forge.ForgeUIPlugin
-Bundle-ClassPath: .,
- lib/jline.jar
+Bundle-ClassPath: .
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties 2011-06-28 16:02:27 UTC (rev 32414)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties 2011-06-28 16:10:31 UTC (rev 32415)
@@ -1,8 +1,6 @@
output.. = bin/
bin.includes = META-INF/,\
plugin.xml,\
- lib/,\
icons/,\
- .,\
- lib/jline.jar
+ .
source.. = src/
14 years, 9 months
JBoss Tools SVN: r32414 - in trunk/forge/plugins/org.jboss.tools.forge.ui: src/org/jboss/tools/forge/launching and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-28 12:02:27 -0400 (Tue, 28 Jun 2011)
New Revision: 32414
Removed:
trunk/forge/plugins/org.jboss.tools.forge.ui/lib/
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/launching/ForgeRuntime.java
Log:
remove the forge jar files from the org.jboss.tools.forge.ui plugin; the embedded runtime is now located in the org.jboss.tools.forge.runtime plugin.
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/launching/ForgeRuntime.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/launching/ForgeRuntime.java 2011-06-28 16:00:58 UTC (rev 32413)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/launching/ForgeRuntime.java 2011-06-28 16:02:27 UTC (rev 32414)
@@ -31,6 +31,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -161,7 +162,7 @@
private static void createInitialInstallations() {
try {
- File file = FileLocator.getBundleFile(ForgeUIPlugin.getDefault().getBundle());
+ File file = FileLocator.getBundleFile(Platform.getBundle("org.jboss.tools.forge.runtime"));
defaultInstallation = new ForgeInstallation("embedded", file.getAbsolutePath());
installations = new ArrayList<ForgeInstallation>();
installations.add(defaultInstallation);
14 years, 9 months
JBoss Tools SVN: r32413 - trunk/forge/plugins/org.jboss.tools.forge.runtime/lib.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-28 12:00:58 -0400 (Tue, 28 Jun 2011)
New Revision: 32413
Added:
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-event-bus.jar
Removed:
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-reference-guide.war
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/cal10n-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-dev-plugins.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-git-tools.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-javaee-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-javaee-impl.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-maven-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-java-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-java.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-xml.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-project-model-maven.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-scaffold-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-scaffold-plugins.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-shell-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-shell.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/metawidget-forge.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/shrinkwrap-descriptors-api.jar
trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/shrinkwrap-descriptors-impl.jar
Log:
update the forge runtime to 1.0.0.alpha4
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/cal10n-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-dev-plugins.jar
===================================================================
(Binary files differ)
Added: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-event-bus.jar
===================================================================
(Binary files differ)
Property changes on: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-event-bus.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-git-tools.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-javaee-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-javaee-impl.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-maven-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-java-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-java.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-parser-xml.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-project-model-maven.jar
===================================================================
(Binary files differ)
Deleted: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-reference-guide.war
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-scaffold-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-scaffold-plugins.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-shell-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/forge-shell.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/metawidget-forge.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/shrinkwrap-descriptors-api.jar
===================================================================
(Binary files differ)
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/lib/shrinkwrap-descriptors-impl.jar
===================================================================
(Binary files differ)
14 years, 9 months
JBoss Tools SVN: r32412 - trunk/forge/features/org.jboss.tools.forge.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-28 11:59:12 -0400 (Tue, 28 Jun 2011)
New Revision: 32412
Modified:
trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
Log:
include org.jboss.tools.forge.runtime in feature
Modified: trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
===================================================================
--- trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-06-28 15:57:28 UTC (rev 32411)
+++ trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-06-28 15:59:12 UTC (rev 32412)
@@ -24,6 +24,13 @@
id="org.jboss.tools.forge.ui"
download-size="0"
install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.forge.runtime"
+ download-size="0"
+ install-size="0"
version="0.0.0"/>
</feature>
14 years, 9 months
JBoss Tools SVN: r32411 - trunk/forge/plugins.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-06-28 11:57:28 -0400 (Tue, 28 Jun 2011)
New Revision: 32411
Modified:
trunk/forge/plugins/pom.xml
Log:
include org.jboss.tools.forge.runtime and org.jboss.tools.forge.ui
Modified: trunk/forge/plugins/pom.xml
===================================================================
--- trunk/forge/plugins/pom.xml 2011-06-28 15:36:32 UTC (rev 32410)
+++ trunk/forge/plugins/pom.xml 2011-06-28 15:57:28 UTC (rev 32411)
@@ -13,9 +13,8 @@
<name>forge.plugins</name>
<packaging>pom</packaging>
<modules>
- <module>org.jboss.tools.forge.runtime</module>
- <!-- <module>org.jboss.tools.forge.core</module>
- <module>org.jboss.tools.forge.ui</module> -->
+ <module>org.jboss.tools.forge.runtime</module>
+ <module>org.jboss.tools.forge.ui</module>
</modules>
</project>
14 years, 9 months
JBoss Tools SVN: r32410 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-28 11:36:32 -0400 (Tue, 28 Jun 2011)
New Revision: 32410
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
Log:
[JBIDE-9054] replaced ServerConverter#findServer by ServerConverter#checkedGetJBossServer to have consistent behavior (always throw core exception when jboss server / jboss runtime cannot be found
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2011-06-28 14:59:03 UTC (rev 32409)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2011-06-28 15:36:32 UTC (rev 32410)
@@ -79,7 +79,7 @@
public static ILaunchConfigurationWorkingCopy createLaunchConfiguration(IServer server) throws CoreException {
- JBossServer jbs = ServerConverter.findJBossServer(server.getId());
+ JBossServer jbs = ServerConverter.checkedGetJBossServer(server);
IJBossServerRuntime jbrt = RuntimeUtils.checkedGetJBossServerRuntime(server);
IPath serverHome = ServerUtil.getServerHomePath(jbs);
14 years, 9 months
JBoss Tools SVN: r32409 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-28 10:59:03 -0400 (Tue, 28 Jun 2011)
New Revision: 32409
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
Log:
[JBIDE-9054] created RSEUtils#checkedGetServerHome and refactored code in RSELaunchDelegate accordingly
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 14:57:26 UTC (rev 32408)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 14:59:03 UTC (rev 32409)
@@ -175,7 +175,7 @@
public static String getDefaultStopCommand(IServer server, boolean errorOnFail) throws CoreException {
String rseHome = null;
- rseHome = getServerHome(server, errorOnFail);
+ rseHome = RSEUtils.getRSEHomeDir(server, errorOnFail);
JBossServer jbs = ServerConverter.getJBossServer(server);
String stop = new Path(rseHome)
@@ -188,16 +188,6 @@
return stop;
}
- private static String getServerHome(IServer server, boolean errorOnFail) throws CoreException {
- String rseHome = null;
- if (errorOnFail) {
- rseHome = RSEUtils.checkedGetRSEHomeDir(server);
- } else {
- rseHome = RSEUtils.getRSEHomeDir(server);
- }
- return rseHome == null ? "" : rseHome;
- }
-
public static IServer findServer(ILaunchConfiguration config) throws CoreException {
String serverId = config.getAttribute("server-id", (String)null);
JBossServer jbs = ServerConverter.findJBossServer(serverId);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2011-06-28 14:57:26 UTC (rev 32408)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2011-06-28 14:59:03 UTC (rev 32409)
@@ -44,6 +44,16 @@
return server.getAttribute(RSEUtils.RSE_SERVER_HOST, RSE_SERVER_DEFAULT_HOST);
}
+ public static String getRSEHomeDir(IServer server, boolean errorOnFail) throws CoreException {
+ String rseHome = null;
+ if (errorOnFail) {
+ rseHome = RSEUtils.checkedGetRSEHomeDir(server);
+ } else {
+ rseHome = RSEUtils.getRSEHomeDir(server);
+ }
+ return rseHome == null ? "" : rseHome;
+ }
+
public static String getRSEHomeDir(IServerAttributes server) {
return server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, server.getRuntime().getLocation().toString());
}
14 years, 9 months
JBoss Tools SVN: r32408 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-06-28 10:57:26 -0400 (Tue, 28 Jun 2011)
New Revision: 32408
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
Log:
[JBIDE-9054] created RSEUtils#checkedGetServerHome and refactored code in RSELaunchDelegate accordingly
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 14:53:38 UTC (rev 32407)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-06-28 14:57:26 UTC (rev 32408)
@@ -174,14 +174,8 @@
}
public static String getDefaultStopCommand(IServer server, boolean errorOnFail) throws CoreException {
- String rseHome = server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, (String)null);
- if( errorOnFail && rseHome == null ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
- "Remote Server Home not set.");
- throw new CoreException(s);
- }
- rseHome = rseHome == null ? "" : rseHome;
-
+ String rseHome = null;
+ rseHome = getServerHome(server, errorOnFail);
JBossServer jbs = ServerConverter.getJBossServer(server);
String stop = new Path(rseHome)
@@ -193,6 +187,16 @@
stop += StopLaunchConfiguration.getDefaultArgs(jbs);
return stop;
}
+
+ private static String getServerHome(IServer server, boolean errorOnFail) throws CoreException {
+ String rseHome = null;
+ if (errorOnFail) {
+ rseHome = RSEUtils.checkedGetRSEHomeDir(server);
+ } else {
+ rseHome = RSEUtils.getRSEHomeDir(server);
+ }
+ return rseHome == null ? "" : rseHome;
+ }
public static IServer findServer(ILaunchConfiguration config) throws CoreException {
String serverId = config.getAttribute("server-id", (String)null);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2011-06-28 14:53:38 UTC (rev 32407)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2011-06-28 14:57:26 UTC (rev 32408)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
import org.eclipse.core.runtime.CoreException;
@@ -29,62 +29,74 @@
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
-
/*
* Some of this code will need to be abstracted out from JBossServer
* and turned into a proper API, but in as simple a way as possible
*/
public class RSEUtils {
- public static final String RSE_SERVER_CONFIG = "org.jboss.ide.eclipse.as.rse.core.RSEServerConfig"; //$NON-NLS-1$
- public static final String RSE_SERVER_HOME_DIR = "org.jboss.ide.eclipse.as.rse.core.RSEServerHomeDir"; //$NON-NLS-1$
- public static final String RSE_SERVER_HOST = "org.jboss.ide.eclipse.as.rse.core.ServerHost"; //$NON-NLS-1$
- public static final String RSE_SERVER_DEFAULT_HOST = "Local"; //$NON-NLS-1$
+ public static final String RSE_SERVER_CONFIG = "org.jboss.ide.eclipse.as.rse.core.RSEServerConfig"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOME_DIR = "org.jboss.ide.eclipse.as.rse.core.RSEServerHomeDir"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOST = "org.jboss.ide.eclipse.as.rse.core.ServerHost"; //$NON-NLS-1$
+ public static final String RSE_SERVER_DEFAULT_HOST = "Local"; //$NON-NLS-1$
public static final String RSE_MODE = "rse";
-
+
public static String getRSEConnectionName(IServer server) {
return server.getAttribute(RSEUtils.RSE_SERVER_HOST, RSE_SERVER_DEFAULT_HOST);
}
-
+
public static String getRSEHomeDir(IServerAttributes server) {
return server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, server.getRuntime().getLocation().toString());
}
-
+
+ public static String checkedGetRSEHomeDir(IServerAttributes server) throws CoreException {
+ String serverHome = server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, server.getRuntime().getLocation()
+ .toString());
+ if (serverHome == null) {
+ throw new CoreException(new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
+ "Remote Server Home not set."));
+ }
+ return serverHome;
+ }
+
public static String getRSEConfigName(IServerAttributes server) {
IJBossServerRuntime runtime = RuntimeUtils.getJBossServerRuntime(server);
return server.getAttribute(RSEUtils.RSE_SERVER_CONFIG, runtime.getJBossConfiguration());
}
-
+
public static String getDeployRootFolder(IDeployableServer server) {
return getDeployRootFolder(server.getServer(), server.getDeployLocationType());
}
-
+
/* Copied from JBossServer.getDeployFolder(etc) */
public static String getDeployRootFolder(IServer server, String type) {
- if( JBossServer.DEPLOY_CUSTOM.equals(type)) {
- String val = server.getAttribute(JBossServer.DEPLOY_DIRECTORY, (String)null);
- if( val != null ) {
+ if (JBossServer.DEPLOY_CUSTOM.equals(type)) {
+ String val = server.getAttribute(JBossServer.DEPLOY_DIRECTORY, (String) null);
+ if (val != null) {
IPath val2 = new Path(val);
return makeGlobal(server, val2).toString();
}
// if no value is set, default to metadata
type = JBossServer.DEPLOY_SERVER;
}
- // This should *NOT* happen, so if it does, we will default to server location
- else if( JBossServer.DEPLOY_METADATA.equals(type)) {
+ // This should *NOT* happen, so if it does, we will default to server
+ // location
+ else if (JBossServer.DEPLOY_METADATA.equals(type)) {
type = JBossServer.DEPLOY_SERVER;
- }
- else if(JBossServer.DEPLOY_SERVER.equals(type)) {
- // TODO !!!! Need API (nmaybe in JBossServer?) so servers can override this behavior
- // Cannot move this code to JBossServer because this requires an RSE-specific key!! Damn!
-
- if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
+ }
+ else if (JBossServer.DEPLOY_SERVER.equals(type)) {
+ // TODO !!!! Need API (nmaybe in JBossServer?) so servers can
+ // override this behavior
+ // Cannot move this code to JBossServer because this requires an
+ // RSE-specific key!! Damn!
+
+ if (server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
IPath p = new Path("standalone/deployments/");
return makeGlobal(server, p).toString();
} else {
String loc = IConstants.SERVER;
String config = getRSEConfigName(server);
IPath p = new Path(loc).append(config)
- .append(IJBossRuntimeResourceConstants.DEPLOY);
+ .append(IJBossRuntimeResourceConstants.DEPLOY);
return makeGlobal(server, p).toString();
}
}
@@ -92,17 +104,17 @@
}
public static IPath makeRelative(IServer server, IPath p) {
- if( p.isAbsolute()) {
- if(new Path(getRSEHomeDir(server)).isPrefixOf(p)) {
+ if (p.isAbsolute()) {
+ if (new Path(getRSEHomeDir(server)).isPrefixOf(p)) {
int size = new Path(getRSEHomeDir(server)).toOSString().length();
return new Path(p.toOSString().substring(size)).makeRelative();
}
}
return p;
}
-
+
public static IPath makeGlobal(IServer server, IPath p) {
- if( !p.isAbsolute()) {
+ if (!p.isAbsolute()) {
return new Path(getRSEHomeDir(server)).append(p).makeAbsolute();
}
return p;
@@ -111,22 +123,23 @@
public static IHost findHost(String connectionName) {
// TODO ensure that all hosts are actually loaded, christ
IHost[] allHosts = RSECorePlugin.getTheSystemRegistry().getHosts();
- for( int i = 0; i < allHosts.length; i++ ) {
- if( allHosts[i].getAliasName().equals(connectionName))
+ for (int i = 0; i < allHosts.length; i++) {
+ if (allHosts[i].getAliasName().equals(connectionName))
return allHosts[i];
}
return null;
}
-
+
public static void waitForFullInit() throws CoreException {
try {
RSECorePlugin.waitForInitCompletion();
} catch (InterruptedException e) {
- throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
- "The RSE model initialization has been interrupted."));
+ throw new CoreException(new Status(IStatus.ERROR,
+ org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ "The RSE model initialization has been interrupted."));
}
}
-
+
public static IServer setServerToRSEMode(IServer server, IHost newHost) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(IDeployableServer.SERVER_MODE, RSE_MODE);
@@ -134,8 +147,8 @@
wc.setAttribute("hostname", newHost.getHostName());
return wc.save(false, new NullProgressMonitor());
}
-
- public static IServer setServerToRSEMode(IServer server, IHost newHost,
+
+ public static IServer setServerToRSEMode(IServer server, IHost newHost,
String jbossHome, String config) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(IDeployableServer.SERVER_MODE, RSE_MODE);
@@ -143,11 +156,9 @@
wc.setAttribute(RSE_SERVER_HOME_DIR, jbossHome);
wc.setAttribute(RSE_SERVER_HOST, newHost.getAliasName());
wc.setAttribute("hostname", newHost.getHostName());
- wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE,
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE,
IDeployableServer.DEPLOY_SERVER);
return wc.save(false, new NullProgressMonitor());
}
-
-
}
14 years, 9 months
JBoss Tools SVN: r32407 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: dialogs and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-28 10:53:38 -0400 (Tue, 28 Jun 2011)
New Revision: 32407
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathRuntimeListener.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
Log:
JBIDE-8355 - xpaths need to not hard-code the root folder
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java 2011-06-28 14:49:39 UTC (rev 32406)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java 2011-06-28 14:53:38 UTC (rev 32407)
@@ -36,6 +36,7 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
import org.jboss.ide.eclipse.as.ui.console.ShowConsoleServerStateListener;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathRuntimeListener;
import org.jboss.ide.eclipse.as.ui.wizards.JBInitialSelectionProvider;
import org.osgi.framework.BundleContext;
@@ -85,12 +86,14 @@
savePluginPreferences();
UnitedServerListenerManager.getDefault().addListener(ShowConsoleServerStateListener.getDefault());
ServerCore.addServerLifecycleListener(selectionProvider);
+ ServerCore.addRuntimeLifecycleListener(XPathRuntimeListener.getDefault());
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
+ ServerCore.removeRuntimeLifecycleListener(XPathRuntimeListener.getDefault());
ServerCore.removeServerLifecycleListener(selectionProvider);
UnitedServerListenerManager.getDefault().removeListener(ShowConsoleServerStateListener.getDefault());
JBossServerUISharedImages.instance().cleanup();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-06-28 14:49:39 UTC (rev 32406)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-06-28 14:53:38 UTC (rev 32407)
@@ -27,6 +27,9 @@
import java.util.HashMap;
import java.util.TreeSet;
+import org.eclipse.core.internal.variables.StringSubstitutionEngine;
+import org.eclipse.core.internal.variables.StringVariableManager;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -386,6 +389,16 @@
if( !new Path(directory).isAbsolute()) {
directory = server.getRuntime().getLocation().append(directory).toString();
}
+ directory = directory.replace("${jboss_config_dir}", //$NON-NLS-1$
+ "${jboss_config_dir:" + server.getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ directory = directory.replace("${jboss_config}", //$NON-NLS-1$
+ "${jboss_config:" + server.getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ StringSubstitutionEngine engine = new StringSubstitutionEngine();
+ directory = engine.performStringSubstitution(directory, true,
+ true, StringVariableManager.getDefault());
+ } catch( CoreException ce ) {}
+
final String directory2 = directory;
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2011-06-28 14:49:39 UTC (rev 32406)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2011-06-28 14:53:38 UTC (rev 32407)
@@ -143,7 +143,7 @@
}
if (categoryItem != null) {
XPathQuery query = new XPathQuery(d.getName(),
- XPathDialogs.getConfigFolder(getServer()),
+ "server/${config}", // TODO externalize this in a constant
null, d.getXpath(), d.getAttribute());
categoryItem.addQuery(query);
XPathModel.getDefault().save(getServer());
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathRuntimeListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathRuntimeListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathRuntimeListener.java 2011-06-28 14:53:38 UTC (rev 32407)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+
+public class XPathRuntimeListener implements IRuntimeLifecycleListener {
+ public static XPathRuntimeListener instance;
+ public static XPathRuntimeListener getDefault() {
+ if( instance == null )
+ instance = new XPathRuntimeListener();
+ return instance;
+ }
+
+ protected XPathRuntimeListener() {
+
+ }
+
+ public void runtimeAdded(IRuntime runtime) {
+ }
+ public void runtimeRemoved(IRuntime runtime) {
+ }
+ public void runtimeChanged(IRuntime runtime) {
+ IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.wst.server.ui.ServersView");
+ IServer[] allServers = ServerCore.getServers();
+ for( int i = 0; i < allServers.length; i++ ) {
+ if( runtime.equals(allServers[i].getRuntime())) {
+ XPathCategory[] cats = XPathModel.getDefault().getCategories(allServers[i]);
+ for( int j = 0; j < cats.length; j++ ) {
+ cats[j].clearCache();
+ }
+ }
+ if( part != null && part instanceof CommonNavigator) {
+ ((CommonNavigator)part).getCommonViewer().refresh(allServers[i]);
+ }
+ }
+ }
+}
14 years, 9 months