本文整理汇总了Java中com.intellij.lang.annotation.Annotation.setGutterIconRenderer方法的典型用法代码示例。如果您正苦于以下问题:Java Annotation.setGutterIconRenderer方法的具体用法?Java Annotation.setGutterIconRenderer怎么用?Java Annotation.setGutterIconRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.lang.annotation.Annotation
的用法示例。
在下文中一共展示了Annotation.setGutterIconRenderer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotate
import com.intellij.lang.annotation.Annotation; //导入方法依赖的package包/类
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
if (psiElement instanceof PsiField) {
PsiField field = (PsiField) psiElement;
final PsiFile boundForm = FormReferenceProvider.getFormFile(field);
if (boundForm != null) {
annotateFormField(field, boundForm, holder);
}
}
else if (psiElement instanceof PsiClass) {
PsiClass aClass = (PsiClass) psiElement;
final List<PsiFile> formsBoundToClass = FormClassIndex.findFormsBoundToClass(aClass.getProject(), aClass);
if (formsBoundToClass.size() > 0) {
Annotation boundClassAnnotation = holder.createInfoAnnotation(aClass.getNameIdentifier(), null);
boundClassAnnotation.setGutterIconRenderer(new BoundIconRenderer(aClass));
}
}
}
示例2: attachColorIcon
import com.intellij.lang.annotation.Annotation; //导入方法依赖的package包/类
private static void attachColorIcon(final PsiElement element, AnnotationHolder holder, String attributeValueText) {
try {
Color color = null;
if (attributeValueText.startsWith("#")) {
color = ColorUtil.fromHex(attributeValueText.substring(1));
} else {
final String hexCode = ColorMap.getHexCodeForColorName(StringUtil.toLowerCase(attributeValueText));
if (hexCode != null) {
color = ColorUtil.fromHex(hexCode);
}
}
if (color != null) {
final ColorIcon icon = new ColorIcon(8, color);
final Annotation annotation = holder.createInfoAnnotation(element, null);
annotation.setGutterIconRenderer(new ColorIconRenderer(icon, element));
}
}
catch (Exception ignored) {
}
}
示例3: doInstall
import com.intellij.lang.annotation.Annotation; //导入方法依赖的package包/类
private Annotation doInstall(@NotNull Annotation annotation, @NotNull Project project) {
final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(project);
annotation.setGutterIconRenderer(renderer);
annotation.setNeedsUpdateOnTyping(false);
return annotation;
}
示例4: createGutterAnnotation
import com.intellij.lang.annotation.Annotation; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
private void createGutterAnnotation(CommonElement t, GutterIconRenderer renderer) {
final Annotation a = myHolder.createAnnotation((T)t, HighlightSeverity.INFORMATION, null);
a.setGutterIconRenderer(renderer);
}