org.eclipse.jface.text.contentassist.BoldStylerProvider Java Examples
The following examples show how to use
org.eclipse.jface.text.contentassist.BoldStylerProvider.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeScriptCompletionProposalWithExtension7.java From typescript.java with MIT License | 6 votes |
@Override public StyledString getStyledDisplayString(IDocument document, int offset, BoldStylerProvider boldStylerProvider) { // Highlight matched prefix StyledString styledDisplayString = new StyledString(); styledDisplayString.append(getStyledDisplayString()); String pattern = getPatternToEmphasizeMatch(document, offset); if (pattern != null && pattern.length() > 0) { String displayString = styledDisplayString.getString(); int[] bestSequence = getMatcher().bestSubsequence(displayString, pattern); int highlightAdjustment = 0; for (int index : bestSequence) { styledDisplayString.setStyle(index + highlightAdjustment, 1, boldStylerProvider.getBoldStyler()); } } return styledDisplayString; }
Example #2
Source File: ToolboxCompletionProcessor.java From tlaplus with MIT License | 5 votes |
public StyledString getStyledDisplayString(IDocument document, int offset, BoldStylerProvider boldStylerProvider) { final StyledString styledString = new StyledString(); styledString.append(getDisplayString()); styledString.append(": "); styledString.append(fReplacementString.replaceAll("\n[ ]*", " "), StyledString.COUNTER_STYLER); return styledString; }