if (eclipseType != null) { final String qualifiedName = eclipseType.getFullyQualifiedName(); final String root = classFile.getPath().toString(); final IType type = workspace.getTypes().get(MessageFormat.format("{0}.{1}", root, qualifiedName)); //$NON-NLS-1$ return Arrays.asList(type);
private void exportExternalClassFolderElement(IJavaElement javaElement, IPath classFolderPath, IProgressMonitor progressMonitor) throws JavaModelException, InterruptedException { if (javaElement instanceof IClassFile) { IClassFile classFile= (IClassFile) javaElement; IPath path= classFile.getPath(); IPath destination= path.removeFirstSegments(classFolderPath.segmentCount()).setDevice(null); try { ((IJarBuilderExtension) fJarBuilder).writeFile(path.toFile(), destination); } catch (CoreException e) { handleCoreExceptionOnExport(e); } finally { progressMonitor.worked(1); ModalContext.checkCanceled(progressMonitor); } } else if (javaElement instanceof IPackageFragment) { IJavaElement[] children= ((IPackageFragment) javaElement).getChildren(); for (int i= 0; i < children.length; i++) { exportExternalClassFolderElement(children[i], classFolderPath, progressMonitor); } } }
private void exportExternalClassFolderElement(IJavaElement javaElement, IPath classFolderPath, IProgressMonitor progressMonitor) throws JavaModelException, InterruptedException { if (javaElement instanceof IClassFile) { IClassFile classFile= (IClassFile) javaElement; IPath path= classFile.getPath(); IPath destination= path.removeFirstSegments(classFolderPath.segmentCount()).setDevice(null); try { ((IJarBuilderExtension) fJarBuilder).writeFile(path.toFile(), destination); } catch (CoreException e) { handleCoreExceptionOnExport(e); } finally { progressMonitor.worked(1); ModalContext.checkCanceled(progressMonitor); } } else if (javaElement instanceof IPackageFragment) { IJavaElement[] children= ((IPackageFragment) javaElement).getChildren(); for (int i= 0; i < children.length; i++) { exportExternalClassFolderElement(children[i], classFolderPath, progressMonitor); } } }