/** * Creates a new completion proposal. All fields are initialized based on the provided * information. * * @param replacementString the actual string to be inserted into the document * @param replacementOffset the offset of the text to be replaced * @param replacementLength the length of the text to be replaced * @param image the image to display for this proposal * @param displayString the string to be displayed for the proposal If set to <code>null</code>, * the replacement string will be taken as display string. * @param relevance the relevance * @param inJavadoc <code>true</code> for a javadoc proposal * @param invocationContext the invocation context of this completion proposal or <code>null</code> not available */ public JavaCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, StyledString displayString, int relevance, boolean inJavadoc, JavaContentAssistInvocationContext invocationContext) { super(invocationContext); Assert.isNotNull(replacementString); Assert.isTrue(replacementOffset >= 0); Assert.isTrue(replacementLength >= 0); setReplacementString(replacementString); setReplacementOffset(replacementOffset); setReplacementLength(replacementLength); setImage(image); setStyledDisplayString(displayString == null ? new StyledString(replacementString) : displayString); setRelevance(relevance); setCursorPosition(replacementString.length()); setInJavadoc(inJavadoc); setSortString(displayString == null ? replacementString : displayString.getString()); }
/** * Creates a new completion proposal. All fields are initialized based on the provided * information. * * @param replacementString the actual string to be inserted into the document * @param replacementOffset the offset of the text to be replaced * @param replacementLength the length of the text to be replaced * @param image the image to display for this proposal * @param displayString the string to be displayed for the proposal If set to <code>null</code>, * the replacement string will be taken as display string. * @param relevance the relevance * @param inJavadoc <code>true</code> for a javadoc proposal * @param invocationContext the invocation context of this completion proposal or <code>null</code> not available */ public JavaCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, StyledString displayString, int relevance, boolean inJavadoc, JavaContentAssistInvocationContext invocationContext) { super(invocationContext); Assert.isNotNull(replacementString); Assert.isTrue(replacementOffset >= 0); Assert.isTrue(replacementLength >= 0); setReplacementString(replacementString); setReplacementOffset(replacementOffset); setReplacementLength(replacementLength); setImage(image); setStyledDisplayString(displayString == null ? new StyledString(replacementString) : displayString); setRelevance(relevance); setCursorPosition(replacementString.length()); setInJavadoc(inJavadoc); setSortString(displayString == null ? replacementString : displayString.getString()); }