本文整理汇总了Java中com.intellij.psi.ElementDescriptionUtil类的典型用法代码示例。如果您正苦于以下问题:Java ElementDescriptionUtil类的具体用法?Java ElementDescriptionUtil怎么用?Java ElementDescriptionUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementDescriptionUtil类属于com.intellij.psi包,在下文中一共展示了ElementDescriptionUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getElementDescription
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getElementDescription(String prefix, PsiElement element, String suffix)
{
PsiElement elementToSlice = element;
if(element instanceof PsiReferenceExpression)
{
elementToSlice = ((PsiReferenceExpression) element).resolve();
}
if(elementToSlice == null)
{
elementToSlice = element;
}
String desc = ElementDescriptionUtil.getElementDescription(elementToSlice, RefactoringDescriptionLocation.WITHOUT_PARENT);
return "<html><head>" + UIUtil.getCssFontDeclaration(getLabelFont()) + "</head><body>" + (prefix == null ? "" : prefix) + StringUtil.first(desc, 100, true) + (suffix == null ? "" : suffix) +
"</body></html>";
}
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:SliceManager.java
示例2: getType
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getType(@NotNull PsiElement element) {
return ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE);
}
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:6,代码来源:RmlFindUsagesProvider.java
示例3: getDescriptiveName
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getDescriptiveName(@NotNull PsiElement element) {
return ElementDescriptionUtil.getElementDescription(element, UsageViewLongNameLocation.INSTANCE);
}
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:6,代码来源:RmlFindUsagesProvider.java
示例4: getNodeText
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getNodeText(@NotNull PsiElement element, boolean useFullName) {
return ElementDescriptionUtil.getElementDescription(element, UsageViewNodeTextLocation.INSTANCE);
}
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:6,代码来源:RmlFindUsagesProvider.java
示例5: highlightPsiElement
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
private static void highlightPsiElement(@NotNull Project project,
@NotNull PsiElement psiElement, @NotNull Editor editor, @NotNull PsiFile file,
boolean shouldClear) {
final PsiElement target = SmartPointerManager.getInstance(psiElement.getProject())
.createSmartPsiElementPointer(psiElement)
.getElement();
if (target == null) {
return;
}
if (file instanceof PsiCompiledFile) {
file = ((PsiCompiledFile) file).getDecompiledPsiFile();
}
final Couple<List<TextRange>> usages = getUsages(target, file);
final List<TextRange> readRanges = usages.first;
final List<TextRange> writeRanges = usages.second;
final HighlightManager highlightManager = HighlightManager.getInstance(project);
if (shouldClear) {
clearHighlights(editor, highlightManager, readRanges);
clearHighlights(editor, highlightManager, writeRanges);
WindowManager.getInstance().getStatusBar(project).setInfo("");
return;
}
// TODO: 10/02/2017 pass target?
final TextAttributes ta = TextAttributesFactory.getInstance().get();
final Color scrollMarkColor;
if (ta.getErrorStripeColor() != null) {
scrollMarkColor = ta.getErrorStripeColor();
} else if (ta.getBackgroundColor() != null) {
scrollMarkColor = ta.getBackgroundColor().darker();
} else {
scrollMarkColor = null;
}
final String elementName = ElementDescriptionUtil.getElementDescription(target,
HighlightUsagesDescriptionLocation.INSTANCE);
// TODO: 06/02/2017 highlight write and read access
ArrayList<RangeHighlighter> highlighters = new ArrayList<>();
highlight(highlightManager, readRanges, editor, ta, highlighters, scrollMarkColor);
highlight(highlightManager, writeRanges, editor, ta, highlighters, scrollMarkColor);
final Document doc = editor.getDocument();
for (RangeHighlighter highlighter : highlighters) {
highlighter.setErrorStripeTooltip(
HighlightHandlerBase.getLineTextErrorStripeTooltip(doc,
highlighter.getStartOffset(), true));
}
int refCount = readRanges.size() + writeRanges.size();
String msg;
if (refCount > 0) {
msg = MessageFormat.format("{0} {0, choice, 1#usage|2#usages} of {1} found", refCount,
elementName);
} else {
msg = MessageFormat.format("No usages of {0} found", elementName);
}
WindowManager.getInstance().getStatusBar(project).setInfo(msg);
}
开发者ID:huoguangjin,项目名称:MultiHighlight,代码行数:66,代码来源:MultiHighlightHandler.java
示例6: createNodeText
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String createNodeText(PsiElement element) {
return ElementDescriptionUtil.getElementDescription(element, UsageViewNodeTextLocation.INSTANCE);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:UsageViewUtil.java
示例7: getShortName
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getShortName(final PsiElement psiElement) {
LOG.assertTrue(psiElement.isValid(), psiElement);
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewShortNameLocation.INSTANCE);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:UsageViewUtil.java
示例8: getLongName
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getLongName(final PsiElement psiElement) {
LOG.assertTrue(psiElement.isValid(), psiElement);
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewLongNameLocation.INSTANCE);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:UsageViewUtil.java
示例9: getType
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getType(@NotNull PsiElement psiElement) {
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewTypeLocation.INSTANCE);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:UsageViewUtil.java
示例10: getDescription
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getDescription(@NotNull PsiElement element, boolean includeParent) {
return ElementDescriptionUtil.getElementDescription(element, includeParent
? RefactoringDescriptionLocation.WITH_PARENT
: RefactoringDescriptionLocation.WITHOUT_PARENT);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:RefactoringUIUtil.java
示例11: getType
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getType(PsiElement psiElement) {
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewTypeLocation.INSTANCE);
}
开发者ID:dubrousky,项目名称:CMaker,代码行数:6,代码来源:CMakeFindUsagesProvider.java
示例12: getDescriptiveName
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getDescriptiveName(@NotNull PsiElement psiElement) {
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewLongNameLocation.INSTANCE);
}
开发者ID:dubrousky,项目名称:CMaker,代码行数:6,代码来源:CMakeFindUsagesProvider.java
示例13: getNodeText
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
@NotNull
@Override
public String getNodeText(@NotNull PsiElement psiElement, boolean b) {
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewNodeTextLocation.INSTANCE);
}
开发者ID:dubrousky,项目名称:CMaker,代码行数:6,代码来源:CMakeFindUsagesProvider.java
示例14: getType
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getType(@Nonnull PsiElement psiElement) {
return ElementDescriptionUtil.getElementDescription(psiElement, UsageViewTypeLocation.INSTANCE);
}
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:UsageViewUtil.java
示例15: getDescription
import com.intellij.psi.ElementDescriptionUtil; //导入依赖的package包/类
public static String getDescription(@Nonnull PsiElement element, boolean includeParent) {
return ElementDescriptionUtil.getElementDescription(element, includeParent
? RefactoringDescriptionLocation.WITH_PARENT
: RefactoringDescriptionLocation.WITHOUT_PARENT);
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:RefactoringUIUtil.java
注:本文中的com.intellij.psi.ElementDescriptionUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论