本文整理汇总了Java中com.intellij.openapi.editor.colors.TextAttributesKey.find方法的典型用法代码示例。如果您正苦于以下问题:Java TextAttributesKey.find方法的具体用法?Java TextAttributesKey.find怎么用?Java TextAttributesKey.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.editor.colors.TextAttributesKey
的用法示例。
在下文中一共展示了TextAttributesKey.find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateOptionsList
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
@Override
public void updateOptionsList() {
myOptionsModel.clear();
myDescriptions.clear();
Map<TextAttributesKey, TextDiffType> typesByKey = ContainerUtil.newMapFromValues(TextDiffType.MERGE_TYPES.iterator(),
TextDiffType.ATTRIBUTES_KEY);
for (int i = 0; i < myOptions.getCurrentDescriptions().length; i++) {
EditorSchemeAttributeDescriptor description = myOptions.getCurrentDescriptions()[i];
TextAttributesKey type = TextAttributesKey.find(description.getType());
if (description.getGroup() == ColorAndFontOptions.DIFF_GROUP &&
typesByKey.keySet().contains(type)) {
myOptionsModel.add(typesByKey.get(type));
myDescriptions.put(type.getExternalName(), (MyColorAndFontDescription)description);
}
}
ScrollingUtil.ensureSelectionExists(myOptionsList);
}
示例2: processListOptions
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
@Override
public Set<String> processListOptions() {
Set<String> result = ContainerUtil.newHashSet();
Map<TextAttributesKey, TextDiffType> typesByKey = ContainerUtil.newMapFromValues(TextDiffType.MERGE_TYPES.iterator(),
TextDiffType.ATTRIBUTES_KEY);
for (int i = 0; i < myOptions.getCurrentDescriptions().length; i++) {
EditorSchemeAttributeDescriptor description = myOptions.getCurrentDescriptions()[i];
TextAttributesKey type = TextAttributesKey.find(description.getType());
if (description.getGroup() == ColorAndFontOptions.DIFF_GROUP &&
typesByKey.keySet().contains(type)) {
result.add(type.getExternalName());
}
}
return result;
}
示例3: testYieldInNestedFunction
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
public void testYieldInNestedFunction() {
// highlight func declaration first, lest we get an "Extra fragment highlighted" error.
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = TextAttributesKey.find("PY.FUNC_DEFINITION");
TextAttributes xAttributes = new TextAttributes(Color.red, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
scheme.setAttributes(xKey, xAttributes);
doTest();
}
示例4: create
import com.intellij.openapi.editor.colors.TextAttributesKey; //导入方法依赖的package包/类
@Nullable
@Override
protected TextAttributesKey create(String scope) {
return TextAttributesKey.find("SCOPE_KEY_" + scope);
}