public boolean process(@NotNull Editor editor,@NotNull PsiFile psiFile){
  final CaretModel caretModel=editor.getCaretModel();
  final Pair<JavadocHelper.JavadocParameterInfo,List<JavadocHelper.JavadocParameterInfo>> pair=myHelper.parse(psiFile,editor,caretModel.getOffset());
  if (pair.first == null) {
    return false;
  }
  final JavadocHelper.JavadocParameterInfo next=findNext(pair.second,pair.first);
  if (next == null) {
    final int line=pair.first.lastLine + 1;
    final Document document=editor.getDocument();
    if (line < document.getLineCount()) {
      StringBuilder indent=new StringBuilder();
      boolean insertIndent=true;
      final CharSequence text=document.getCharsSequence();
      for (int i=document.getLineStartOffset(line), max=document.getLineEndOffset(line); i < max; i++) {
        final char c=text.charAt(i);
        if (c == ' ' || c == '\t') {
          indent.append(c);
          continue;
        }
 else         if (c == '*') {
          indent.append("* ");
          if (i < max - 1 && text.charAt(i + 1) != '/') {
            insertIndent=false;
          }
        }
        indent.append("\n");
        break;
      }
      if (insertIndent) {
        document.insertString(document.getLineStartOffset(line),indent);
      }
    }
    moveCaretToTheLineEndIfPossible(editor,line);
    return true;
  }
  if (next.parameterDescriptionStartPosition != null) {
    myHelper.navigate(next.parameterDescriptionStartPosition,editor,psiFile.getProject());
  }
 else {
    final LogicalPosition position=myHelper.calculateDescriptionStartPosition(psiFile,pair.second,next);
    myHelper.navigate(position,editor,psiFile.getProject());
  }
  return true;
}

public boolean process ( @ NotNull Editor editor , @ NotNull PsiFile psiFile ) { final CaretModel caretModel = editor . getCaretModel ( ) ; final Pair < JavadocHelper . JavadocParameterInfo , List < JavadocHelper . JavadocParameterInfo > > pair = myHelper . parse ( psiFile , editor , caretModel . getOffset ( ) ) ; if ( pair . first == null ) { return false ; } final JavadocHelper . JavadocParameterInfo next = findNext ( pair . second , pair . first ) ; if ( next == null ) { final int line = pair . first . lastLine + 1 ; final Document document = editor . getDocument ( ) ; if ( line < document . getLineCount ( ) ) { StringBuilder indent = new StringBuilder ( ) ; boolean insertIndent = true ; final CharSequence text = document . getCharsSequence ( ) ; for ( int i = document . getLineStartOffset ( line ) , max = document . getLineEndOffset ( line ) ; i < max ; i ++ ) { final char c = text . charAt ( i ) ; if ( c == ' ' || c == '\t' ) { indent . append ( c ) ; continue ; } else if ( c == '*' ) { indent . append ( "* " ) ; if ( i < max - 1 && text . charAt ( i + 1 ) != '/' ) { insertIndent = false ; } } indent . append ( "\n" ) ; break ; } if ( insertIndent ) { document . insertString ( document . getLineStartOffset ( line ) , indent ) ; } } moveCaretToTheLineEndIfPossible ( editor , line ) ; return true ; } if ( next . parameterDescriptionStartPosition != null ) { myHelper . navigate ( next . parameterDescriptionStartPosition , editor , psiFile . getProject ( ) ) ; } else { final LogicalPosition position = myHelper . calculateDescriptionStartPosition ( psiFile , pair . second , next ) ; myHelper . navigate ( position , editor , psiFile . getProject ( ) ) ; } return true ; }
checks if caret of the given editor is located inside javadoc and tries to perform smart completion there in case of the positive answer .
