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


Java EmptyIcon.ICON_16属性代码示例

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


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

示例1: ActionButton

public ActionButton(AnAction action) {
  myAction = action;

  Presentation presentation = action.getTemplatePresentation();
  InplaceButton button = new InplaceButton(KeymapUtil.createTooltipText(presentation.getText(), action), EmptyIcon.ICON_16, this) {
    @Override
    public boolean isActive() {
      return LightToolWindow.this.isActive();
    }
  };
  button.setHoveringEnabled(!SystemInfo.isMac);
  setContent(button);

  Icon icon = presentation.getIcon();
  Icon hoveredIcon = presentation.getHoveredIcon();
  button.setIcons(icon, icon, hoveredIcon == null ? icon : hoveredIcon);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LightToolWindow.java

示例2: getSmallApplicationIcon

protected static Icon getSmallApplicationIcon() {
  if (ourSmallAppIcon == null) {
    try {
      Icon appIcon = IconLoader.findIcon(ApplicationInfoEx.getInstanceEx().getIconUrl());

      if (appIcon != null) {
        if (appIcon.getIconWidth() == JBUI.scale(16) && appIcon.getIconHeight() == JBUI.scale(16)) {
          ourSmallAppIcon = appIcon;
        } else {
          BufferedImage image = ImageUtil.toBufferedImage(IconUtil.toImage(appIcon));
          image = Scalr.resize(image, Scalr.Method.ULTRA_QUALITY, UIUtil.isRetina() ? 32 : JBUI.scale(16));
          ourSmallAppIcon = toRetinaAwareIcon(image);
        }
      }
    }
    catch (Exception e) {//
    }
    if (ourSmallAppIcon == null) {
      ourSmallAppIcon = EmptyIcon.ICON_16;
    }
  }

  return ourSmallAppIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:RecentProjectsManagerBase.java

示例3: ActionButton

public ActionButton(AnAction action) {
  myAction = action;

  Presentation presentation = action.getTemplatePresentation();
  InplaceButton button = new InplaceButton(AnAction.createTooltipText(presentation.getText(), action), EmptyIcon.ICON_16, this) {
    @Override
    public boolean isActive() {
      return LightToolWindow.this.isActive();
    }
  };
  button.setHoveringEnabled(!SystemInfo.isMac);
  setContent(button);

  Icon icon = presentation.getIcon();
  Icon hoveredIcon = presentation.getHoveredIcon();
  button.setIcons(icon, icon, hoveredIcon == null ? icon : hoveredIcon);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:LightToolWindow.java

示例4: toIcon

@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,代码行数:26,代码来源:IconDescriptor.java

示例5: calcMaxIconSize

private void calcMaxIconSize(final ActionGroup actionGroup) {
  AnAction[] actions = actionGroup.getChildren(createActionEvent(actionGroup));
  for (AnAction action : actions) {
    if (action == null) continue;
    if (action instanceof ActionGroup) {
      final ActionGroup group = (ActionGroup)action;
      if (!group.isPopup()) {
        calcMaxIconSize(group);
        continue;
      }
    }

    Icon icon = action.getTemplatePresentation().getIcon();
    if (icon == null && action instanceof Toggleable) icon = EmptyIcon.ICON_16;
    if (icon != null) {
      final int width = icon.getIconWidth();
      final int height = icon.getIconHeight();
      if (myMaxIconWidth < width) {
        myMaxIconWidth = width;
      }
      if (myMaxIconHeight < height) {
        myMaxIconHeight = height;
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:PopupFactoryImpl.java

示例6: initComponent

@Override
protected void initComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  ErrorTreeElement element = getElement(value);

  if (element != null) {
    String[] text = element.getText();
    if (text == null) {
      text = EMPTY_STRING_ARRAY;
    }
    if (text.length > 0 && text[0] == null) {
      text[0] = "";
    }
    setText(text, "");
  }

  Icon icon = null;

  if (element instanceof GroupingElement) {
    GroupingElement groupingElement = (GroupingElement)element;
    icon = groupingElement.getFile() != null ? groupingElement.getFile().getFileType().getIcon() : AllIcons.FileTypes.Java;
  }
  else if (element instanceof SimpleMessageElement || element instanceof NavigatableMessageElement) {
    ErrorTreeElementKind kind = element.getKind();
    icon = getIconFor(kind);
  }
  if (icon == null) {
    icon = EmptyIcon.ICON_16;
  }
  setIcon(icon);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:MessageTreeRenderer.java

示例7: getIconFor

@NotNull
private static Icon getIconFor(@NotNull ErrorTreeElementKind kind) {
  switch (kind) {
    case ERROR:
      return AllIcons.General.BalloonError;
    case WARNING:
      return AllIcons.General.BalloonWarning;
    case INFO:
      return AllIcons.General.BalloonInformation;
    default:
      return EmptyIcon.ICON_16;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MessageTreeRenderer.java

示例8: createEmptyIconLike

@NotNull
private static Icon createEmptyIconLike(@NotNull String baseIconPath) {
  Icon baseIcon = IconLoader.findIcon(baseIconPath);
  if (baseIcon == null) {
    return EmptyIcon.ICON_16;
  }
  return new EmptyIcon(baseIcon.getIconWidth(), baseIcon.getIconHeight());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:IconUtil.java

示例9: getIcon

@NotNull
@Override
public Icon getIcon() {
  final Icon icon = myOldProvider.getIcon();
  return icon != null ? icon : EmptyIcon.ICON_16;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:OldFrameworkSupportProviderWrapper.java

示例10: ActionButton

public ActionButton(AnAction action, AnAction alternativeAction, @NotNull Icon activeIcon, Icon inactiveIcon,
                    Icon alternativeIcon) {
  myAction = action;
  myAlternativeAction = alternativeAction;

  myActiveIcon = activeIcon;
  myInactiveIcon = inactiveIcon;
  myAlternativeIcon = alternativeIcon;

  myCurrentAction = myAction;

  myButton = new InplaceButton(getToolTipTextByAction(action),
                               EmptyIcon.ICON_16, this) {
    @Override
    public boolean isActive() {
      return ActionButton.this.isActive();
    }
  };

  myButton.setHoveringEnabled(!SystemInfo.isMac);
  setContent(myButton);
  setOpaque(false);

  setIcon(getActiveIcon(), getInactiveIcon() == null ? getActiveIcon() : getInactiveIcon(), getActiveHoveredIcon());

  PropertyChangeListener listener = new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (myAlternativeAction == null) return;
      if ("ancestor".equals(evt.getPropertyName())) {
        if (evt.getNewValue() == null) {
          AltStateManager.getInstance().removeListener(ActionButton.this);
          switchAlternativeAction(false);
        }
        else {
          AltStateManager.getInstance().addListener(ActionButton.this);
        }
      }
    }
  };

  addPropertyChangeListener(listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:ToolWindowHeader.java

示例11: getIcon

@NotNull
public Icon getIcon() {
  Icon icon = myProvider.getIcon(myData);
  return icon != null ? icon : EmptyIcon.ICON_16;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PreviewInfo.java

示例12: getIcon

@NotNull
@Override
public Icon getIcon() {
  return EmptyIcon.ICON_16;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MockFrameworkType.java

示例13: getIcon

@NotNull
public Icon getIcon() {
  return EmptyIcon.ICON_16;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:Injectable.java

示例14: FacetBasedFrameworkType

public FacetBasedFrameworkType(FacetType<?, ?> facetType) {
  super(facetType.getStringId());
  myFacetType = facetType;
  final Icon icon = myFacetType.getIcon();
  myIcon = icon != null ? icon : EmptyIcon.ICON_16;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FacetBasedFrameworkDetector.java

示例15: getIcon

@Override
Icon getIcon(FileColorConfiguration configuration) {
  Color color = myManager.getColor(configuration.getColorName());
  return color == null ? EmptyIcon.ICON_16 : new ColorIcon(16, 13, color, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FileColorSettingsTable.java


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