View Javadoc

1   /*
2    * $Id: KazukiContainerInitializer.java,v 1.6 2004/09/20 03:51:50 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8   package com.bbn.swede.library.kazuki;
9   
10  import org.eclipse.core.runtime.CoreException;
11  import org.eclipse.core.runtime.IPath;
12  import org.eclipse.jdt.core.ClasspathContainerInitializer;
13  import org.eclipse.jdt.core.IClasspathContainer;
14  import org.eclipse.jdt.core.IJavaProject;
15  import org.eclipse.jdt.core.JavaCore;
16  
17  /***
18   * Initializes the Kazuki classpath container.  The container is associated with
19   * the container path com.bbn.swede.library.kazuki.kazukiContainer when it is 
20   * added to a Java project.
21   * @author jlerner
22   */
23  public class KazukiContainerInitializer extends ClasspathContainerInitializer
24  {
25     /*
26      *  (non-Javadoc)
27      * @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(
28      *       org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
29      */
30     public void initialize(IPath containerPath, IJavaProject project)
31        throws CoreException
32     {
33        if (containerPath
34           .segment(0)
35           .equals("com.bbn.swede.library.kazuki.kazukiContainer"))
36        {
37  
38           IClasspathContainer container = new KazukiContainer(containerPath);
39           JavaCore.setClasspathContainer(
40              containerPath,
41              new IJavaProject[] {project},
42              new IClasspathContainer[] {container},
43              null);
44        }
45     }
46  
47  }