本文整理匯總了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);
}