protected IPackageDeclaration transplantHandle(ICompilationUnit parent, IPackageDeclaration element) { return parent.getPackageDeclaration(element.getElementName()); }
public static PackageDeclaration getPackageDeclarationNode(IPackageDeclaration reference, CompilationUnit cuNode) throws JavaModelException { return (PackageDeclaration) findNode(reference.getSourceRange(), cuNode); }
/** * 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 * @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; }
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {
if (curr instanceof IPackageDeclaration) { try { ISourceRange nameRange= ((IPackageDeclaration) curr).getNameRange(); if (SourceRange.isAvailable(nameRange)) { ITypeRoot typeRoot= (ITypeRoot) ((IPackageDeclaration) curr).getParent(); Region hoverRegion= new Region(nameRange.getOffset(), nameRange.getLength()); JavadocHover.addAnnotations(buffer, typeRoot.getParent(), typeRoot, hoverRegion);
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {
if (curr instanceof IPackageDeclaration) { try { ISourceRange nameRange= ((IPackageDeclaration) curr).getNameRange(); if (SourceRange.isAvailable(nameRange)) { ITypeRoot typeRoot= (ITypeRoot) ((IPackageDeclaration) curr).getParent(); Region hoverRegion= new Region(nameRange.getOffset(), nameRange.getLength()); JavadocHover.addAnnotations(buffer, typeRoot.getParent(), typeRoot, hoverRegion);
protected IPackageDeclaration transplantHandle(ICompilationUnit parent, IPackageDeclaration element) { return parent.getPackageDeclaration(element.getElementName()); }
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {
public static PackageDeclaration getPackageDeclarationNode(IPackageDeclaration reference, CompilationUnit cuNode) throws JavaModelException { return (PackageDeclaration) findNode(reference.getSourceRange(), cuNode); }
/** * 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 * @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; }
protected IPackageDeclaration transplantHandle(ICompilationUnit parent, IPackageDeclaration element) { return parent.getPackageDeclaration(element.getElementName()); }
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {
public static PackageDeclaration getPackageDeclarationNode(IPackageDeclaration reference, CompilationUnit cuNode) throws JavaModelException { return (PackageDeclaration) findNode(reference.getSourceRange(), cuNode); }
/** * 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 * @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; }
protected IPackageDeclaration transplantHandle(ICompilationUnit parent, IPackageDeclaration element) { return parent.getPackageDeclaration(element.getElementName()); }
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {
public static PackageDeclaration getPackageDeclarationNode(IPackageDeclaration reference, CompilationUnit cuNode) throws JavaModelException { return (PackageDeclaration) findNode(reference.getSourceRange(), cuNode); }
public static String getPackageName(ICompilationUnit cu) { if (cu == null) { throw new IllegalArgumentException("cu is null"); } try { IPackageDeclaration[] pkgDecl = cu.getPackageDeclarations(); // TODO: handle default package? if (pkgDecl != null && pkgDecl.length > 0) { String packageName = pkgDecl[0].getElementName(); return packageName; } } catch (JavaModelException e) { } return ""; }
try { if(((packageName == null || packageName.length == 0) && wc.getPackageDeclarations().length == 0) || (!(packageName == null || packageName.length == 0) && wc.getPackageDeclaration(new String(packageName)).exists())) {