Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IParent


         * classes was changed from A$1, A$2, A$3, A$4, ..., A$n
         * to A$1, A$1$1, A$1$2, A$1$2$1, ..., A$2, A$2$1, A$2$2, ..., A$x$y
         */
        boolean allowNested = ! is50OrHigher(anonType);

        IParent declaringType;
        if(allowNested) {
            declaringType = (IType) getLastAncestor(anonType, IJavaElement.TYPE);
        } else {
            declaringType = anonType.getDeclaringType();
        }
View Full Code Here


                    break;
            }

            if (!skip && e instanceof IParent)
            {
                IParent newParent = (IParent) e;
                findIndirectReferences(indirect, pckg, newParent, p);
            }
        }
    }
View Full Code Here

  private List<Template> getMatchingTemplates(String fullClassName, String query, String contextTypeId) {
    System.out.println("getMatchingMethods {" + fullClassName + "}.{" + query + "}");
    List<Template> result = new ArrayList<Template>();
    IJavaProject javaProject = JavaCore.create(editor.getProject());
    try {
      IParent parent;
      // Look for classes
      parent = javaProject.findType(fullClassName);
      if (parent != null) {
        return getAllMethodsTemplates((IType)parent, query, contextTypeId);
      }
      // Look for package fragments
      parent = getPackageFragment(javaProject, fullClassName);
      if (parent == null) {
        return result;
      }
      for (IJavaElement child: parent.getChildren()) {
        if (child instanceof IPackageFragment) {
          result.add(getTemplate(contextTypeId, (IPackageFragment)child));
        } else if (child instanceof ICompilationUnit) { // Java class
          result.add(getTemplate(contextTypeId, (ICompilationUnit)child));
        }
View Full Code Here

       return list;
     }
    
    // Non COMPILATION_UNITs will have to be further traversed
    if(javaElement instanceof IParent) {
        IParent parent = (IParent) javaElement;
       
        // Do not traverse PACKAGE_FRAGMENT_ROOTs that are ReadOnly
        // this ignores libraries and .class files
        if(javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
            && javaElement.isReadOnly()) {
        return null;
        }
       
       // Traverse
        try {
         if(parent.hasChildren()) {
           IJavaElement[] children = parent.getChildren();
          for(int i = 0; i < children.length; i++) {
            temp = collectCompilationUnits(children[i]);
            if(temp != null)
              if(list == null)
                list = temp;
View Full Code Here

       return;
     }
    
    // Non COMPILATION_UNITs will have to be further traversed
    if(javaElement instanceof IParent) {
        IParent parent = (IParent) javaElement;
       
        // Do not traverse PACKAGE_FRAGMENT_ROOTs that are ReadOnly
        // this ignores libraries and .class files
        if(! includeArchives
            && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
            && javaElement.isReadOnly()) {
        return;
        }
       
       // Traverse
        try {
         if(parent.hasChildren()) {
           IJavaElement[] children = parent.getChildren();
          for(int i = 0; i < children.length; i++)
            collectTypeRoots(list, children[i], includeArchives);
         }
      } catch (JavaModelException jme) {
        log.log(Level.SEVERE, "Problem traversing Java model element: " + parent, jme);
View Full Code Here

       return list;
     }
    
    // Non COMPILATION_UNITs will have to be further traversed
    if(javaElement instanceof IParent) {
        IParent parent = (IParent) javaElement;
       
        // Do not traverse PACKAGE_FRAGMENT_ROOTs that are ReadOnly
        // this ignores libraries and .class files
        if(javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
            && javaElement.isReadOnly()) {
        return null;
        }
       
       // Traverse
        try {
         if(parent.hasChildren()) {
           IJavaElement[] children = parent.getChildren();
          for(int i = 0; i < children.length; i++) {
            temp = collectCompilationUnits(children[i]);
            if(temp != null)
              if(list == null)
                list = temp;
View Full Code Here

         * classes was changed from A$1, A$2, A$3, A$4, ..., A$n to A$1, A$1$1,
         * A$1$2, A$1$2$1, ..., A$2, A$2$1, A$2$2, ..., A$x$y
         */
        boolean allowNested = !is50OrHigher(parentType);

        IParent declaringType;
        if (allowNested) {
            declaringType = (IType) getLastAncestor(parentType, IJavaElement.TYPE);
        } else {
            declaringType = parentType.getDeclaringType();
        }
View Full Code Here

    ctx.fScanner.setSource(null);
  }

  private void computeFoldingStructure(FoldingStructureComputationContext ctx) {
    IParent parent = (IParent) fInput;
    try {
      if (!(fInput instanceof ISourceReference))
        return;
      String source = ((ISourceReference) fInput).getSource();
      if (source == null)
        return;

      ctx.getScanner().setSource(source.toCharArray());
      computeFoldingStructure(parent.getChildren(), ctx);
    } catch (JavaModelException x) {}
  }
View Full Code Here

    ctx.fScanner.setSource(null);
  }

  private void computeFoldingStructure(FoldingStructureComputationContext ctx) {
    IParent parent = (IParent) fInput;
    try {
      if (!(fInput instanceof ISourceReference))
        return;
      String source = ((ISourceReference) fInput).getSource();
      if (source == null)
        return;

      ctx.getScanner().setSource(source.toCharArray());
      computeFoldingStructure(parent.getChildren(), ctx);
    } catch (JavaModelException x) {}
  }
View Full Code Here

    ctx.fScanner.setSource(null);
  }

  private void computeFoldingStructure(FoldingStructureComputationContext ctx) {
    IParent parent = (IParent) fInput;
    try {
      if (!(fInput instanceof ISourceReference))
        return;
      String source = ((ISourceReference) fInput).getSource();
      if (source == null)
        return;

      ctx.getScanner().setSource(source.toCharArray());
      computeFoldingStructure(parent.getChildren(), ctx);
    } catch (JavaModelException x) {}
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IParent

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.