/** * Creates the Javadoc tags for newly inserted comments. * * @param document the document * @param command the command * @param indentation the base indentation to use * @param lineDelimiter the line delimiter to use * @param unit the compilation unit shown in the editor * @return the tags to add to the document * @throws CoreException if accessing the Java model fails * @throws BadLocationException if accessing the document fails */ private String createJavaDocTags(IDocument document, DocumentCommand command, String indentation, String lineDelimiter, ICompilationUnit unit) throws CoreException, BadLocationException { IJavaElement element= unit.getElementAt(command.offset); if (element == null) return null; switch (element.getElementType()) { case IJavaElement.TYPE: return createTypeTags(document, command, indentation, lineDelimiter, (IType) element); case IJavaElement.METHOD: return createMethodTags(document, command, indentation, lineDelimiter, (IMethod) element); default: return null; } }
/** * Creates the Javadoc tags for newly inserted comments. * * @param document the document * @param command the command * @param indentation the base indentation to use * @param lineDelimiter the line delimiter to use * @param unit the compilation unit shown in the editor * @return the tags to add to the document * @throws CoreException if accessing the Java model fails * @throws BadLocationException if accessing the document fails */ private String createJavaDocTags(IDocument document, DocumentCommand command, String indentation, String lineDelimiter, ICompilationUnit unit) throws CoreException, BadLocationException { IJavaElement element= unit.getElementAt(command.offset); if (element == null) return null; switch (element.getElementType()) { case IJavaElement.TYPE: return createTypeTags(document, command, indentation, lineDelimiter, (IType) element); case IJavaElement.METHOD: return createMethodTags(document, command, indentation, lineDelimiter, (IMethod) element); default: return null; } }
/** * Creates the Javadoc tags for newly inserted comments. * * @param document the document * @param command the command * @param indentation the base indentation to use * @param lineDelimiter the line delimiter to use * @param unit the compilation unit shown in the editor * @return the tags to add to the document * @throws CoreException if accessing the java model fails * @throws BadLocationException if accessing the document fails */ private String createJavaDocTags(IDocument document, DocumentCommand command, String indentation, String lineDelimiter, ICompilationUnit unit) throws CoreException, BadLocationException { IJavaElement element= unit.getElementAt(command.offset); if (element == null) return null; switch (element.getElementType()) { case IJavaElement.TYPE: return createTypeTags(document, command, indentation, lineDelimiter, (IType) element); case IJavaElement.METHOD: return createMethodTags(document, command, indentation, lineDelimiter, (IMethod) element); default: return null; } }