Author: snjeza
Date: 2012-02-10 18:03:47 -0500 (Fri, 10 Feb 2012)
New Revision: 38628
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
Removed:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeDialog.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeViewerDialog.java
trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
Log:
JBIDE-10244 Cleaning up Runtime plugin
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2012-02-10 23:03:34 UTC (rev
38627)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/plugin.xml 2012-02-10 23:03:47 UTC (rev
38628)
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
-
- <extension
- point="org.eclipse.ui.startup">
- <startup
- class="org.jboss.tools.runtime.JBossRuntimeStartup">
- </startup>
- </extension>
<extension
point="org.eclipse.core.runtime.preferences">
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2012-02-10
23:03:34 UTC (rev 38627)
+++
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/Activator.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -29,8 +29,6 @@
public static final String JBPMS = "jbpms";
- public static final String WORKSPACES = "workspaces";
-
// The shared instance
private static Activator plugin;
Deleted:
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 2012-02-10
23:03:34 UTC (rev 38627)
+++
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.tools.runtime;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IStartup;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonNavigator;
-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 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$
-
- private static final String LOCATIONS_FILE_NAME =
"runtime_locations.properties"; //$NON-NLS-1$
- private static final String LOCATIONS_FILE = "../../../../studio/" +
LOCATIONS_FILE_NAME; //$NON-NLS-1$
- private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" +
LOCATIONS_FILE_NAME; //$NON-NLS-1$
-
- private List<ServerDefinition> serverDefinitions = new
ArrayList<ServerDefinition>();
- private IEclipsePreferences preferences;
-
- Set<RuntimePath> installersRuntimePaths = new HashSet<RuntimePath>();
-
- public void earlyStartup() {
- if (isJBDS() && willBeInitialized()) {
- parseServerFile();
- parseRuntimeLocationsFile();
- initializeIncludedRuntimes();
- initializeRuntimes(serverDefinitions);
- saveWorkspacePreferences();
- }
- }
-
- private void initializeIncludedRuntimes() {
- try {
- String configuration = getConfiguration();
- File directory = new File(configuration, JBOSS_EAP_HOME);
- if (directory.isDirectory()) {
- IPath path = new Path(directory.getAbsolutePath());
- JBossRuntimeLocator locator = new JBossRuntimeLocator();
- List<ServerDefinition> definitions = locator.searchForRuntimes(path, new
NullProgressMonitor());
- serverDefinitions.addAll(definitions);
-
- }
- } catch (IOException e) {
- Activator.log(e);
- }
-
- }
-
- public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
- Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
- for( IRuntimeDetector detector:detectors) {
- if (detector.isEnabled()) {
- detector.initializeRuntimes(serverDefinitions);
- }
- }
- refreshCommonNavigator();
- }
-
- private void saveWorkspacePreferences() {
- Activator.getDefault().getPreferenceStore().setValue(Activator.FIRST_START, false);
- String workspaces = getWorkspaces();
- String newWorkspaces = "";
- boolean addWorkspace = true;
- if (workspaces == null || workspaces.trim().length() == 0) {
- newWorkspaces = getWorkspace();
- } else {
- StringTokenizer tokenizer = new StringTokenizer(workspaces, ",");
- while (tokenizer.hasMoreTokens()) {
- String workspace = tokenizer.nextToken();
- if (workspace.equals(getWorkspace())) {
- addWorkspace = false;
- }
- }
- if (addWorkspace) {
- newWorkspaces = workspaces + "," + getWorkspace();
- }
- }
- if (addWorkspace) {
- IEclipsePreferences prefs = getPreferences();
- prefs.put(Activator.WORKSPACES, newWorkspaces);
- try {
- prefs.flush();
- } catch (BackingStoreException e) {
- 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);
- }
-
- runtimePaths.addAll(installersRuntimePaths);
-
- if (runtimePaths.size() > 0) {
- RuntimeUIActivator.getDefault().saveRuntimePaths();
- }
- }
-
- /**
- * @return
- */
- private boolean willBeInitialized() {
- boolean firstStart =
Activator.getDefault().getPreferenceStore().getBoolean(Activator.FIRST_START);
- if (firstStart) {
- return true;
- }
-
- String workspaces = getWorkspaces();
- if (workspaces == null || workspaces.trim().length() == 0) {
- return true;
- }
- StringTokenizer tokenizer = new StringTokenizer(workspaces, ",");
- while (tokenizer.hasMoreTokens()) {
- String workspace = tokenizer.nextToken();
- if (workspace.equals(getWorkspace())) {
- return false;
- }
- }
- return true;
- }
-
- private String getWorkspaces() {
- IEclipsePreferences prefs = getPreferences();
- String workspaces = prefs.get(Activator.WORKSPACES, "");
- return workspaces;
- }
-
- private String getWorkspace() {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath workspacePath = root.getLocation();
- return workspacePath.toOSString();
- }
-
- private IEclipsePreferences getPreferences() {
- if (preferences == null) {
- preferences = new ConfigurationScope().getNode(Activator.PLUGIN_ID);
- }
- return preferences;
- }
-
- private boolean isJBDS() {
- Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
- return jbdsProduct != null;
- }
-
- private void refreshCommonNavigator() {
- //
https://jira.jboss.org/jira/browse/JBDS-1091
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- IViewPart view =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.wst.server.ui.ServersView");
- if (view instanceof CommonNavigator) {
- CommonNavigator navigator = (CommonNavigator) view;
- navigator.getCommonViewer().refresh();
- }
- }
- });
- }
-
- private void parseServerFile() {
-
- try {
- String pluginLocation =
FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath();
//$NON-NLS-1$
- File serversFile = new File(pluginLocation, SERVERS_FILE);
-
- if (!serversFile.isFile()) {
- String configuration = getConfiguration();
- serversFile = new File(configuration,
SERVERS_FILE_CONFIGURATION).getCanonicalFile();
- } else {
- serversFile = serversFile.getCanonicalFile();
- }
- if (!serversFile.isFile()) {
- serversFile = new File(pluginLocation,SERVERS_FILE_NAME);
- }
- if (serversFile.isFile()) {
- //String str = FileUtil.readFile(serversFile);
- Properties servers = new Properties();
- servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
- Enumeration<Object> elements = servers.elements();
- while (elements.hasMoreElements()) {
- String str = (String) elements.nextElement();
- StringTokenizer lineTokenizer = new StringTokenizer(str,
- "\n\r\f"); //$NON-NLS-1$
- while (lineTokenizer.hasMoreTokens()) {
- String lineToken = lineTokenizer.nextToken();
- StringTokenizer tokenizer = new StringTokenizer(
- lineToken, ","); //$NON-NLS-1$
- if (tokenizer.countTokens() == 4) {
- String name = tokenizer.nextToken();
- /*int index = name.indexOf('=');
- if (index < 0) {
- continue;
- }
- name = name.substring(index + 1);*/
- String type = tokenizer.nextToken();
- String version = tokenizer.nextToken();
- String location = tokenizer.nextToken();
- File locationFile = new File(location);
- if (locationFile.isDirectory()) {
- serverDefinitions.add(new ServerDefinition(
- name, version, type, locationFile));
- }
- }
- }
- }
- }
- } catch (FileNotFoundException e) {
- Activator.log(e);
- } catch (IOException e) {
- Activator.log(e);
- }
- }
-
- private void parseRuntimeLocationsFile() {
-
- try {
- String pluginLocation =
FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath();
//$NON-NLS-1$
- File serversFile = new File(pluginLocation, LOCATIONS_FILE);
-
- if (!serversFile.isFile()) {
- String configuration = getConfiguration();
- serversFile = new File(configuration,
LOCATIONS_FILE_CONFIGURATION).getCanonicalFile();
- } else {
- serversFile = serversFile.getCanonicalFile();
- }
- if (!serversFile.isFile()) {
- serversFile = new File(pluginLocation,LOCATIONS_FILE_NAME);
- }
- if (serversFile.isFile()) {
- //String str = FileUtil.readFile(serversFile);
- Properties servers = new Properties();
- servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
- Enumeration<Object> elements = servers.elements();
- while (elements.hasMoreElements()) {
- String str = (String) elements.nextElement();
- StringTokenizer lineTokenizer = new StringTokenizer(str,
- "\n\r\f"); //$NON-NLS-1$
- while (lineTokenizer.hasMoreTokens()) {
- String lineToken = lineTokenizer.nextToken();
- StringTokenizer tokenizer = new StringTokenizer(
- lineToken, ","); //$NON-NLS-1$
- if (tokenizer.countTokens() == 2) {
- String location = tokenizer.nextToken();
- boolean scan = Boolean.parseBoolean(tokenizer.nextToken());
- File locationFile = new File(location);
- if (locationFile.isDirectory()) {
- RuntimePath tempLocation = new RuntimePath(location);
- tempLocation.setScanOnEveryStartup(scan);
- installersRuntimePaths.add(tempLocation);
- }
- }
- }
- }
- }
- } catch (FileNotFoundException e) {
- Activator.log(e);
- } 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
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/META-INF/MANIFEST.MF 2012-02-10
23:03:34 UTC (rev 38627)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/META-INF/MANIFEST.MF 2012-02-10
23:03:47 UTC (rev 38628)
@@ -8,7 +8,8 @@
org.eclipse.core.runtime,
org.jboss.tools.runtime.core,
org.eclipse.core.resources,
- org.jboss.tools.project.examples
+ org.jboss.tools.project.examples,
+ org.eclipse.ui.navigator;bundle-version="3.5.100"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.tools.runtime.ui;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonNavigator;
+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;
+
+public class JBossRuntimeStartup {
+
+ 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 LOCATIONS_FILE_NAME =
"runtime_locations.properties"; //$NON-NLS-1$
+ private static final String LOCATIONS_FILE = "../../../../studio/" +
LOCATIONS_FILE_NAME; //$NON-NLS-1$
+ private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" +
LOCATIONS_FILE_NAME; //$NON-NLS-1$
+
+ public static void initializeRuntimes(IProgressMonitor monitor) {
+ if (isJBDS()) {
+ final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
+ parseRuntimeLocationsFile(runtimePaths);
+ try {
+ String configuration = getConfiguration();
+ File directory = new File(configuration, JBOSS_EAP_HOME);
+ if (directory.isDirectory()) {
+ RuntimePath runtimePath = new RuntimePath(directory.getAbsolutePath());
+ runtimePaths.add(runtimePath);
+ }
+ } catch (IOException e) {
+ RuntimeUIActivator.log(e);
+ }
+
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ for (RuntimePath runtimePath : runtimePaths) {
+ List<ServerDefinition> serverDefinitions = locator
+ .searchForRuntimes(runtimePath.getPath(), monitor);
+ runtimePath.getServerDefinitions().clear();
+ for (ServerDefinition serverDefinition : serverDefinitions) {
+ serverDefinition.setRuntimePath(runtimePath);
+ }
+ runtimePath.getServerDefinitions().addAll(serverDefinitions);
+ initializeRuntimes(serverDefinitions);
+ }
+ if (runtimePaths.size() > 0) {
+ RuntimeUIActivator.getDefault().saveRuntimePaths();
+ }
+
+
+ }
+ }
+
+ public static void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+ Set<IRuntimeDetector> detectors = RuntimeCoreActivator.getRuntimeDetectors();
+ for( IRuntimeDetector detector:detectors) {
+ if (detector.isEnabled()) {
+ detector.initializeRuntimes(serverDefinitions);
+ }
+ }
+ refreshCommonNavigator();
+ }
+
+
+ private static boolean isJBDS() {
+ Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
+ //return jbdsProduct != null;
+ return true;
+ }
+
+ private static void refreshCommonNavigator() {
+ //
https://jira.jboss.org/jira/browse/JBDS-1091
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ IViewPart view =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.wst.server.ui.ServersView");
+ if (view instanceof CommonNavigator) {
+ CommonNavigator navigator = (CommonNavigator) view;
+ navigator.getCommonViewer().refresh();
+ }
+ }
+ });
+ }
+
+ private static void parseRuntimeLocationsFile(Set<RuntimePath> runtimePaths) {
+
+ try {
+ String pluginLocation =
FileLocator.resolve(RuntimeUIActivator.getDefault().getBundle().getEntry("/")).getPath();
//$NON-NLS-1$
+ File serversFile = new File(pluginLocation, LOCATIONS_FILE);
+
+ if (!serversFile.isFile()) {
+ String configuration = getConfiguration();
+ serversFile = new File(configuration,
LOCATIONS_FILE_CONFIGURATION).getCanonicalFile();
+ } else {
+ serversFile = serversFile.getCanonicalFile();
+ }
+ if (!serversFile.isFile()) {
+ serversFile = new File(pluginLocation,LOCATIONS_FILE_NAME);
+ }
+ if (serversFile.isFile()) {
+ //String str = FileUtil.readFile(serversFile);
+ Properties servers = new Properties();
+ servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
+ Enumeration<Object> elements = servers.elements();
+ while (elements.hasMoreElements()) {
+ String str = (String) elements.nextElement();
+ StringTokenizer lineTokenizer = new StringTokenizer(str,
+ "\n\r\f"); //$NON-NLS-1$
+ while (lineTokenizer.hasMoreTokens()) {
+ String lineToken = lineTokenizer.nextToken();
+ StringTokenizer tokenizer = new StringTokenizer(
+ lineToken, ","); //$NON-NLS-1$
+ if (tokenizer.countTokens() == 2) {
+ String location = tokenizer.nextToken();
+ boolean scan = Boolean.parseBoolean(tokenizer.nextToken());
+ File locationFile = new File(location);
+ if (locationFile.isDirectory()) {
+ RuntimePath tempLocation = new RuntimePath(location);
+ tempLocation.setScanOnEveryStartup(scan);
+ runtimePaths.add(tempLocation);
+ }
+ }
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ RuntimeUIActivator.log(e);
+ } catch (IOException e) {
+ RuntimeUIActivator.log(e);
+ }
+ }
+
+ private static 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
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-02-10
23:03:34 UTC (rev 38627)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeScanner.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -20,7 +20,6 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IStartup;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.core.model.ServerDefinition;
@@ -43,6 +42,9 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
+ if (firstStart) {
+ JBossRuntimeStartup.initializeRuntimes(monitor);
+ }
boolean exists = runtimeExists(firstStart, monitor);
if (monitor.isCanceled()) {
RuntimeUIActivator.getDefault().refreshRuntimePreferences();
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeDialog.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeDialog.java 2012-02-10
23:03:34 UTC (rev 38627)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeDialog.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -32,7 +32,6 @@
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.PathEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeViewerDialog.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeViewerDialog.java 2012-02-10
23:03:34 UTC (rev 38627)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/DownloadRuntimeViewerDialog.java 2012-02-10
23:03:47 UTC (rev 38628)
@@ -21,7 +21,6 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;