當前位置: 首頁>>代碼示例>>Java>>正文


Java Annotation.setGutterIconRenderer方法代碼示例

本文整理匯總了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));
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:FormClassAnnotator.java

示例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) {
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:JavaFxAnnotator.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:NavigationGutterIconBuilder.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:ModelAnnotator.java


注:本文中的com.intellij.lang.annotation.Annotation.setGutterIconRenderer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。