Java 类com.intellij.util.ui.JBImageIcon 实例源码

项目:intellij-ce-playground    文件:CustomActionsSchema.java   
private void initActionIcons() {
  ActionManager actionManager = ActionManager.getInstance();
  for (String actionId : myIconCustomizations.keySet()) {
    final AnAction anAction = actionManager.getAction(actionId);
    if (anAction != null) {
      Icon icon;
      final String iconPath = myIconCustomizations.get(actionId);
      if (iconPath != null && new File(FileUtil.toSystemDependentName(iconPath)).exists()) {
        Image image = null;
        try {
          image = ImageLoader.loadFromStream(VfsUtilCore.convertToURL(VfsUtil.pathToUrl(iconPath)).openStream());
        }
        catch (IOException e) {
          LOG.debug(e);
        }
        icon = image == null ? null : new JBImageIcon(image);
      }
      else {
        icon = AllIcons.Toolbar.Unknown;
      }
      anAction.getTemplatePresentation().setIcon(icon);
      anAction.getTemplatePresentation().setDisabledIcon(IconLoader.getDisabledIcon(icon));
      anAction.setDefaultIcon(false);
    }
  }
  final IdeFrameImpl frame = WindowManagerEx.getInstanceEx().getFrame(null);
  if (frame != null) {
    frame.updateView();
  }
}
项目:intellij-ce-playground    文件:IconLoader.java   
@Deprecated
public static Icon getIcon(@NotNull final Image image) {
  return new JBImageIcon(image);
}
项目:consulo    文件:IconLoader.java   
@Deprecated
public static Icon getIcon(@Nonnull final Image image) {
  return new JBImageIcon(image);
}