List of usage examples for org.eclipse.jdt.core IPackageDeclaration getAncestor
IJavaElement getAncestor(int ancestorType);
From source file:at.bestsolution.fxide.jdt.text.javadoc.JavadocContentAccess2.java
License:Open Source License
/** * Returns the Javadoc for a PackageDeclaration. * * @param packageDeclaration the Java element whose Javadoc has to be retrieved * @return the package documentation in HTML format or <code>null</code> if there is no * associated Javadoc//from w ww . j a v a 2 s. c o m * @throws CoreException if the Java element does not exists or an exception occurs while * accessing the file containing the package Javadoc * @since 3.9 */ public static String getHTMLContent(IPackageDeclaration packageDeclaration) throws CoreException { IJavaElement element = packageDeclaration.getAncestor(IJavaElement.PACKAGE_FRAGMENT); if (element instanceof IPackageFragment) { return getHTMLContent((IPackageFragment) element); } return null; }
From source file:org.eclipse.che.jdt.javadoc.JavadocContentAccess2.java
License:Open Source License
/** * Returns the Javadoc for a PackageDeclaration. * * @param packageDeclaration the Java element whose Javadoc has to be retrieved * @param urlPrefix//from w w w .j a v a2s. c o m * @return the package documentation in HTML format or <code>null</code> if there is no * associated Javadoc * @throws CoreException if the Java element does not exists or an exception occurs while * accessing the file containing the package Javadoc * @since 3.9 */ public static String getHTMLContent(IPackageDeclaration packageDeclaration, String urlPrefix) throws CoreException { IJavaElement element = packageDeclaration.getAncestor(IJavaElement.PACKAGE_FRAGMENT); if (element instanceof IPackageFragment) { return getHTMLContent((IPackageFragment) element, urlPrefix); } return null; }