Examples of PackageFragment


Examples of org.eclipse.jdt.internal.core.PackageFragment

    return (IBinaryType) binaryType.getElementInfo(); // reuse the info from the java model cache

  // create a temporary info
  IBinaryType info;
  try {
    PackageFragment pkg = (PackageFragment) classFile.getParent();
    PackageFragmentRoot root = (PackageFragmentRoot) pkg.getParent();
    if (root.isArchive()) {
      // class file in a jar
      String classFileName = classFile.getElementName();
      String classFilePath = Util.concatWith(pkg.names, classFileName, '/');
      ZipFile zipFile = null;
View Full Code Here

Examples of org.eclipse.jdt.internal.core.PackageFragment

      } else if (element instanceof SourceType) {
        units.add((SourceType) element);
      } else if (element instanceof ICompilationUnit) {
        units.addAll(Arrays.asList(((ICompilationUnit) element).getTypes()));
      } else if (element instanceof PackageFragment) {
        PackageFragment p = (PackageFragment) element;
        for (ICompilationUnit icu : p.getCompilationUnits()) {
          units.addAll(Arrays.asList(icu.getTypes()));
        }
      } else if (element instanceof PackageFragmentRoot) {
        PackageFragmentRoot pfr = (PackageFragmentRoot) element;
        for (IJavaElement e : pfr.getChildren()) {
View Full Code Here

Examples of org.eclipse.jdt.internal.core.PackageFragment

        file = (IFile) resource;
      }
      else {
        IClassFile classFile = configClass.getClassFile();
       
        PackageFragment pkg = (PackageFragment) configClass.getPackageFragment();
        IPackageFragmentRoot root = (IPackageFragmentRoot) pkg.getParent();

        if (root.isArchive()) {
          IPath zipPath = root.getPath();

          String classFileName = classFile.getElementName();
View Full Code Here

Examples of org.eclipse.jdt.internal.core.PackageFragment

  public static String getNewDestinationFullyQualifiedName( final IResource resource, final String newDestination ) {
    // TODO Auto-generated method stub
    String projectRelativeDestination = "F/" + resource.getProject().getName();
    IJavaElement e = JavaCore.create( resource.getProject().getFolder( newDestination.replaceFirst( projectRelativeDestination, "" ) ) );
    if ( e != null && e instanceof PackageFragment ) {
      PackageFragment p = (PackageFragment) e;
      return p.getElementName() + "." + resource.getName().replaceAll( ".java", "" );
    }
    else if ( e != null && e instanceof IPackageFragmentRoot ) {
      return resource.getName();
    }
    else {
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.