@Override
public Lookup createAdditionalLookup(Lookup baseContext) {
final InstanceContent ic = new InstanceContent();
final Project prj = baseContext.lookup(Project.class);
assert prj != null;
final AccessQueryImpl access = new AccessQueryImpl(prj);
final ForeignClassBundlerImpl bundler = new ForeignClassBundlerImpl(prj);
final RecommendedTemplates templates = new RecommendedTemplates() {
@Override
public String[] getRecommendedTypes() {
return new String[] {"osgi"};
}
};
NbMavenProject nbprj = prj.getLookup().lookup(NbMavenProject.class);
nbprj.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (NbMavenProject.PROP_PROJECT.equals(evt.getPropertyName())) {
checkContent(prj, ic, access, bundler, templates);
}
}
});
checkContent(prj, ic, access, bundler, templates);
return new AbstractLookup(ic);
}