Package org.eclipse.jdt.internal.core.util

Examples of org.eclipse.jdt.internal.core.util.HandleFactory


      TypeDeclaration type = types[i];
      rememberWithMemberTypes(type, cu.getType(new String(type.name)));
    }
  }
  if (includeLocalTypes && parsedUnit.localTypes != null) {
    HandleFactory factory = new HandleFactory();
    HashSet existingElements = new HashSet(parsedUnit.localTypeCount);
    HashMap knownScopes = new HashMap(parsedUnit.localTypeCount);
    for (int i = 0; i < parsedUnit.localTypeCount; i++) {
      LocalTypeBinding localType = parsedUnit.localTypes[i];
      ClassScope classScope = localType.scope;
      TypeDeclaration typeDecl = classScope.referenceType();
      IType typeHandle = (IType)factory.createElement(classScope, cu, existingElements, knownScopes);
      rememberWithMemberTypes(typeDecl, typeHandle);
    }
  }
}
View Full Code Here


    // optimize access to zip files during search operation
    manager.cacheZipFiles(this);

    // initialize handle factory (used as a cache of handles so as to optimize space)
    if (this.handleFactory == null)
      this.handleFactory = new HandleFactory();

    if (this.progressMonitor != null) {
      this.progressMonitor.beginTask("", searchDocuments.length); //$NON-NLS-1$
    }
View Full Code Here

    }
  }
  if (!includeLocalTypes || (parsedUnit.localTypes == null && parsedUnit.functionalExpressions == null))
    return;
 
  HandleFactory factory = new HandleFactory();
  HashSet existingElements = new HashSet(parsedUnit.localTypeCount + parsedUnit.functionalExpressionsCount);
  HashMap knownScopes = new HashMap(parsedUnit.localTypeCount + parsedUnit.functionalExpressionsCount);
 
  if (parsedUnit.localTypes != null) {
    for (int i = 0; i < parsedUnit.localTypeCount; i++) {
      LocalTypeBinding localType = parsedUnit.localTypes[i];
      ClassScope classScope = localType.scope;
      TypeDeclaration typeDecl = classScope.referenceType();
      IType typeHandle = (IType)factory.createElement(classScope, cu, existingElements, knownScopes);
      rememberWithMemberTypes(typeDecl, typeHandle);
    }
  }
  if (parsedUnit.functionalExpressions != null) {
    for (int i = 0; i < parsedUnit.functionalExpressionsCount; i++) {
      if (parsedUnit.functionalExpressions[i] instanceof LambdaExpression) {
        final LambdaExpression expression = (LambdaExpression) parsedUnit.functionalExpressions[i];
        if (expression.resolvedType != null && expression.resolvedType.isValidBinding()) {
          IType typeHandle = (IType)factory.createLambdaTypeElement(expression, cu, existingElements, knownScopes);
          remember(typeHandle, expression.getTypeBinding());
        }
      }
    }
  }
View Full Code Here

  Arrays.sort(allPotentialSubTypes);

  ArrayList potentialSubtypes = new ArrayList();
  try {
    // create element infos for subtypes
    HandleFactory factory = new HandleFactory();
    IJavaProject currentProject = null;
    if (monitor != null) monitor.beginTask("", length*2 /* 1 for build binding, 1 for connect hierarchy*/); //$NON-NLS-1$
    for (int i = 0; i < length; i++) {
      try {
        String resourcePath = allPotentialSubTypes[i];

        // skip duplicate paths (e.g. if focus path was injected when it was already a potential subtype)
        if (i > 0 && resourcePath.equals(allPotentialSubTypes[i-1])) continue;

        Openable handle;
        org.eclipse.jdt.core.ICompilationUnit workingCopy = (org.eclipse.jdt.core.ICompilationUnit)wcPaths.get(resourcePath);
        if (workingCopy != null) {
          handle = (Openable)workingCopy;
        } else {
          handle =
            resourcePath.equals(focusPath) ?
              focusCU :
              factory.createOpenable(resourcePath, this.scope);
          if (handle == null) continue; // match is outside classpath
        }

        IJavaProject project = handle.getJavaProject();
        if (currentProject == null) {
View Full Code Here

      TypeDeclaration type = types[i];
      rememberWithMemberTypes(type, cu.getType(new String(type.name)));
    }
  }
  if (includeLocalTypes && parsedUnit.localTypes != null) {
    HandleFactory factory = new HandleFactory();
    HashSet existingElements = new HashSet(parsedUnit.localTypeCount);
    HashMap knownScopes = new HashMap(parsedUnit.localTypeCount);
    for (int i = 0; i < parsedUnit.localTypeCount; i++) {
      LocalTypeBinding localType = parsedUnit.localTypes[i];
      ClassScope classScope = localType.scope;
      TypeDeclaration typeDecl = classScope.referenceType();
      IType typeHandle = (IType)factory.createElement(classScope, cu, existingElements, knownScopes);
      rememberWithMemberTypes(typeDecl, typeHandle);
    }
  }
}
View Full Code Here

  Arrays.sort(allPotentialSubTypes);

  ArrayList potentialSubtypes = new ArrayList();
  try {
    // create element infos for subtypes
    HandleFactory factory = new HandleFactory();
    IJavaProject currentProject = null;
    if (monitor != null) monitor.beginTask("", length*2 /* 1 for build binding, 1 for connect hierarchy*/); //$NON-NLS-1$
    for (int i = 0; i < length; i++) {
      try {
        String resourcePath = allPotentialSubTypes[i];

        // skip duplicate paths (e.g. if focus path was injected when it was already a potential subtype)
        if (i > 0 && resourcePath.equals(allPotentialSubTypes[i-1])) continue;

        Openable handle;
        org.eclipse.jdt.core.ICompilationUnit workingCopy = (org.eclipse.jdt.core.ICompilationUnit)wcPaths.get(resourcePath);
        if (workingCopy != null) {
          handle = (Openable)workingCopy;
        } else {
          handle =
            resourcePath.equals(focusPath) ?
              focusCU :
              factory.createOpenable(resourcePath, this.scope);
          if (handle == null) continue; // match is outside classpath
        }

        IJavaProject project = handle.getJavaProject();
        if (currentProject == null) {
View Full Code Here

    // optimize access to zip files during search operation
    manager.cacheZipFiles(this);

    // initialize handle factory (used as a cache of handles so as to optimize space)
    if (this.handleFactory == null)
      this.handleFactory = new HandleFactory();

    if (this.progressMonitor != null) {
      this.progressMonitor.beginTask("", searchDocuments.length); //$NON-NLS-1$
    }
View Full Code Here

public TypeNameMatchRequestorWrapper(TypeNameMatchRequestor requestor, IJavaSearchScope scope) {
  this.requestor = requestor;
  this.scope = scope;
  if (!(scope instanceof AbstractJavaSearchScope)) {
    this.handleFactory = new HandleFactory();
  }
}
View Full Code Here

    // optimize access to zip files during search operation
    manager.cacheZipFiles(this);

    // initialize handle factory (used as a cache of handles so as to optimize space)
    if (this.handleFactory == null)
      this.handleFactory = new HandleFactory();

    if (this.progressMonitor != null) {
      this.progressMonitor.beginTask("", searchDocuments.length); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.core.util.HandleFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.