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


Java IconUtil.toSize方法代码示例

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


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

示例1: addActions

import com.intellij.util.IconUtil; //导入方法依赖的package包/类
private static void addActions(@Nonnull AnAction action,
                               @Nonnull List<HighlightInfo.IntentionActionDescriptor> descriptors,
                               @Nonnull GutterIconRenderer renderer,
                               int order,
                               @Nonnull AnActionEvent event) {
  if (action instanceof ActionGroup) {
    AnAction[] children = ((ActionGroup)action).getChildren(null);
    for (int i = 0; i < children.length; i++) {
      addActions(children[i], descriptors, renderer, i + order, event);
    }
  }
  Icon icon = action.getTemplatePresentation().getIcon();
  if (icon == null) icon = renderer.getIcon();
  if (icon.getIconWidth() < 16) icon = IconUtil.toSize(icon, 16, 16);
  final GutterIntentionAction gutterAction = new GutterIntentionAction(action, order, icon);
  if (!gutterAction.isAvailable(event)) return;
  descriptors.add(new HighlightInfo.IntentionActionDescriptor(gutterAction, Collections.emptyList(), null, icon) {
    @Nullable
    @Override
    public String getDisplayName() {
      return gutterAction.getText();
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:GutterIntentionAction.java

示例2: getIcon

import com.intellij.util.IconUtil; //导入方法依赖的package包/类
private static Icon getIcon(ToolWindow toolWindow) {
  Icon icon = toolWindow.getIcon();
  if (icon == null) {
    return PlatformIcons.UI_FORM_ICON;
  }

  icon = IconUtil.toSize(icon, 16, 16);
  return icon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SwitcherToolWindowsListRenderer.java

示例3: addActions

import com.intellij.util.IconUtil; //导入方法依赖的package包/类
private static void addActions(@NotNull Project project,
                               @NotNull Editor editor,
                               @NotNull PsiFile psiFile,
                               @Nullable AnAction action,
                               @NotNull List<HighlightInfo.IntentionActionDescriptor> descriptors,
                               @NotNull GutterIconRenderer renderer,
                               int order) {
  if (action == null) {
    return;
  }
  if (action instanceof ActionGroup) {
    AnAction[] children = ((ActionGroup)action).getChildren(null);
    for (int i = 0; i < children.length; i++) {
      AnAction child = children[i];
      addActions(project, editor, psiFile, child, descriptors, renderer, i + order);
    }
  }
  Icon icon = action.getTemplatePresentation().getIcon();
  if (icon == null) icon = renderer.getIcon();
  if (icon.getIconWidth() < 16) icon = IconUtil.toSize(icon, 16, 16);
  final IntentionAction gutterAction = new GutterIntentionAction(action, order, icon);
  if (!gutterAction.isAvailable(project, editor, psiFile)) return;
  HighlightInfo.IntentionActionDescriptor descriptor =
    new HighlightInfo.IntentionActionDescriptor(gutterAction, Collections.<IntentionAction>emptyList(), null, icon) {
      @Nullable
      @Override
      public String getDisplayName() {
        return gutterAction.getText();
      }
    };
  descriptors.add(descriptor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:GutterIntentionAction.java

示例4: getIcon

import com.intellij.util.IconUtil; //导入方法依赖的package包/类
private static Icon getIcon(ToolWindow toolWindow) {
  Icon icon = toolWindow.getIcon();
  if (icon == null) {
    return AllIcons.FileTypes.UiForm;
  }

  icon = IconUtil.toSize(icon, 16, 16);
  return icon;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:SwitcherToolWindowsListRenderer.java


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