当前位置: 首页>>代码示例>>Java>>正文


Java LookupElementPresentation.setItemTextBold方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.lookup.LookupElementPresentation.setItemTextBold方法的典型用法代码示例。如果您正苦于以下问题:Java LookupElementPresentation.setItemTextBold方法的具体用法?Java LookupElementPresentation.setItemTextBold怎么用?Java LookupElementPresentation.setItemTextBold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.lookup.LookupElementPresentation的用法示例。


在下文中一共展示了LookupElementPresentation.setItemTextBold方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  super.renderElement(presentation);
  if (sudden) {
    presentation.setItemTextBold(true);
    if (!presentation.isReal() || !((RealLookupElementPresentation)presentation).isLookupSelectionTouched()) {
      char shortcutChar = myTemplate.getShortcutChar();
      if (shortcutChar == TemplateSettings.DEFAULT_CHAR) {
        shortcutChar = TemplateSettings.getInstance().getDefaultShortcutChar();
      }
      presentation.setTypeText("  [" + KeyEvent.getKeyText(shortcutChar) + "] ");
    }
    presentation.setTailText(" (" + myTemplate.getDescription() + ")", true);
  } else {
    presentation.setTypeText(myTemplate.getDescription());

  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:LiveTemplateLookupElement.java

示例2: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
    super.renderElement(presentation);

    presentation.setItemTextBold(withBoldness);
    presentation.setIcon(Symfony2Icons.DOCTRINE);
    presentation.setTypeGrayed(true);

    if(this.doctrineModelField.getTypeName() != null) {
        presentation.setTypeText(this.doctrineModelField.getTypeName());
    }

    if(this.doctrineModelField.getRelationType() != null) {
        presentation.setTailText(String.format("(%s)", this.doctrineModelField.getRelationType()), true);
    }

    if(this.doctrineModelField.getRelation() != null) {
        presentation.setTypeText(this.doctrineModelField.getRelation());
        presentation.setIcon(PhpIcons.CLASS_ICON);
    }

}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:23,代码来源:DoctrineModelFieldLookupElement.java

示例3: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  super.renderElement(presentation);
  char shortcut = getTemplateShortcut();
  presentation.setItemText(getItemText());
  if (sudden) {
    presentation.setItemTextBold(true);
    if (!presentation.isReal() || !((RealLookupElementPresentation)presentation).isLookupSelectionTouched()) {
      if (shortcut == TemplateSettings.DEFAULT_CHAR) {
        shortcut = TemplateSettings.getInstance().getDefaultShortcutChar();
      }
      presentation.setTypeText("  [" + KeyEvent.getKeyText(shortcut) + "] ");
    }
    if (StringUtil.isNotEmpty(myDescription)) {
      presentation.setTailText(" (" + myDescription + ")", true);
    }
  }
  else {
    presentation.setTypeText(myDescription);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:LiveTemplateLookupElement.java

示例4: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
    presentation.setIcon(myFile.getIcon(0));
    presentation.setItemText(myName);
    presentation.setItemTextBold(true);
    if (myTail != null) {
        presentation.setTailText(myTail, true);
    }
    presentation.setTypeText("View");
    presentation.setTypeGrayed(true);
}
 
开发者ID:nvlad,项目名称:yii2support,代码行数:12,代码来源:ViewLookupElement.java

示例5: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
public void renderElement(LookupElement element, LookupElementPresentation presentation) {
  Suggestion suggestion = (Suggestion) element.getObject();
  if (suggestion.icon != null) {
    presentation.setIcon(suggestion.icon);
  }

  presentation.setStrikeout(suggestion.deprecationLevel != null);
  if (suggestion.deprecationLevel != null) {
    if (suggestion.deprecationLevel == SpringConfigurationMetadataDeprecationLevel.error) {
      presentation.setItemTextForeground(RED);
    } else {
      presentation.setItemTextForeground(YELLOW);
    }
  }

  String lookupString = element.getLookupString();
  presentation.setItemText(lookupString);
  if (!lookupString.equals(suggestion.suggestion)) {
    presentation.setItemTextBold(true);
  }

  String shortDescription;
  if (suggestion.defaultValue != null) {
    shortDescription = shortenTextWithEllipsis(suggestion.defaultValue, 60, 0, true);
    TextAttributes attrs =
        EditorColorsManager.getInstance().getGlobalScheme().getAttributes(SCALAR_TEXT);
    presentation.setTailText("=" + shortDescription, attrs.getForegroundColor());
  }

  if (suggestion.description != null) {
    presentation.appendTailText(
        " (" + Util.getFirstSentenceWithoutDot(suggestion.description) + ")", true);
  }

  if (suggestion.shortType != null) {
    presentation.setTypeText(suggestion.shortType);
  }
}
 
开发者ID:1tontech,项目名称:intellij-spring-assistant,代码行数:39,代码来源:Suggestion.java

示例6: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  final PsiClass psiClass = getPsiClass();
  if (psiClass != null) {
    presentation.setIcon(presentation.isReal() ? psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY) : EMPTY_ICON);
    presentation.setTailText(" (" + PsiFormatUtil.getPackageDisplayName(psiClass) + ")", true);
  }
  final PsiType type = getPsiType();
  presentation.setItemText(type.getPresentableText());
  presentation.setItemTextBold(type instanceof PsiPrimitiveType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PsiTypeCanonicalLookupElement.java

示例7: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  super.renderElement(presentation);
  char shortcut = getTemplateShortcut();
  presentation.setItemText(getItemText());
  if (sudden) {
    presentation.setItemTextBold(true);
    if (!presentation.isReal() || !((RealLookupElementPresentation)presentation).isLookupSelectionTouched()) {
      if (shortcut == TemplateSettings.DEFAULT_CHAR) {
        shortcut = TemplateSettings.getInstance().getDefaultShortcutChar();
      }
      if (shortcut != TemplateSettings.CUSTOM_CHAR) {
        presentation.setTypeText("  [" + KeyEvent.getKeyText(shortcut) + "] ");
      } else {
        String shortcutText =
          KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_EXPAND_LIVE_TEMPLATE_CUSTOM));
        if (StringUtil.isNotEmpty(shortcutText)) {
          presentation.setTypeText("  [" + shortcutText + "] ");
        }
      }
    }
    if (StringUtil.isNotEmpty(myDescription)) {
      presentation.setTailText(" (" + myDescription + ")", true);
    }
  }
  else {
    presentation.setTypeText(myDescription);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:LiveTemplateLookupElement.java

示例8: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  presentation.setItemText(getLookupString());
  presentation.setItemTextBold(isBold);
  presentation.setTailText(getTailText());
  presentation.setTypeText(getTypeText(), getTypeIcon());
  presentation.setIcon(getIcon());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PythonLookupElement.java

示例9: renderClassItem

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
public static void renderClassItem(LookupElementPresentation presentation, LookupItem item, PsiClass psiClass, boolean diamond) {
  if (!(psiClass instanceof PsiTypeParameter)) {
    presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
  }

  final boolean bold = item.getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null;
  boolean strikeout = JavaElementLookupRenderer.isToStrikeout(item);
  presentation.setItemText(getName(psiClass, item, diamond));
  presentation.setStrikeout(strikeout);
  presentation.setItemTextBold(bold);

  String tailText = getLocationString(item);
  PsiSubstitutor substitutor = (PsiSubstitutor)item.getAttribute(LookupItem.SUBSTITUTOR);

  if (item instanceof PsiTypeLookupItem) {
    if (((PsiTypeLookupItem)item).isIndicateAnonymous() &&
        (psiClass.isInterface() || psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) ||
        ((PsiTypeLookupItem)item).isAddArrayInitializer()) {
      tailText = "{...}" + tailText;
    }
  }
  if (substitutor == null && !diamond && psiClass.getTypeParameters().length > 0) {
    tailText = "<" + StringUtil.join(psiClass.getTypeParameters(), new Function<PsiTypeParameter, String>() {
      @Override
      public String fun(PsiTypeParameter psiTypeParameter) {
        return psiTypeParameter.getName();
      }
    }, "," + (showSpaceAfterComma(psiClass) ? " " : "")) + ">" + tailText;
  }
  presentation.setTailText(tailText, true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:JavaPsiClassReferenceElement.java

示例10: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation) {
  presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));

  presentation.setItemText(getName(element, item));
  presentation.setStrikeout(isToStrikeout(item));
  presentation.setItemTextBold(item.getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null);

  presentation.setTailText((String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);

  presentation.setTypeText(getTypeText(element, item));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:JavaElementLookupRenderer.java

示例11: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  final ItemPresentation myComponentNamePresentation = myComponentName.getPresentation();
  if (myComponentNamePresentation == null) {
    presentation.setItemText(getLookupString());
    return;
  }

  String presentableText = myComponentNamePresentation.getPresentableText();

  // Check for members: methods and fields
  HaxeMemberModel member = HaxeMemberModel.fromPsi(myComponentName);

  if (member != null) {
    presentableText = member.getPresentableText(context);

    // Check deprecated modifiers
    if (member.getModifiers().hasModifier(HaxeModifierType.DEPRECATED)) {
      presentation.setStrikeout(true);
    }

    // Check for non-inherited members to highlight them as intellij-java does
    // @TODO: Self members should be displayed first!
    if (leftReference != null) {
      if (member.getDeclaringClass().getPsi() == leftReference.getHaxeClass()) {
        presentation.setItemTextBold(true);
      }
    }
  }

  presentation.setItemText(presentableText);
  presentation.setIcon(myComponentNamePresentation.getIcon(true));
  final String pkg = myComponentNamePresentation.getLocationString();
  if (StringUtil.isNotEmpty(pkg)) {
    presentation.setTailText(" " + pkg, true);
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:38,代码来源:HaxeLookupElement.java

示例12: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
public void renderElement(LookupElementPresentation presentation) {
    presentation.setItemText(getLookupString());
    presentation.setTypeGrayed(true);

    String className = getClassName(containerService);
    if(className != null) {
        presentation.setTypeText(StringUtils.strip(className, "\\"));
    }

    // private or non container services
    if(className == null || containerService.isWeak()) {
        presentation.setIcon(Symfony2Icons.SERVICE_OPACITY);
    } else {
        presentation.setIcon(Symfony2Icons.SERVICE);
    }

    if(this.containerService.isPrivate()) {
        presentation.setIcon(Symfony2Icons.SERVICE_PRIVATE_OPACITY);
    }

    presentation.setItemTextBold(this.boldText);
    if(this.boldText) {
        presentation.setTypeGrayed(false);
        presentation.setItemTextUnderlined(true);
    }

    if(containerService.getService() != null) {
        presentation.setStrikeout(containerService.getService().isDeprecated());
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:31,代码来源:ServiceStringLookupElement.java

示例13: renderElement

import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
  final PsiClass psiClass = getPsiClass();
  if (psiClass != null) {
    presentation.setIcon(presentation.isReal() ? IconDescriptorUpdaters.getIcon(psiClass, Iconable.ICON_FLAG_VISIBILITY) : EMPTY_ICON);
    presentation.setTailText(" (" + PsiFormatUtil.getPackageDisplayName(psiClass) + ")", true);
  }
  final PsiType type = getPsiType();
  presentation.setItemText(type.getPresentableText());
  presentation.setItemTextBold(type instanceof PsiPrimitiveType);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:PsiTypeCanonicalLookupElement.java


注:本文中的com.intellij.codeInsight.lookup.LookupElementPresentation.setItemTextBold方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。