All Downloads are FREE. Search and download functionalities are using the official Maven repository.

editor.search.IncrementalCompilerUsageSearcher Maven / Gradle / Ivy

There is a newer version: 1.18.1
Show newest version
package editor.search;

import editor.FileTree;
import gw.lang.reflect.IType;
import gw.lang.reflect.gs.IGosuClass;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 */
public class IncrementalCompilerUsageSearcher extends UsageSearcher
{
  private Set _types;

  public IncrementalCompilerUsageSearcher( IType type )
  {
    super( new UsageTarget( null, type.getTypeInfo() ), false, false );
    _types = new HashSet<>();
    _types.add( type );
  }

  public Set getTypes()
  {
    return _types;
  }

  @Override
  public boolean search( FileTree tree, SearchTree results )
  {
    if( isExcluded( tree ) )
    {
      return false;
    }

    IType type = tree.getType();

    List locations = findUsage( (IGosuClass)type );
    if( locations.isEmpty() )
    {
      return false;
    }
    _types.add( type );
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy