本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
}
}
}
示例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);
}
示例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;
}
}
示例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());
}
示例9: getIcon
@NotNull
@Override
public Icon getIcon() {
final Icon icon = myOldProvider.getIcon();
return icon != null ? icon : EmptyIcon.ICON_16;
}
示例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);
}
示例11: getIcon
@NotNull
public Icon getIcon() {
Icon icon = myProvider.getIcon(myData);
return icon != null ? icon : EmptyIcon.ICON_16;
}
示例12: getIcon
@NotNull
@Override
public Icon getIcon() {
return EmptyIcon.ICON_16;
}
示例13: getIcon
@NotNull
public Icon getIcon() {
return EmptyIcon.ICON_16;
}
示例14: FacetBasedFrameworkType
public FacetBasedFrameworkType(FacetType<?, ?> facetType) {
super(facetType.getStringId());
myFacetType = facetType;
final Icon icon = myFacetType.getIcon();
myIcon = icon != null ? icon : EmptyIcon.ICON_16;
}
示例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);
}