本文整理汇总了Java中org.eclipse.jface.viewers.StyledString.getString方法的典型用法代码示例。如果您正苦于以下问题:Java StyledString.getString方法的具体用法?Java StyledString.getString怎么用?Java StyledString.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.StyledString
的用法示例。
在下文中一共展示了StyledString.getString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStyledDisplayString
import org.eclipse.jface.viewers.StyledString; //导入方法依赖的package包/类
@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 = completionEntry.getMatcher().bestSubsequence(displayString, pattern);
int highlightAdjustment = 0;
for (int index : bestSequence) {
styledDisplayString.setStyle(index + highlightAdjustment, 1, boldStylerProvider.getBoldStyler());
}
}
return styledDisplayString;
}
示例2: getStyledDisplayString
import org.eclipse.jface.viewers.StyledString; //导入方法依赖的package包/类
@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;
}
示例3: markLTR
import org.eclipse.jface.viewers.StyledString; //导入方法依赖的package包/类
/**
* Adds special marks so that that the given styled string is readable in a BiDi environment.
*
* @param styledString the styled string
* @return the processed styled string
* @since 3.4
*/
public static StyledString markLTR(StyledString styledString) {
/*
* NOTE: For performance reasons we do not call markLTR(styledString, null)
*/
if (!USE_TEXT_PROCESSOR) return styledString;
String inputString = styledString.getString();
String string = TextProcessor.process(inputString);
if (string != inputString) insertMarks(styledString, inputString, string);
return styledString;
}
示例4: markJavaElementLabelLTR
import org.eclipse.jface.viewers.StyledString; //导入方法依赖的package包/类
/**
* Adds special marks so that that the given styled Java element label is readable in a BiDi
* environment.
*
* @param styledString the styled string
* @return the processed styled string
* @since 3.6
*/
public static StyledString markJavaElementLabelLTR(StyledString styledString) {
if (!USE_TEXT_PROCESSOR) return styledString;
String inputString = styledString.getString();
String string = TextProcessor.process(inputString, JAVA_ELEMENT_DELIMITERS);
if (string != inputString) insertMarks(styledString, inputString, string);
return styledString;
}