本文整理汇总了Java中com.intellij.ui.RowIcon类的典型用法代码示例。如果您正苦于以下问题:Java RowIcon类的具体用法?Java RowIcon怎么用?Java RowIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowIcon类属于com.intellij.ui包,在下文中一共展示了RowIcon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createOverridingLookupElement
import com.intellij.ui.RowIcon; //导入依赖的package包/类
private static LookupElementBuilder createOverridingLookupElement(boolean implemented,
final PsiMethod baseMethod,
PsiClass baseClass, PsiSubstitutor substitutor) {
RowIcon icon = new RowIcon(baseMethod.getIcon(0), implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod);
return createGenerateMethodElement(baseMethod, substitutor, icon, baseClass.getName(), new InsertHandler<LookupElement>() {
@Override
public void handleInsert(InsertionContext context, LookupElement item) {
removeLookupString(context);
final PsiClass parent = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiClass.class, false);
if (parent == null) return;
List<PsiMethod> prototypes = OverrideImplementUtil.overrideOrImplementMethod(parent, baseMethod, false);
insertGenerationInfos(context, OverrideImplementUtil.convert2GenerationInfos(prototypes));
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavaGenerateMemberCompletionContributor.java
示例2: patchIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
protected Icon patchIcon(Icon original, VirtualFile file) {
Icon icon = original;
final Bookmark bookmarkAtFile = BookmarkManager.getInstance(myProject).findFileBookmark(file);
if (bookmarkAtFile != null) {
final RowIcon composite = new RowIcon(2, RowIcon.Alignment.CENTER);
composite.setIcon(icon, 0);
composite.setIcon(bookmarkAtFile.getIcon(), 1);
icon = composite;
}
if (!file.isWritable()) {
icon = LayeredIcon.create(icon, PlatformIcons.LOCKED_ICON);
}
if (file.is(VFileProperty.SYMLINK)) {
icon = LayeredIcon.create(icon, PlatformIcons.SYMLINK_ICON);
}
return icon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PsiDirectoryNode.java
示例3: createOverridingLookupElement
import com.intellij.ui.RowIcon; //导入依赖的package包/类
private static LookupElementBuilder createOverridingLookupElement(final PsiClass parent,
boolean implemented,
final PsiMethod baseMethod,
PsiClass baseClass, PsiSubstitutor substitutor) {
RowIcon icon = new RowIcon(2);
icon.setIcon(baseMethod.getIcon(0), 0);
icon.setIcon(implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod, 1);
return createGenerateMethodElement(baseMethod, substitutor, icon, baseClass.getName(), new InsertHandler<LookupElement>() {
@Override
public void handleInsert(InsertionContext context, LookupElement item) {
removeLookupString(context);
List<PsiMethod> prototypes = OverrideImplementUtil.overrideOrImplementMethod(parent, baseMethod, false);
insertGenerationInfos(context, OverrideImplementUtil.convert2GenerationInfos(prototypes));
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:JavaGenerateMemberCompletionContributor.java
示例4: toIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Nonnull
public Icon toIcon() {
Icon mainIcon = null;
if(myLayerIcons == null) {
mainIcon = myMainIcon;
}
else {
LayeredIcon layeredIcon = new LayeredIcon(myLayerIcons.size() + 1);
layeredIcon.setIcon(myMainIcon, 0);
for (int i = 0; i < myLayerIcons.size(); i++) {
Icon icon = myLayerIcons.get(i);
layeredIcon.setIcon(icon, i + 1);
}
mainIcon = layeredIcon;
}
if(myRightIcon == null) {
return mainIcon == null ? EmptyIcon.ICON_16 : mainIcon;
}
else {
RowIcon baseIcon = new RowIcon(2);
baseIcon.setIcon(mainIcon, 0);
baseIcon.setIcon(myRightIcon, 1);
return baseIcon;
}
}
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:IconDescriptor.java
示例5: patchIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
protected Icon patchIcon(Icon original, VirtualFile file) {
Icon icon = original;
final Bookmark bookmarkAtFile = BookmarkManager.getInstance(myProject).findFileBookmark(file);
if (bookmarkAtFile != null) {
final RowIcon composite = new RowIcon(2, RowIcon.Alignment.CENTER);
composite.setIcon(icon, 0);
composite.setIcon(bookmarkAtFile.getIcon(), 1);
icon = composite;
}
if (!file.isWritable()) {
icon = LayeredIcon.create(icon, AllIcons.Nodes.Locked);
}
if (file.is(VFileProperty.SYMLINK)) {
icon = LayeredIcon.create(icon, AllIcons.Nodes.Symlink);
}
return icon;
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:PsiDirectoryNode.java
示例6: createOverridingLookupElement
import com.intellij.ui.RowIcon; //导入依赖的package包/类
private static LookupElementBuilder createOverridingLookupElement(boolean implemented, final PsiMethod baseMethod, PsiClass baseClass, PsiSubstitutor substitutor)
{
RowIcon icon = new RowIcon(IconDescriptorUpdaters.getIcon(baseMethod, 0), implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod);
return createGenerateMethodElement(baseMethod, substitutor, icon, baseClass.getName(), new InsertHandler<LookupElement>()
{
@Override
public void handleInsert(InsertionContext context, LookupElement item)
{
removeLookupString(context);
final PsiClass parent = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiClass.class, false);
if(parent == null)
{
return;
}
List<PsiMethod> prototypes = OverrideImplementUtil.overrideOrImplementMethod(parent, baseMethod, false);
insertGenerationInfos(context, OverrideImplementUtil.convert2GenerationInfos(prototypes));
}
});
}
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:JavaGenerateMemberCompletionContributor.java
示例7: getClassIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
public static Icon getClassIcon(int flags, @NotNull PsiClass aClass, @Nullable Icon symbolIcon) {
Icon base = Iconable.LastComputedIcon.get(aClass, flags);
if (base == null) {
if (symbolIcon == null) {
symbolIcon = ElementPresentationUtil.getClassIconOfKind(aClass, ElementPresentationUtil.getBasicClassKind(aClass));
}
RowIcon baseIcon = ElementBase.createLayeredIcon(aClass, symbolIcon, 0);
base = ElementPresentationUtil.addVisibilityIcon(aClass, flags, baseIcon);
}
return IconDeferrer.getInstance().defer(base, new ClassIconRequest(aClass, flags, symbolIcon), FULL_ICON_EVALUATOR);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PsiClassImplUtil.java
示例8: getElementIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
public Icon getElementIcon(final int flags) {
Icon methodIcon = myBaseIcon != null ? myBaseIcon :
hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:LightMethodBuilder.java
示例9: getElementIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
@NotNull
public Icon getElementIcon(final int flags) {
final RowIcon rowIcon = ElementBase.createLayeredIcon(this, PlatformIcons.FIELD_ICON, 0);
rowIcon.setIcon(PlatformIcons.PUBLIC_ICON, 1);
return rowIcon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PsiClassObjectAccessExpressionImpl.java
示例10: setVisibilityIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
protected void setVisibilityIcon(MemberInfo memberInfo, RowIcon icon) {
PsiMember member = memberInfo.getMember();
PsiModifierList modifiers = member != null ? member.getModifierList() : null;
if (modifiers != null) {
VisibilityIcons.setVisibilityIcon(modifiers, icon);
}
else {
icon.setIcon(IconUtil.getEmptyIcon(true), VISIBILITY_ICON_POSITION);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MemberSelectionTable.java
示例11: computeIconNow
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Nullable
private static Icon computeIconNow(@NotNull PsiElement element, @Iconable.IconFlags int flags) {
final Icon providersIcon = PsiIconUtil.getProvidersIcon(element, flags);
if (providersIcon != null) {
return providersIcon instanceof RowIcon ? (RowIcon)providersIcon : createLayeredIcon(element, providersIcon, flags);
}
return ((ElementBase)element).getElementIcon(flags);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ElementBase.java
示例12: getElementIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Nullable
protected Icon getElementIcon(@Iconable.IconFlags int flags) {
final PsiElement element = (PsiElement)this;
if (!element.isValid()) return null;
RowIcon baseIcon;
final boolean isLocked = (flags & ICON_FLAG_READ_STATUS) != 0 && !element.isWritable();
int elementFlags = isLocked ? FLAGS_LOCKED : 0;
if (element instanceof ItemPresentation && ((ItemPresentation)element).getIcon(false) != null) {
baseIcon = createLayeredIcon(this, ((ItemPresentation)element).getIcon(false), elementFlags);
}
else if (element instanceof PsiFile) {
PsiFile file = (PsiFile)element;
VirtualFile virtualFile = file.getVirtualFile();
final Icon fileTypeIcon;
if (virtualFile == null) {
fileTypeIcon = file.getFileType().getIcon();
}
else {
fileTypeIcon = IconUtil.getIcon(virtualFile, flags & ~ICON_FLAG_READ_STATUS, file.getProject());
}
return createLayeredIcon(this, fileTypeIcon, elementFlags);
}
else {
return null;
}
return baseIcon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ElementBase.java
示例13: createLayeredIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
public static RowIcon createLayeredIcon(Iconable instance, Icon icon, int flags) {
List<Icon> layersFromProviders = new SmartList<Icon>();
for (IconLayerProvider provider : Extensions.getExtensions(IconLayerProvider.EP_NAME)) {
final Icon layerIcon = provider.getLayerIcon(instance, (flags & FLAGS_LOCKED) != 0);
if (layerIcon != null) {
layersFromProviders.add(layerIcon);
}
}
if (flags != 0 || !layersFromProviders.isEmpty()) {
List<Icon> iconLayers = new SmartList<Icon>();
for(IconLayer l: ourIconLayers) {
if ((flags & l.flagMask) != 0) {
iconLayers.add(l.icon);
}
}
iconLayers.addAll(layersFromProviders);
LayeredIcon layeredIcon = new LayeredIcon(1 + iconLayers.size());
layeredIcon.setIcon(icon, 0);
for (int i = 0; i < iconLayers.size(); i++) {
Icon icon1 = iconLayers.get(i);
layeredIcon.setIcon(icon1, i+1);
}
icon = layeredIcon;
}
RowIcon baseIcon = new RowIcon(2);
baseIcon.setIcon(icon, 0);
return baseIcon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ElementBase.java
示例14: getEmptyIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@NotNull
public static Icon getEmptyIcon(boolean showVisibility) {
RowIcon baseIcon = new RowIcon(2);
baseIcon.setIcon(createEmptyIconLike(PlatformIcons.CLASS_ICON_PATH), 0);
if (showVisibility) {
baseIcon.setIcon(createEmptyIconLike(PlatformIcons.PUBLIC_ICON_PATH), 1);
}
return baseIcon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:IconUtil.java
示例15: getIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
@Nullable
public Icon getIcon(int flags) {
final Icon icon = myFile.getIcon(flags);
RowIcon baseIcon = ElementBase.createLayeredIcon(this, icon, 0);
return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GroovyScriptClass.java
示例16: getElementIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Nullable
@Override
protected Icon getElementIcon(@IconFlags int flags) {
Icon icon = getIconInner();
final boolean isLocked = (flags & ICON_FLAG_READ_STATUS) != 0 && !isWritable();
RowIcon rowIcon = createLayeredIcon(this, icon, ElementPresentationUtil.getFlags(this, isLocked) | getFlagsInner());
if ((flags & ICON_FLAG_VISIBILITY) != 0) {
VisibilityIcons.setVisibilityIcon(getModifierList(), rowIcon);
}
return rowIcon;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GrTypeDefinitionImpl.java
示例17: addSuperMethods
import com.intellij.ui.RowIcon; //导入依赖的package包/类
private static void addSuperMethods(final GrTypeDefinition psiClass, CompletionResultSet completionResultSet, boolean toImplement) {
final Collection<CandidateInfo> candidates = GroovyOverrideImplementExploreUtil.getMethodsToOverrideImplement(psiClass, toImplement);
for (CandidateInfo candidateInfo : candidates) {
final PsiMethod method = (PsiMethod)candidateInfo.getElement();
if (method.isConstructor()) continue;
RowIcon icon = new RowIcon(2);
icon.setIcon(method.getIcon(0), 0);
icon.setIcon(toImplement ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod, 1);
PsiSubstitutor substitutor = candidateInfo.getSubstitutor();
String parameters = PsiFormatUtil.formatMethod(method, substitutor, PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase.SHOW_NAME);
String visibility = VisibilityUtil.getVisibilityModifier(method.getModifierList());
String modifiers = (visibility == PsiModifier.PACKAGE_LOCAL ? "" : visibility + " ");
PsiType type = substitutor.substitute(method.getReturnType());
String parentClassName = psiClass == null ? "" : psiClass.getName();
String signature = modifiers + (type == null ? "" : type.getPresentableText() + " ") + method.getName();
LookupElementBuilder lookupElement = LookupElementBuilder.create(method, signature)
.appendTailText(parameters, false)
.appendTailText("{...}", true)
.withTypeText(parentClassName)
.withIcon(icon)
.withInsertHandler(new GroovyMethodOverrideHandler(psiClass));
completionResultSet.addElement(lookupElement);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GrMethodOverrideCompletionProvider.java
示例18: setVisibilityIcon
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
protected void setVisibilityIcon(GrMemberInfo memberInfo, RowIcon icon) {
PsiMember member = memberInfo.getMember();
PsiModifierList modifiers = member != null ? member.getModifierList() : null;
if (modifiers != null) {
VisibilityIcons.setVisibilityIcon(modifiers, icon);
}
else {
icon.setIcon(IconUtil.getEmptyIcon(true), VISIBILITY_ICON_POSITION);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GrMemberSelectionTable.java
示例19: customizeCellRenderer
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Override
public void customizeCellRenderer(JTable table, final Object value,
boolean isSelected, boolean hasFocus, final int row, final int column) {
final int modelColumn = myTable.convertColumnIndexToModel(column);
final M memberInfo = myTable.myTypesInfos.get(row);
setToolTipText(myTable.myTypeInfoModel.getTooltipText(memberInfo));
switch (modelColumn) {
case DISPLAY_NAME_COLUMN: {
Icon memberIcon = myTable.getMemberIcon(memberInfo, 0);
RowIcon icon = new RowIcon(3);
icon.setIcon(memberIcon, MEMBER_ICON_POSITION);
setIcon(icon);
break;
}
default: {
setIcon(null);
}
}
setIconOpaque(false);
setOpaque(false);
final boolean cellEditable = myTable.myTypeInfoModel.isTypeEnabled(memberInfo);
setEnabled(cellEditable);
if (value == null) return;
final int problem = myTable.myTypeInfoModel.checkForProblems(memberInfo);
Color c = null;
if (problem == MemberInfoModel.ERROR) {
c = JBColor.RED;
} else if (problem == MemberInfoModel.WARNING && !isSelected) {
c = JBColor.BLUE;
}
append((String) value, new SimpleTextAttributes(Font.PLAIN, c));
}
开发者ID:phajduk,项目名称:dagger2-intellij-plugin,代码行数:35,代码来源:AbstractTypeSelectionTable.java
示例20: computeIconNow
import com.intellij.ui.RowIcon; //导入依赖的package包/类
@Nullable
private static Icon computeIconNow(PsiElement element, @Iconable.IconFlags int flags) {
final Icon providersIcon = PsiIconUtil.getProvidersIcon(element, flags);
if (providersIcon != null) {
return providersIcon instanceof RowIcon ? (RowIcon)providersIcon : createLayeredIcon(element, providersIcon, flags);
}
return ((ElementBase)element).getElementIcon(flags);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:ElementBase.java
注:本文中的com.intellij.ui.RowIcon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论