本文整理汇总了Java中com.intellij.codeInsight.lookup.LookupElementPresentation.setItemText方法的典型用法代码示例。如果您正苦于以下问题:Java LookupElementPresentation.setItemText方法的具体用法?Java LookupElementPresentation.setItemText怎么用?Java LookupElementPresentation.setItemText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.lookup.LookupElementPresentation
的用法示例。
在下文中一共展示了LookupElementPresentation.setItemText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
super.renderElement(presentation);
if (myMessage.getKey() instanceof StringLiteralExpression) {
presentation.setItemText(((StringLiteralExpression) myMessage.getKey()).getContents());
presentation.setIcon(myMessage.getKey().getIcon(0));
}
PhpExpression value = (PhpExpression) myMessage.getValue();
if (value != null) {
String text = Util.PhpExpressionValue(value);
if (!text.isEmpty()) {
presentation.setTailText(" = " + text, true);
}
presentation.setTypeText(value.getType().toString());
presentation.setTypeGrayed(true);
}
}
示例2: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
public void renderElement(LookupElementPresentation presentation) {
if(this.useClassNameAsLookupString) {
presentation.setItemText(className.getPresentableFQN());
presentation.setTypeText(getLookupString());
} else {
presentation.setItemText(getLookupString());
presentation.setTypeText(className.getPresentableFQN());
}
presentation.setTypeGrayed(true);
if(isWeak) {
// @TODO: remove weak
presentation.setIcon(getWeakIcon());
} else {
presentation.setIcon(getIcon());
}
}
示例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);
}
}
示例4: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation)
{
super.renderElement(presentation);
final LookupElementPresentation qualifierPresentation = new LookupElementPresentation();
myQualifier.renderElement(qualifierPresentation);
String name = maybeAddParentheses(qualifierPresentation.getItemText());
final String qualifierText = myQualifier.as(CastingLookupElementDecorator.CLASS_CONDITION_KEY) != null ? "(" + name + ")" : name;
presentation.setItemText(qualifierText + "." + presentation.getItemText());
if(myQualifier instanceof JavaPsiClassReferenceElement)
{
String locationString = ((JavaPsiClassReferenceElement) myQualifier).getLocationString();
presentation.setTailText(StringUtil.notNullize(presentation.getTailText()) + locationString);
}
}
示例5: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
super.renderElement(presentation);
presentation.setItemText(name);
presentation.setTailText("/", true);
presentation.setIcon(icon);
}
示例6: 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);
}
示例7: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
super.renderElement(presentation);
if (myCategory instanceof PsiFile) {
PsiFile file = (PsiFile) myCategory;
String filename = file.getName();
presentation.setIcon(file.getIcon(0));
presentation.setItemText(filename.substring(0, filename.lastIndexOf(".")));
}
}
示例8: 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);
}
}
示例9: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setItemText(getLookupString());
presentation.setIcon(TYPO3CMSIcons.ROUTE_ICON);
presentation.setTypeText(route.getController());
presentation.setTypeGrayed(true);
}
示例10: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setItemText(translation.getIndex() + " ");
presentation.setTailText(getLookupString(), true);
presentation.setIcon(TYPO3CMSIcons.TYPO3_ICON);
presentation.setTypeText("EXT:" + translation.getExtension());
presentation.setTypeGrayed(true);
}
示例11: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setItemText(icon.getName());
presentation.setIcon(iconFromIconInterface(icon));
presentation.setTypeText(icon.getExtensionKey());
presentation.setTypeGrayed(true);
}
示例12: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(final LookupElementPresentation presentation) {
final Parameter[] methodParameters = method.getParameters();
final Parameter[] methodParametersWithoutBuilder = (methodParameters.length >= 1)
? Arrays.copyOfRange(methodParameters, 1, methodParameters.length)
: methodParameters;
presentation.setItemText(lookupString);
presentation.setIcon(PhpIcons.METHOD);
presentation.setTypeText(LaravelClasses.ELOQUENT_BUILDER.toString().substring(1));
presentation.setTypeGrayed(false);
presentation.appendTailText(PhpPresentationUtil.formatParameters(null, methodParametersWithoutBuilder).toString(), true);
}
示例13: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation)
{
presentation.setTypeText(setting.getType());
presentation.setItemText(getLookupString());
String defaultValue = setting.getDefaultValue();
if (defaultValue.length() != 0)
{
presentation.appendTailTextItalic(" (" + defaultValue + ") ", true);
}
super.renderElement(presentation);
}
示例14: renderElement
import com.intellij.codeInsight.lookup.LookupElementPresentation; //导入方法依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setIcon(myMethod.getIcon(Iconable.ICON_FLAG_VISIBILITY));
presentation.setItemText(myMethod.getName());
presentation.setTailText(PsiFormatUtil.formatMethod(myMethod,
PsiSubstitutor.EMPTY,
PsiFormatUtil.SHOW_PARAMETERS,
PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_TYPE));
final PsiType returnType = myMethod.getReturnType();
if (returnType != null) {
presentation.setTypeText(returnType.getCanonicalText());
}
}
示例15: 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);
}