|
From: <caw...@us...> - 2007-07-26 15:02:44
|
Revision: 2884
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2884&view=rev
Author: cawilliams
Date: 2007-07-26 08:02:42 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
if no default vm is installed/chosen, add listener and wait until we get one, then initialize the gem manager
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
Modified: trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF 2007-07-25 19:17:49 UTC (rev 2883)
+++ trunk/com.aptana.rdt.ui/META-INF/MANIFEST.MF 2007-07-26 15:02:42 UTC (rev 2884)
@@ -11,6 +11,7 @@
org.eclipse.jface.text,
org.rubypeople.rdt.core,
com.aptana.rdt,
- org.rubypeople.rdt.ui
+ org.rubypeople.rdt.ui,
+ org.rubypeople.rdt.launching
Eclipse-LazyStart: true
Export-Package: com.aptana.rdt.internal.ui.preferences
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-25 19:17:49 UTC (rev 2883)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/RubyGemsInitializer.java 2007-07-26 15:02:42 UTC (rev 2884)
@@ -1,13 +1,38 @@
package com.aptana.rdt.ui;
import org.eclipse.ui.IStartup;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
+import org.rubypeople.rdt.launching.RubyRuntime;
import com.aptana.rdt.AptanaRDTPlugin;
-public class RubyGemsInitializer implements IStartup {
+public class RubyGemsInitializer implements IStartup, IVMInstallChangedListener {
public void earlyStartup() {
- AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ // If ruby isn't set up, listen until we have an interpreter
+ IVMInstall vm = RubyRuntime.getDefaultVMInstall();
+ if (vm == null) {
+ RubyRuntime.addVMInstallChangedListener(this);
+ } else {
+ AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ }
}
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
+ if (current != null && !AptanaRDTPlugin.getDefault().getGemManager().isInitialized()) {
+ AptanaRDTPlugin.getDefault().getGemManager().initialize();
+ }
+ }
+
+ public void vmAdded(IVMInstall newVm) {
+ }
+
+ public void vmChanged(PropertyChangeEvent event) {
+ }
+
+ public void vmRemoved(IVMInstall removedVm) {
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|