private String computeReplacementString(){
  int proposalKind=fProposal.getKind();
  String qualifiedTypeName=null;
  char[] qualifiedType=null;
  if (proposalKind == CompletionProposal.TYPE_IMPORT) {
    qualifiedType=fProposal.getSignature();
    qualifiedTypeName=String.valueOf(Signature.toCharArray(qualifiedType));
  }
 else   if (proposalKind == CompletionProposal.METHOD_IMPORT || proposalKind == CompletionProposal.FIELD_IMPORT) {
    qualifiedType=Signature.getTypeErasure(fProposal.getDeclarationSignature());
    qualifiedTypeName=String.valueOf(Signature.toCharArray(qualifiedType));
  }
 else {
    Assert.isTrue(false);
  }
  fImportRewrite=createImportRewrite();
  if (fImportRewrite != null) {
    if (proposalKind == CompletionProposal.TYPE_IMPORT) {
      String simpleType=fImportRewrite.addImport(qualifiedTypeName,fImportContext);
      if (fParentProposalKind == CompletionProposal.METHOD_REF)       return simpleType + ".";
    }
 else {
      String res=fImportRewrite.addStaticImport(qualifiedTypeName,String.valueOf(fProposal.getName()),proposalKind == CompletionProposal.FIELD_IMPORT,fImportContext);
      int dot=res.lastIndexOf('.');
      if (dot != -1) {
        String typeName=fImportRewrite.addImport(res.substring(0,dot),fImportContext);
        return typeName + '.';
      }
    }
    return "";
  }
  if (fCompilationUnit != null && JavaModelUtil.isImplicitImport(Signature.getQualifier(qualifiedTypeName),fCompilationUnit)) {
    if (fProposal.getKind() == CompletionProposal.TYPE_IMPORT && fParentProposalKind == CompletionProposal.FIELD_REF)     return "";
    qualifiedTypeName=String.valueOf(Signature.getSignatureSimpleName(qualifiedType));
  }
  return qualifiedTypeName + ".";
}

private String computeReplacementString ( ) { int proposalKind = fProposal . getKind ( ) ; String qualifiedTypeName = null ; char [ ] qualifiedType = null ; if ( proposalKind == CompletionProposal . TYPE_IMPORT ) { qualifiedType = fProposal . getSignature ( ) ; qualifiedTypeName = String . valueOf ( Signature . toCharArray ( qualifiedType ) ) ; } else if ( proposalKind == CompletionProposal . METHOD_IMPORT || proposalKind == CompletionProposal . FIELD_IMPORT ) { qualifiedType = Signature . getTypeErasure ( fProposal . getDeclarationSignature ( ) ) ; qualifiedTypeName = String . valueOf ( Signature . toCharArray ( qualifiedType ) ) ; } else { Assert . isTrue ( false ) ; } fImportRewrite = createImportRewrite ( ) ; if ( fImportRewrite != null ) { if ( proposalKind == CompletionProposal . TYPE_IMPORT ) { String simpleType = fImportRewrite . addImport ( qualifiedTypeName , fImportContext ) ; if ( fParentProposalKind == CompletionProposal . METHOD_REF ) return simpleType + "." ; } else { String res = fImportRewrite . addStaticImport ( qualifiedTypeName , String . valueOf ( fProposal . getName ( ) ) , proposalKind == CompletionProposal . FIELD_IMPORT , fImportContext ) ; int dot = res . lastIndexOf ( '.' ) ; if ( dot != - 1 ) { String typeName = fImportRewrite . addImport ( res . substring ( 0 , dot ) , fImportContext ) ; return typeName + '.' ; } } return "" ; } if ( fCompilationUnit != null && JavaModelUtil . isImplicitImport ( Signature . getQualifier ( qualifiedTypeName ) , fCompilationUnit ) ) { if ( fProposal . getKind ( ) == CompletionProposal . TYPE_IMPORT && fParentProposalKind == CompletionProposal . FIELD_REF ) return "" ; qualifiedTypeName = String . valueOf ( Signature . getSignatureSimpleName ( qualifiedType ) ) ; } return qualifiedTypeName + "." ; }
computes the replacement string .
