@Override
    public String getAdditionalProposalInfo() {
        try {
            ASTNode coveringNode = mContext.getCoveringNode();
            int start = coveringNode.getStartPosition();
            int length = coveringNode.getLength();
            IBuffer buffer = mContext.getCompilationUnit().getBuffer();
            StringBuilder sb = new StringBuilder();
            String string = buffer.getText(start, length);
            string = ExtractStringRefactoring.unquoteAttrValue(string);
            String token = ExtractStringInputPage.guessId(string);
            // Look up the beginning and the end of the line (outside of the extracted string)
            // such that we can show a preview of the diff, e.g. if you have
            // foo.setTitle("Hello"); we want to show foo.setTitle(R.string.hello);
            // so we need to extract "foo.setTitle(" and ");".
            // Look backwards to the beginning of the line (and strip whitespace)
            int i = start - 1;
            while (i > 0) {
                char c = buffer.getChar(i);
                if (c == '\r' || (c == '\n')) {
                    break;
                }
                i--;
            }
            String linePrefix = buffer.getText(i + 1, start - (i + 1)).trim();
            // Look forwards to the end of the line (and strip whitespace)
            i = start + length;
            while (i < buffer.getLength()) {
                char c = buffer.getChar(i);
                if (c == '\r' || (c == '\n')) {
                    break;
                }
                i++;
            }
            String lineSuffix = buffer.getText(start + length, i - (start + length));
            // Should we show the replacement as just R.string.foo or
            // context.getString(R.string.foo) ?
            boolean useContext = false;
            ASTNode parent = coveringNode.getParent();
            if (parent != null) {
                int type = parent.getNodeType();
                if (type == ASTNode.ASSIGNMENT
                        || type == ASTNode.VARIABLE_DECLARATION_STATEMENT
                        || type == ASTNode.VARIABLE_DECLARATION_FRAGMENT
                        || type == ASTNode.VARIABLE_DECLARATION_EXPRESSION) {
                    useContext = true;
                }
            }
            // Display .java change:
            sb.append("...<br>");                   //$NON-NLS-1$
            sb.append(linePrefix);
            sb.append("<b>");                       //$NON-NLS-1$
            if (useContext) {
                sb.append("context.getString(");    //$NON-NLS-1$
            }
            sb.append("R.string.");                 //$NON-NLS-1$
            sb.append(token);
            if (useContext) {
                sb.append(")");                     //$NON-NLS-1$
            }
            sb.append("</b>");                      //$NON-NLS-1$
            sb.append(lineSuffix);
            sb.append("<br>...<br>");               //$NON-NLS-1$
            // Display strings.xml change:
            sb.append("<br>");                      //$NON-NLS-1$
            sb.append("&lt;resources&gt;<br>");     //$NON-NLS-1$
            sb.append("    <b>&lt;string name=\""); //$NON-NLS-1$
            sb.append(token);
            sb.append("\"&gt;");                    //$NON-NLS-1$
            sb.append(string);
            sb.append("&lt;/string&gt;</b><br>");   //$NON-NLS-1$
            sb.append("&lt;/resources&gt;");        //$NON-NLS-1$
            return sb.toString();
        } catch (JavaModelException e) {
            AdtPlugin.log(e, null);
        }
        return "Initiates the Extract String refactoring operation";
    }
@Override
    public String getAdditionalProposalInfo() {
        try {
            ASTNode coveringNode = mContext.getCoveringNode();
            int start = coveringNode.getStartPosition();
            int length = coveringNode.getLength();
            IBuffer buffer = mContext.getCompilationUnit().getBuffer();
            StringBuilder sb = new StringBuilder();
            String string = buffer.getText(start, length);
            string = ExtractStringRefactoring.unquoteAttrValue(string);
            String token = ExtractStringInputPage.guessId(string);
           
           
           
           
           
            int i = start - 1;
            while (i > 0) {
                char c = buffer.getChar(i);
                if (c == '\r' || (c == '\n')) {
                    break;
                }
                i--;
            }
            String linePrefix = buffer.getText(i + 1, start - (i + 1)).trim();
           
            i = start + length;
            while (i < buffer.getLength()) {
                char c = buffer.getChar(i);
                if (c == '\r' || (c == '\n')) {
                    break;
                }
                i++;
            }
            String lineSuffix = buffer.getText(start + length, i - (start + length));
           
           
            boolean useContext = false;
            ASTNode parent = coveringNode.getParent();
            if (parent != null) {
                int type = parent.getNodeType();
                if (type == ASTNode.ASSIGNMENT
                        || type == ASTNode.VARIABLE_DECLARATION_STATEMENT
                        || type == ASTNode.VARIABLE_DECLARATION_FRAGMENT
                        || type == ASTNode.VARIABLE_DECLARATION_EXPRESSION) {
                    useContext = true;
                }
            }
           
            sb.append("...<br>");                  
            sb.append(linePrefix);
            sb.append("<b>");                      
            if (useContext) {
                sb.append("context.getString(");   
            }
            sb.append("R.string.");                
            sb.append(token);
            if (useContext) {
                sb.append(")");                    
            }
            sb.append("</b>");                     
            sb.append(lineSuffix);
            sb.append("<br>...<br>");              
           
            sb.append("<br>");                     
            sb.append("&lt;resources&gt;<br>");    
            sb.append("    <b>&lt;string name=\"");
            sb.append(token);
            sb.append("\"&gt;");                   
            sb.append(string);
            sb.append("&lt;/string&gt;</b><br>");  
            sb.append("&lt;/resources&gt;");       
            return sb.toString();
        } catch (JavaModelException e) {
            AdtPlugin.log(e, null);
        }
        return "Initiates the Extract String refactoring operation";
    }
@override public string getadditionalproposalinfo() { try { astnode coveringnode = mcontext.getcoveringnode(); int start = coveringnode.getstartposition(); int length = coveringnode.getlength(); ibuffer buffer = mcontext.getcompilationunit().getbuffer(); stringbuilder sb = new stringbuilder(); string string = buffer.gettext(start, length); string = extractstringrefactoring.unquoteattrvalue(string); string token = extractstringinputpage.guessid(string); int i = start - 1; while (i > 0) { char c = buffer.getchar(i); if (c == '\r' || (c == '\n')) { break; } i--; } string lineprefix = buffer.gettext(i + 1, start - (i + 1)).trim(); i = start + length; while (i < buffer.getlength()) { char c = buffer.getchar(i); if (c == '\r' || (c == '\n')) { break; } i++; } string linesuffix = buffer.gettext(start + length, i - (start + length)); boolean usecontext = false; astnode parent = coveringnode.getparent(); if (parent != null) { int type = parent.getnodetype(); if (type == astnode.assignment || type == astnode.variable_declaration_statement || type == astnode.variable_declaration_fragment || type == astnode.variable_declaration_expression) { usecontext = true; } } sb.append("...<br>"); sb.append(lineprefix); sb.append("<b>"); if (usecontext) { sb.append("context.getstring("); } sb.append("r.string."); sb.append(token); if (usecontext) { sb.append(")"); } sb.append("</b>"); sb.append(linesuffix); sb.append("<br>...<br>"); sb.append("<br>"); sb.append("&lt;resources&gt;<br>"); sb.append(" <b>&lt;string name=\""); sb.append(token); sb.append("\"&gt;"); sb.append(string); sb.append("&lt;/string&gt;</b><br>"); sb.append("&lt;/resources&gt;"); return sb.tostring(); } catch (javamodelexception e) { adtplugin.log(e, null); } return "initiates the extract string refactoring operation"; }