From 19cb50afa2ce85859beca86b481e8b4e7bf1c4d6 Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 23 Mar 2010 18:35:57 +0000 Subject: Change the api so that it works with Eclipse 3.5 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@926713 13f79535-47bb-0310-9956-ffa450edef68 --- .../eclipse/workspace/WorkspaceConfigurator.java | 28 ++++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'sandbox/rfeng/eclipse-workspace/src/main/java/org/apache') diff --git a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java index fcdd484939..14f94a582f 100644 --- a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java +++ b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java @@ -44,9 +44,6 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.jobs.IJobChangeEvent; -import org.eclipse.core.runtime.jobs.IJobChangeListener; -import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.jdt.core.JavaCore; @@ -68,23 +65,17 @@ public class WorkspaceConfigurator implements IApplication { private static final String M2_REPO = "M2_REPO"; private IWorkspace workspace; - private final Object lock = new Object(); public Object start(final IApplicationContext appcontext) throws Exception { IProgressMonitor monitor = createMonitor(); final String[] args = (String[])appcontext.getArguments().get(IApplicationContext.APPLICATION_ARGS); setM2REPOClassPathVariable(args, monitor); - setTargetPlatform(args); - - // Wait for the target platform job is done - synchronized (lock) { - lock.wait(); - } + setTargetPlatform(args, monitor); configureWorkspace(args, monitor); return EXIT_OK; } - private void setTargetPlatform(String args[]) throws FileNotFoundException, CoreException, + private void setTargetPlatform(String args[], IProgressMonitor monitor) throws FileNotFoundException, CoreException, ParserConfigurationException, SAXException, IOException { String targetFile = getOptionValue(args, TARGET_DEFINITION); if (targetFile == null) { @@ -101,19 +92,8 @@ public class WorkspaceConfigurator implements IApplication { } finally { is.close(); } - IJobChangeListener jobListener = new JobChangeAdapter() { - - @Override - public void done(IJobChangeEvent event) { - super.done(event); - synchronized (lock) { - print("Target platform is configured: " + event.getResult()); - lock.notifyAll(); - } - } - - }; - LoadTargetDefinitionJob.load(th.getTargetDefinition(), jobListener); + LoadTargetDefinitionJob job = new LoadTargetDefinitionJob(th.getTargetDefinition()); + job.runInWorkspace(monitor); } private IProgressMonitor createMonitor() { -- cgit v1.2.3