本文整理汇总了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();
}
});
}
示例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;
}
示例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);
}
示例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;
}