Package org.aspectj.org.eclipse.jdt.internal.core

Examples of org.aspectj.org.eclipse.jdt.internal.core.Openable


  for (int i = 0; i < roots.length; i++) {
    IJavaElement root = roots[i];
    if (root instanceof IOpenable) {
      this.files.put(root, new ArrayList());
    } else {
      Openable o = (Openable) ((JavaElement) root).getOpenableParent();
      if (o != null) {
        this.files.put(o, new ArrayList());
      }
    }
    checkCanceled();
View Full Code Here


*/
protected IJavaElement createImportHandle(ImportReference importRef) {
  char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');
  if ((importRef.bits & ASTNode.OnDemand) != 0)
    importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$
  Openable openable = this.currentPossibleMatch.openable;
  if (openable instanceof CompilationUnit)
    return ((CompilationUnit) openable).getImport(new String(importName));

  // binary types do not contain import statements so just answer the top-level type as the element
  IType binaryType = ((ClassFile) openable).getType();
View Full Code Here

* Creates an IImportDeclaration from the given import statement
*/
protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) {
  if (unit.isPackageInfo()) {
    char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.');
    Openable openable = this.currentPossibleMatch.openable;
    if (openable instanceof CompilationUnit) {
      return ((CompilationUnit) openable).getPackageDeclaration(new String(packName));
    }
  }
  return createTypeHandle(new String(unit.getMainTypeName()));
View Full Code Here

}
/**
* Creates an IType from the given simple top level type name.
*/
protected IType createTypeHandle(String simpleTypeName) {
  Openable openable = this.currentPossibleMatch.openable;
  if (openable instanceof CompilationUnit)
    return ((CompilationUnit) openable).getType(simpleTypeName);

  IType binaryType = ((ClassFile) openable).getType();
  String binaryTypeQualifiedName = binaryType.getTypeQualifiedName();
View Full Code Here

        displayed++;
        continue;
      }
      previousPath = pathString;

      Openable openable;
      org.aspectj.org.eclipse.jdt.core.ICompilationUnit workingCopy = null;
      if (searchDocument instanceof WorkingCopyDocument) {
        workingCopy = ((WorkingCopyDocument)searchDocument).workingCopy;
        openable = (Openable) workingCopy;
      } else {
        openable = this.handleFactory.createOpenable(pathString, this.scope);
      }
      if (openable == null) {
        if (this.progressMonitor != null) {
          this.progressWorked++;
          if ((this.progressWorked%this.progressStep)==0) this.progressMonitor.worked(this.progressStep);
        }
        displayed++;
        continue; // match is outside classpath
      }

      // create new parser and lookup environment if this is a new project
      IResource resource = null;
      JavaProject javaProject = (JavaProject) openable.getJavaProject();
      resource = workingCopy != null ? workingCopy.getResource() : openable.getResource();
      if (resource == null)
        resource = javaProject.getProject(); // case of a file in an external jar
      if (!javaProject.equals(previousJavaProject)) {
        // locate matches in previous project
        if (previousJavaProject != null) {
View Full Code Here

*/
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
  try {
    IType type = null;
    if (this.handleFactory != null) {
      Openable openable = this.handleFactory.createOpenable(path, this.scope);
      if (openable == null) return;
      switch (openable.getElementType()) {
        case IJavaElement.COMPILATION_UNIT:
          ICompilationUnit cu = (ICompilationUnit) openable;
          if (enclosingTypeNames != null && enclosingTypeNames.length > 0) {
            type = cu.getType(new String(enclosingTypeNames[0]));
            for (int j=1, l=enclosingTypeNames.length; j<l; j++) {
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.core.Openable

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.