Search in sources :

Example 1 with MarkupCompletionProposal

use of org.eclipse.wst.xml.ui.internal.contentassist.MarkupCompletionProposal in project sling by apache.

the class ProposalComputer method addAttributeProposal.

private void addAttributeProposal(final ContentAssistRequest contentAssistRequest, ProposalDescription proposalDescription) {
    String replacementString = proposalDescription.getInsertionText();
    int replacementOffset = contentAssistRequest.getReplacementBeginPosition();
    int replacementLength = contentAssistRequest.getReplacementLength();
    int cursorPosition = getCursorPositionForProposedText(replacementString);
    ICompletionProposal proposal = new MarkupCompletionProposal(replacementString.toString(), replacementOffset, replacementLength, cursorPosition, SharedImages.SIGHTLY_ICON.createImage(), proposalDescription.getLabel(), null, proposalDescription.getAdditionalInfo(), XMLRelevanceConstants.R_TAG_NAME);
    contentAssistRequest.addProposal(proposal);
}
Also used : ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) MarkupCompletionProposal(org.eclipse.wst.xml.ui.internal.contentassist.MarkupCompletionProposal)

Aggregations

ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)1 MarkupCompletionProposal (org.eclipse.wst.xml.ui.internal.contentassist.MarkupCompletionProposal)1