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

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

Introduction

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

Prototype

public int getReplacementOffset() 

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   w  w w.  j  a  v  a2 s.c o  m
    }
    proposals.clear();
    proposals.addAll(newList);
}