diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-23 18:35:57 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-23 18:35:57 +0000 |
commit | 19cb50afa2ce85859beca86b481e8b4e7bf1c4d6 (patch) | |
tree | e62a2c3b3c84d654d6cd7003ded344f8f77878f3 /sandbox/rfeng/eclipse-workspace/src/main | |
parent | 0f9d688751384de0d8d511ea40936d57793340b4 (diff) |
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
Diffstat (limited to 'sandbox/rfeng/eclipse-workspace/src/main')
-rw-r--r-- | sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java | 28 |
1 files changed, 4 insertions, 24 deletions
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() { |