|
From: <caw...@us...> - 2007-06-25 17:59:11
|
Revision: 2671
http://svn.sourceforge.net/rubyeclipse/?rev=2671&view=rev
Author: cawilliams
Date: 2007-06-25 10:59:10 -0700 (Mon, 25 Jun 2007)
Log Message:
-----------
close #4913 - Listen for end of launches created by updates in GemManager and refresh the GemsView
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-06-25 16:32:00 UTC (rev 2670)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-06-25 17:59:10 UTC (rev 2671)
@@ -335,11 +335,24 @@
*
* @see com.aptana.rdt.internal.gems.IGemManager#update(com.aptana.rdt.internal.gems.Gem)
*/
- public boolean update(Gem gem) {
+ public boolean update(final Gem gem) {
try {
String command = UPDATE_COMMAND + " " + gem.getName();
ILaunchConfiguration config = createGemLaunchConfiguration(command, true);
- config.launch(ILaunchManager.RUN_MODE, null);
+ final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
+ Job job = new Job("Notify gem listeners of uninstalled gem") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ while (!launch.isTerminated()) {
+ Thread.yield();
+ }
+ refresh();
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
} catch (CoreException e) {
AptanaRDTPlugin.log(e);
return false;
@@ -418,7 +431,7 @@
*
* @see com.aptana.rdt.internal.gems.IGemManager#installGem(com.aptana.rdt.internal.gems.Gem)
*/
- public boolean installGem(Gem gem) {
+ public boolean installGem(final Gem gem) {
try {
String command = INSTALL_COMMAND + " " + gem.getName();
if (gem.getVersion() != null
@@ -426,8 +439,24 @@
command += " " + VERSION_SWITCH + " " + gem.getVersion();
}
ILaunchConfiguration config = createGemLaunchConfiguration(command, true);
- config.launch(ILaunchManager.RUN_MODE, null);
- // FIXME Listen for end of launch and then notify listeners
+ final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
+ Job job = new Job("Notify gem listeners of uninstalled gem") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ while (!launch.isTerminated()) {
+ Thread.yield();
+ }
+ refresh();
+ // Need to wait until uninstall is finished
+ for (GemListener listener : listeners) {
+ listener.gemAdded(gem);
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
} catch (CoreException e) {
AptanaRDTPlugin.log(e);
return false;
@@ -638,7 +667,20 @@
public boolean updateAll() {
try {
ILaunchConfiguration config = createGemLaunchConfiguration(UPDATE_COMMAND, true);
- config.launch(ILaunchManager.RUN_MODE, null);
+ final ILaunch launch = config.launch(ILaunchManager.RUN_MODE, null);
+ Job job = new Job("Notify gem listeners of uninstalled gem") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ while (!launch.isTerminated()) {
+ Thread.yield();
+ }
+ refresh();
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
} catch (CoreException e) {
AptanaRDTPlugin.log(e);
return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|