Example usage for org.springframework.ide.eclipse.beans.ui.editor.contentassist BeansJavaCompletionProposal getCursorPosition

List of usage examples for org.springframework.ide.eclipse.beans.ui.editor.contentassist BeansJavaCompletionProposal getCursorPosition

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.ui.editor.contentassist BeansJavaCompletionProposal getCursorPosition.

Prototype

public int getCursorPosition() 

Source Link

Usage

From source file:org.dozer.eclipse.plugin.sourcepage.contentassist.DozerContentAssistProcessor.java

protected void convertProposals(List proposals) {
    //somehow the springide class BeansJavaCompletionUtils adds " to the replacement. Maybe this
    //is because of spring never uses TEXT_NODE's for class-declarations but only attributes, which needs "
    //Thus, we must use our own Proposal class. SpringIDE's BeansJavaCompletionUtils is very inflexible
    //here and cannot be subclassed. So we must replace every Proposal.      
    List<ICompletionProposal> newList = new ArrayList<ICompletionProposal>();
    for (Object object : proposals) {
        BeansJavaCompletionProposal bjcp = (BeansJavaCompletionProposal) object;
        DozerJavaCompletionProposal djcp = new DozerJavaCompletionProposal(bjcp.getReplacementString(),
                bjcp.getReplacementOffset(), bjcp.getReplacementLength(), bjcp.getCursorPosition(),
                bjcp.getImage(), bjcp.getDisplayString(), bjcp.getContextInformation(), bjcp.getRelevance(),
                true, bjcp.getProposedObject());
        newList.add(djcp);/*from  ww  w .ja v  a 2s. c o  m*/
    }
    proposals.clear();
    proposals.addAll(newList);
}