public static void collectImports(final IJavaProject project,final ASTNode node,final Collection<ITypeBinding> typeBindings,final Collection<IBinding> staticBindings,final Collection<IBinding> excludeBindings,final boolean declarations){
  Assert.isNotNull(project);
  Assert.isNotNull(node);
  Assert.isNotNull(typeBindings);
  Assert.isNotNull(staticBindings);
  final Set<SimpleName> types=new HashSet<SimpleName>();
  final Set<SimpleName> members=new HashSet<SimpleName>();
  ImportReferencesCollector.collect(node,project,null,declarations,types,members);
  Name name=null;
  IBinding binding=null;
  for (final Iterator<SimpleName> iterator=types.iterator(); iterator.hasNext(); ) {
    name=iterator.next();
    binding=name.resolveBinding();
    if (binding instanceof ITypeBinding) {
      final ITypeBinding type=(ITypeBinding)binding;
      if (excludeBindings == null || !excludeBindings.contains(type))       typeBindings.add(type);
    }
  }
  for (final Iterator<SimpleName> iterator=members.iterator(); iterator.hasNext(); ) {
    name=iterator.next();
    binding=name.resolveBinding();
    if (binding != null && (excludeBindings == null || !excludeBindings.contains(binding)))     staticBindings.add(binding);
  }
}

public static void collectImports ( final IJavaProject project , final ASTNode node , final Collection < ITypeBinding > typeBindings , final Collection < IBinding > staticBindings , final Collection < IBinding > excludeBindings , final boolean declarations ) { Assert . isNotNull ( project ) ; Assert . isNotNull ( node ) ; Assert . isNotNull ( typeBindings ) ; Assert . isNotNull ( staticBindings ) ; final Set < SimpleName > types = new HashSet < SimpleName > ( ) ; final Set < SimpleName > members = new HashSet < SimpleName > ( ) ; ImportReferencesCollector . collect ( node , project , null , declarations , types , members ) ; Name name = null ; IBinding binding = null ; for ( final Iterator < SimpleName > iterator = types . iterator ( ) ; iterator . hasNext ( ) ; ) { name = iterator . next ( ) ; binding = name . resolveBinding ( ) ; if ( binding instanceof ITypeBinding ) { final ITypeBinding type = ( ITypeBinding ) binding ; if ( excludeBindings == null || ! excludeBindings . contains ( type ) ) typeBindings . add ( type ) ; } } for ( final Iterator < SimpleName > iterator = members . iterator ( ) ; iterator . hasNext ( ) ; ) { name = iterator . next ( ) ; binding = name . resolveBinding ( ) ; if ( binding != null && ( excludeBindings == null || ! excludeBindings . contains ( binding ) ) ) staticBindings . add ( binding ) ; } }
collects the necessary imports for an element represented by the specified ast node .
