本文整理汇总了Java中com.intellij.util.ui.JBImageIcon类的典型用法代码示例。如果您正苦于以下问题:Java JBImageIcon类的具体用法?Java JBImageIcon怎么用?Java JBImageIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JBImageIcon类属于com.intellij.util.ui包,在下文中一共展示了JBImageIcon类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initActionIcons
import com.intellij.util.ui.JBImageIcon; //导入依赖的package包/类
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();
}
}
示例2: getIcon
import com.intellij.util.ui.JBImageIcon; //导入依赖的package包/类
@Deprecated
public static Icon getIcon(@NotNull final Image image) {
return new JBImageIcon(image);
}
示例3: getIcon
import com.intellij.util.ui.JBImageIcon; //导入依赖的package包/类
@Deprecated
public static Icon getIcon(@Nonnull final Image image) {
return new JBImageIcon(image);
}