Author: snjeza
Date: 2011-06-28 18:43:36 -0400 (Tue, 28 Jun 2011)
New Revision: 32419
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
Log:
JBDS-1704 Bundled EAP is not registered in Server view
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2011-06-28 21:58:48
UTC (rev 32418)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/META-INF/MANIFEST.MF 2011-06-28 22:43:36
UTC (rev 32419)
@@ -9,7 +9,8 @@
org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.ui;bundle-version="3.7.0",
org.jboss.tools.runtime.core,
- org.eclipse.ui.navigator;bundle-version="3.5.100"
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.jboss.tools.runtime.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-06-28
21:58:48 UTC (rev 32418)
+++
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-06-28
22:43:36 UTC (rev 32419)
@@ -41,13 +41,15 @@
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.IRuntimeDetector;
+import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.core.model.ServerDefinition;
+import org.jboss.tools.runtime.ui.RuntimeUIActivator;
import org.osgi.framework.Bundle;
import org.osgi.service.prefs.BackingStoreException;
public class JBossRuntimeStartup implements IStartup {
- private static final String JBOSS_EAP_HOME = "../../../../jboss-eap"; //
JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ private static final String JBOSS_EAP_HOME = "../../jboss-eap"; // JBoss EAP
home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
private static final String SERVERS_FILE_NAME =
"application_platforms.properties"; //$NON-NLS-1$
private static final String SERVERS_FILE = "../../../../studio/" +
SERVERS_FILE_NAME; //$NON-NLS-1$
private static final String SERVERS_FILE_CONFIGURATION = "../../studio/" +
SERVERS_FILE_NAME; //$NON-NLS-1$
@@ -66,8 +68,8 @@
private void initializeIncludedRuntimes() {
try {
- String pluginLocation =
FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath();
//$NON-NLS-1$
- File directory = new File(pluginLocation, JBOSS_EAP_HOME);
+ String configuration = getConfiguration();
+ File directory = new File(configuration, JBOSS_EAP_HOME);
if (directory.isDirectory()) {
IPath path = new Path(directory.getAbsolutePath());
JBossRuntimeLocator locator = new JBossRuntimeLocator();
@@ -119,6 +121,15 @@
Activator.log(e);
}
}
+ Set<RuntimePath> runtimePaths =
RuntimeUIActivator.getDefault().getRuntimePaths();
+ for (ServerDefinition serverDefinition:serverDefinitions) {
+ File location = serverDefinition.getLocation();
+ RuntimePath runtimePath = new RuntimePath(location.getAbsolutePath());
+ runtimePaths.add(runtimePath);
+ }
+ if (runtimePaths.size() > 0) {
+ RuntimeUIActivator.getDefault().saveRuntimePaths();
+ }
}
/**
@@ -189,9 +200,7 @@
File serversFile = new File(pluginLocation, SERVERS_FILE);
if (!serversFile.isFile()) {
- Location configLocation = Platform.getConfigurationLocation();
- URL configURL = configLocation.getURL();
- String configuration = FileLocator.resolve(configURL).getPath();
+ String configuration = getConfiguration();
serversFile = new File(configuration,
SERVERS_FILE_CONFIGURATION).getCanonicalFile();
} else {
serversFile = serversFile.getCanonicalFile();
@@ -236,5 +245,12 @@
} catch (IOException e) {
Activator.log(e);
}
+ }
+
+ private String getConfiguration() throws IOException {
+ Location configLocation = Platform.getConfigurationLocation();
+ URL configURL = configLocation.getURL();
+ String configuration = FileLocator.resolve(configURL).getPath();
+ return configuration;
}
}
\ No newline at end of file
Show replies by date