Examples of IImportDeclaration


Examples of org.aspectj.org.eclipse.jdt.core.IImportDeclaration

    List existingImport= null;
    if (restoreExistingImports) {
      existingImport= new ArrayList();
      IImportDeclaration[] imports= cu.getImports();
      for (int i= 0; i < imports.length; i++) {
        IImportDeclaration curr= imports[i];
        char prefix= Flags.isStatic(curr.getFlags()) ? STATIC_PREFIX : NORMAL_PREFIX;     
        existingImport.add(prefix + curr.getElementName());
      }
    }
    return new ImportRewrite(cu, null, existingImport);
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IImportDeclaration

    IJavaElement dest = getDestinationParent(element);
    switch (element.getElementType()) {
      case IJavaElement.PACKAGE_DECLARATION :
        return new CreatePackageDeclarationOperation(element.getElementName(), (ICompilationUnit) dest);
      case IJavaElement.IMPORT_DECLARATION :
        IImportDeclaration importDeclaration = (IImportDeclaration) element;
        return new CreateImportOperation(element.getElementName(), (ICompilationUnit) dest, importDeclaration.getFlags());
      case IJavaElement.TYPE :
        if (isRenamingMainType(element, dest)) {
          IPath path = element.getPath();
          String extension = path.getFileExtension();
          return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + '.' + extension}, this.force);
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

    List existingImport= null;
    if (restoreExistingImports) {
      existingImport= new ArrayList();
      IImportDeclaration[] imports= cu.getImports();
      for (int i= 0; i < imports.length; i++) {
        IImportDeclaration curr= imports[i];
        char prefix= Flags.isStatic(curr.getFlags()) ? STATIC_PREFIX : NORMAL_PREFIX;
        existingImport.add(prefix + curr.getElementName());
      }
    }
    return new ImportRewrite(cu, null, existingImport);
  }
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

        if(typeName!=null) {
          // If we don't have the type fully qualified name,
          if(typeName.startsWith("Q")) {
            // We get the simple name
            typeName = typeName.substring(1, typeName.length()-1);
            IImportDeclaration imp = null;
            // And try to resolve the full name from the imports
            if(imports!=null) {
              for(int i=0 ; i<imports.length ; i++) {
                imp = imports[i];
                if(imp.getElementName().endsWith(typeName)) {
                  typeName = imp.getElementName();
                  imported = true;
                  break;
                }
              }
              /*
 
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

        if(typeName!=null) {
          // If we don't have the type fully qualified name,
          if(typeName.startsWith("Q")) {
            // We get the simple name
            typeName = typeName.substring(1, typeName.length()-1);
            IImportDeclaration imp = null;
            // And try to resolve the full name from the imports
            if(imports!=null) {
              for(int i=0 ; i<imports.length ; i++) {
                imp = imports[i];
                if(imp.getElementName().endsWith(typeName)) {
                  typeName = imp.getElementName();
                  imported = true;
                  break;
                }
              }
              /*
 
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

                break;
            case IJavaElement.INITIALIZER :
                appendTypePath(((IMember) element).getDeclaringType(), pathBuffer);
                break;
            case IJavaElement.IMPORT_DECLARATION :
                IImportDeclaration decl= (IImportDeclaration) element;

                if (decl.isOnDemand()) {
                    IJavaElement cont= JavaModelUtil.findTypeContainer(element.getJavaProject(), Signature.getQualifier(decl.getElementName()));
                    if (cont instanceof IType) {
                        appendTypePath((IType) cont, pathBuffer);
                    } else if (cont instanceof IPackageFragment) {
                        appendPackageSummaryPath((IPackageFragment) cont, pathBuffer);
                    }
                } else {
                    IType imp= element.getJavaProject().findType(decl.getElementName());
                    appendTypePath(imp, pathBuffer);
                }
                break;
            case IJavaElement.PACKAGE_DECLARATION :
                IJavaElement pack= element.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

    List existingImport= null;
    if (restoreExistingImports) {
      existingImport= new ArrayList();
      IImportDeclaration[] imports= cu.getImports();
      for (int i= 0; i < imports.length; i++) {
        IImportDeclaration curr= imports[i];
        char prefix= Flags.isStatic(curr.getFlags()) ? STATIC_PREFIX : NORMAL_PREFIX;
        existingImport.add(prefix + curr.getElementName());
      }
    }
    return new ImportRewrite(cu, null, existingImport);
  }
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

    IJavaElement dest = getDestinationParent(element);
    switch (element.getElementType()) {
      case IJavaElement.PACKAGE_DECLARATION :
        return new CreatePackageDeclarationOperation(element.getElementName(), (ICompilationUnit) dest);
      case IJavaElement.IMPORT_DECLARATION :
        IImportDeclaration importDeclaration = (IImportDeclaration) element;
        return new CreateImportOperation(element.getElementName(), (ICompilationUnit) dest, importDeclaration.getFlags());
      case IJavaElement.TYPE :
        if (isRenamingMainType(element, dest)) {
          IPath path = element.getPath();
          String extension = path.getFileExtension();
          return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + '.' + extension}, this.force);
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

          return true;
        }
      }
    }
    ICompilationUnit compilationUnit = type.getCompilationUnit();
    IImportDeclaration importDeclaration = compilationUnit.getImport(TEST_ANNOTATION_FULL_NAME);
    return importDeclaration.exists();
  }
View Full Code Here

Examples of org.eclipse.jdt.core.IImportDeclaration

    IJavaElement dest = getDestinationParent(element);
    switch (element.getElementType()) {
      case IJavaElement.PACKAGE_DECLARATION :
        return new CreatePackageDeclarationOperation(element.getElementName(), (ICompilationUnit) dest);
      case IJavaElement.IMPORT_DECLARATION :
        IImportDeclaration importDeclaration = (IImportDeclaration) element;
        return new CreateImportOperation(element.getElementName(), (ICompilationUnit) dest, importDeclaration.getFlags());
      case IJavaElement.TYPE :
        if (isRenamingMainType(element, dest)) {
          IPath path = element.getPath();
          String extension = path.getFileExtension();
          return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + '.' + extension}, this.force);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.