View Javadoc

1   /*
2    * $Id: JenaContainerInitializer.java,v 1.4 2004/09/14 13:57:14 jlerner Exp $
3    * Created on Apr 20, 2004
4    *
5    * Copyright (c) 1999-2004, BBN Technologies, LLC.
6    * All rights reserved.
7    * http://www.daml.org/legal/opensource/bbn_license.html
8    */
9   
10  package com.bbn.jena;
11  
12  import org.eclipse.core.runtime.CoreException;
13  import org.eclipse.core.runtime.IPath;
14  import org.eclipse.jdt.core.ClasspathContainerInitializer;
15  import org.eclipse.jdt.core.IClasspathContainer;
16  import org.eclipse.jdt.core.IJavaProject;
17  import org.eclipse.jdt.core.JavaCore;
18  
19  /***
20   * Associates the Jena classpath container with the appropriate container path.
21   * @author tself
22   * @author jlerner
23   */
24  public class JenaContainerInitializer extends ClasspathContainerInitializer
25  {
26  
27     /* (non-Javadoc)
28      * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(
29      *       org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
30      */
31     public void initialize(IPath containerPath, IJavaProject project)
32        throws CoreException
33     {
34        if (containerPath.segment(0).equals("com.bbn.jena.jenaContainer"))
35        {
36  
37           IClasspathContainer container = new JenaContainer(containerPath);
38           JavaCore.setClasspathContainer(
39              containerPath,
40              new IJavaProject[] {project},
41              new IClasspathContainer[] {container},
42              null);
43        }
44     }
45  
46  }