@Override public String toString() { return getDisplayString(); }
@Override public String toString() { return getDisplayString(); }
public String toString() { return getDisplayString(); }
/** * Checks whether <code>prefix</code> is a valid prefix for this proposal. Usually, while code * completion is in progress, the user types and edits the prefix in the document in order to * filter the proposal list. From {@link #validate(IDocument, int, DocumentEvent) }, the * current prefix in the document is extracted and this method is called to find out whether the * proposal is still valid. * <p> * The default implementation checks if <code>prefix</code> is a prefix of the proposal's * {@link #getDisplayString() display string} using the {@link #isPrefix(String, String) } * method. * </p> * * @param prefix the current prefix in the document * @return <code>true</code> if <code>prefix</code> is a valid prefix of this proposal */ protected boolean isValidPrefix(String prefix) { /* * See http://dev.eclipse.org/bugs/show_bug.cgi?id=17667 * why we do not use the replacement string. * String word= fReplacementString; */ return isPrefix(prefix, getDisplayString()); }
@Override public String getDisplayString() { if (!fDisplayStringComputed) setStyledDisplayString(computeDisplayString()); return super.getDisplayString(); }
public final String getDisplayString() { if (!fDisplayStringComputed) setDisplayString(computeDisplayString()); return super.getDisplayString(); }
@Override public String getDisplayString() { if (!fDisplayStringComputed) setStyledDisplayString(computeDisplayString()); return super.getDisplayString(); }
/** * Checks whether <code>pattern</code> is a valid pattern for this proposal. Usually, while code * completion is in progress, the user types and edits the pattern in the document in order to * filter the proposal list. From {@link #validate(IDocument, int, DocumentEvent) }, the current * pattern in the document is extracted and this method is called to find out whether the * proposal is still valid. * <p> * The default implementation checks if <code>pattern</code> matches the proposal's * {@link #getDisplayString() display string} using the {@link #isPrefix(String, String) } * method. * </p> * * @param pattern the current pattern in the document * @return <code>true</code> if <code>pattern</code> is a valid match for this proposal */ protected boolean isValidPrefix(String pattern) { /* * See http://dev.eclipse.org/bugs/show_bug.cgi?id=17667 * why we do not use the replacement string. * String word= fReplacementString; * * Besides that bug we also use the display string * for performance reasons, as computing the * replacement string can be expensive. */ return isPrefix(pattern, TextProcessor.deprocess(getDisplayString())); }
/** * Checks whether <code>pattern</code> is a valid pattern for this proposal. Usually, while code * completion is in progress, the user types and edits the pattern in the document in order to * filter the proposal list. From {@link #validate(IDocument, int, DocumentEvent) }, the current * pattern in the document is extracted and this method is called to find out whether the * proposal is still valid. * <p> * The default implementation checks if <code>pattern</code> matches the proposal's * {@link #getDisplayString() display string} using the {@link #isPrefix(String, String) } * method. * </p> * * @param pattern the current pattern in the document * @return <code>true</code> if <code>pattern</code> is a valid match for this proposal */ protected boolean isValidPrefix(String pattern) { /* * See http://dev.eclipse.org/bugs/show_bug.cgi?id=17667 * why we do not use the replacement string. * String word= fReplacementString; * * Besides that bug we also use the display string * for performance reasons, as computing the * replacement string can be expensive. */ return isPrefix(pattern, TextProcessor.deprocess(getDisplayString())); }