aQute.bnd.classpath
Class BndContainerInitializer

java.lang.Object
  extended by org.eclipse.jdt.core.ClasspathContainerInitializer
      extended by aQute.bnd.classpath.BndContainerInitializer
All Implemented Interfaces:
ModelListener

public class BndContainerInitializer
extends org.eclipse.jdt.core.ClasspathContainerInitializer
implements ModelListener

A bnd container reads the bnd.bnd file in the project directory and use the information in there to establish the classpath. The classpath is defined by the -build-env instruction. This instruction contains a list of bsn's that are searched in the available repositories and returned as File objects. This initializer establishes the link between the container object and the BndModel. The container object is just a delegator because for some unknown reasons, you can only update the container (refresh the contents) when you give it a new object ;-( Because this plugin uses the Bnd Builder in different places, the Bnd Model is centralized and available from the Activator.


Field Summary
static org.eclipse.core.runtime.Path ID
           
 
Fields inherited from class org.eclipse.jdt.core.ClasspathContainerInitializer
ATTRIBUTE_NOT_SUPPORTED, ATTRIBUTE_READ_ONLY
 
Constructor Summary
BndContainerInitializer()
           
 
Method Summary
 boolean canUpdateClasspathContainer(org.eclipse.core.runtime.IPath containerPath, org.eclipse.jdt.core.IJavaProject project)
          We can always update.
 void initialize(org.eclipse.core.runtime.IPath containerPath, org.eclipse.jdt.core.IJavaProject project)
          Called when a new project is found.
 void modelChanged(Project model)
           
 void requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath containerPath, org.eclipse.jdt.core.IJavaProject project, org.eclipse.jdt.core.IClasspathContainer containerSuggestion)
          Update the container.
 void workspaceChanged(Workspace ws)
           
 
Methods inherited from class org.eclipse.jdt.core.ClasspathContainerInitializer
getAccessRulesStatus, getAttributeStatus, getComparisonID, getDescription, getFailureContainer, getSourceAttachmentStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final org.eclipse.core.runtime.Path ID
Constructor Detail

BndContainerInitializer

public BndContainerInitializer()
Method Detail

initialize

public void initialize(org.eclipse.core.runtime.IPath containerPath,
                       org.eclipse.jdt.core.IJavaProject project)
                throws org.eclipse.core.runtime.CoreException
Called when a new project is found. This class is instantiated once and then used for any project that has a bnd container associated. We create a link between the project and the Bnd Model. A delegating container object is created to link the project to the container so it can get its classpath entries. Note that the container object is not stored or remembered because we create a new one for every update (otherwise the update is not visible for some reason)

Specified by:
initialize in class org.eclipse.jdt.core.ClasspathContainerInitializer
Throws:
org.eclipse.core.runtime.CoreException

canUpdateClasspathContainer

public boolean canUpdateClasspathContainer(org.eclipse.core.runtime.IPath containerPath,
                                           org.eclipse.jdt.core.IJavaProject project)
We can always update.

Overrides:
canUpdateClasspathContainer in class org.eclipse.jdt.core.ClasspathContainerInitializer

requestClasspathContainerUpdate

public void requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath containerPath,
                                            org.eclipse.jdt.core.IJavaProject project,
                                            org.eclipse.jdt.core.IClasspathContainer containerSuggestion)
                                     throws org.eclipse.core.runtime.CoreException
Update the container. The containerSuggestion should always be a new BndContainer ...

Overrides:
requestClasspathContainerUpdate in class org.eclipse.jdt.core.ClasspathContainerInitializer
Throws:
org.eclipse.core.runtime.CoreException

modelChanged

public void modelChanged(Project model)
                  throws Exception
Specified by:
modelChanged in interface ModelListener
Throws:
Exception

workspaceChanged

public void workspaceChanged(Workspace ws)
                      throws Exception
Throws:
Exception


Copyright © 2010 aQute SARL. All Rights Reserved.