Examples of PsiPackage


Examples of com.intellij.psi.PsiPackage

   * @return JAM.
   */
  @NotNull
  protected <Jam extends JamElement> Jam getPackageJam(final String packageName,
                                                       final JamPackageMeta<Jam> meta) {
    final PsiPackage myPackage = myFixture.findPackage(packageName);
    assertNotNull(packageName, myPackage);

    final Jam jam = meta.getJamElement(myPackage);
    assertNotNull("JAM was null for " + meta + " in '" + packageName + "'", jam);
    return jam;
View Full Code Here

Examples of com.intellij.psi.PsiPackage

        }
        PsiFile file = null;
        if ( element instanceof PsiDirectory ) {
            // let's see whether we can map the directory to a package; if so, change the
            // element to the package and continue
            PsiPackage pkg = JavaDirectoryService.getInstance().getPackage((PsiDirectory)element);
            if ( pkg != null ) {
                element = pkg;
            }
            else {
                return null;
View Full Code Here

Examples of com.intellij.psi.PsiPackage

                break;
                case MESSAGE_OR_PACKAGE_OR_GROUP: {
                    PbFile containingFile = (PbFile) ref.getElement().getContainingFile();
                    //resolve in subpackages scope
                    //alg: find subpackage and then find it in subpackages
                    PsiPackage subPackage = resolveInSubPackagesScope((PsiPackage) scope, refName);
                    if (subPackage != null) {
                        //f(subPackage, thisFile) -> boolean
                        //true if this subPackage in visible scope either false
                        if (PbPsiUtil.isVisibleSubPackage(subPackage, containingFile)) {
                            return subPackage;
View Full Code Here

Examples of com.intellij.psi.PsiPackage

      if (file != null) {
        VirtualFile dir = file.getParent();
        if (dir == null) return null;
        PsiDirectory psiDirectory = PsiManager.getInstance(myProject).findDirectory(dir);
        if (psiDirectory != null) {
          PsiPackage aPackage = psiDirectory.getPackage();
          if (aPackage != null) return new PackageGroup(aPackage);
        }
        return new DirectoryGroup(dir);
      }
    }
View Full Code Here

Examples of com.intellij.psi.PsiPackage

  }

  public PsiManager getManager() { return myManager; }

  public PsiDirectory[] getDirectories() {
    final PsiPackage aPackage = myManager.findPackage(myQualifiedName);
    if (aPackage != null) {
      return aPackage.getDirectories();
    } else {
      return PsiDirectory.EMPTY_ARRAY;
    }
  }
View Full Code Here

Examples of com.intellij.psi.PsiPackage

      return fileIndex.getPackageNameByDirectory(vFile.getParent()) + "." + file.getVirtualFile().getNameWithoutExtension();
    }

    if (file instanceof PsiJavaFile) return ((PsiJavaFile)file).getPackageName() + "." + file.getVirtualFile().getNameWithoutExtension();
    PsiDirectory dir = file.getContainingDirectory();
    PsiPackage aPackage = dir.getPackage();
    return aPackage == null ? file.getName() : aPackage.getQualifiedName() + "." + file.getVirtualFile().getNameWithoutExtension();
  }
View Full Code Here

Examples of com.intellij.psi.PsiPackage

    return true;
  }

  @Nullable
  public PsiPackage resolve() {
    final PsiPackage parentPackage = getPsiPackage();
    if (parentPackage != null) {
      for (PsiPackage aPackage : parentPackage.getSubPackages()) {
        if (Comparing.equal(aPackage.getName(), getCanonicalText())) {
          return aPackage;
        }
      }
    }
View Full Code Here

Examples of com.intellij.psi.PsiPackage

    }
    return null;
  }

  public Object[] getVariants() {
    final PsiPackage psiPackage = getPsiPackage();
    if (psiPackage == null) return ArrayUtil.EMPTY_OBJECT_ARRAY;
    final PsiPackage[] psiPackages = psiPackage.getSubPackages();
    final Object[] variants = new Object[psiPackages.length];
    System.arraycopy(psiPackages, 0, variants, 0, variants.length);
    return variants;
  }
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.