zoukankan      html  css  js  c++  java
  • linemark

    public class SimpleLineMarkerProvider extends RelatedItemLineMarkerProvider {
      @Override
      protected void collectNavigationMarkers(@NotNull PsiElement element,
                                              Collection<? super RelatedItemLineMarkerInfo> result) {
        if (element instanceof PsiLiteralExpression) {
          PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
          String value = literalExpression.getValue() instanceof String ? (String) literalExpression.getValue() : null;
          if (value != null && value.startsWith("simple" + ":")) {
            Project project = element.getProject();
            final List<SimpleProperty> properties = SimpleUtil.findProperties(project, value.substring(7));
            if (properties.size() > 0) {
              NavigationGutterIconBuilder<PsiElement> builder =
                  NavigationGutterIconBuilder.create(SimpleIcons.FILE).
                      setTargets(properties).
                                                 setTooltipText("Navigate to a simple property");
              result.add(builder.createLineMarkerInfo(element));
            }
          }
        }
      }
    }
    

      

  • 相关阅读:
    康托(逆)展开(2015.8.6)
    高精度计算(2015.8.1)
    笔记(2015.8.1)
    筛法求素数(2015.7.30)
    欧几里德算法(2015.7.28)
    快速幂取模(2015.7.29)
    同余
    图论相关算法
    笔记(2015-07-24)
    ACM进阶计划
  • 原文地址:https://www.cnblogs.com/liqiking/p/6833286.html
Copyright © 2011-2022 走看看