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


Java RowIcon类代码示例

本文整理汇总了Java中com.intellij.ui.RowIcon的典型用法代码示例。如果您正苦于以下问题:Java RowIcon类的具体用法?Java RowIcon怎么用?Java RowIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RowIcon类属于com.intellij.ui包,在下文中一共展示了RowIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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