Java 类com.intellij.ui.SizedIcon 实例源码

项目:tools-idea    文件:ActivateToolWindowAction.java   
public void update(AnActionEvent event){
  Presentation presentation = event.getPresentation();
  Project project = event.getData(PlatformDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    presentation.setVisible(false);
    return;
  }
  ToolWindow toolWindow=ToolWindowManager.getInstance(project).getToolWindow(myToolWindowId);
  presentation.setEnabled(toolWindow!=null&&toolWindow.isAvailable());
  presentation.setVisible(toolWindow!=null);
  if (toolWindow != null) {
    Icon icon = toolWindow.getIcon();
    presentation.setIcon(icon == null ? null : new SizedIcon(icon, icon.getIconHeight(), icon.getIconHeight()));
  }
}
项目:intellij-ce-playground    文件:ActivateToolWindowAction.java   
private void updatePresentation(@NotNull Presentation presentation, @NotNull ToolWindow toolWindow) {
  String title = toolWindow.getStripeTitle();
  presentation.setText(title);
  presentation.setDescription(IdeBundle.message("action.activate.tool.window", title));
  Icon icon = toolWindow.getIcon();
  if (EventLog.LOG_TOOL_WINDOW_ID.equals(myToolWindowId)) {
    icon = AllIcons.Ide.Info_notifications;
  }
  presentation.setIcon(icon == null ? null : new SizedIcon(icon, icon.getIconHeight(), icon.getIconHeight()));
}
项目:intellij-ce-playground    文件:DefaultLookupItemRenderer.java   
@Nullable
public static Icon getRawIcon(final LookupElement item, boolean real) {
  final Icon icon = _getRawIcon(item, real);
  if (icon != null && icon.getIconHeight() > SAMPLE_ICON.getIconHeight()) {
    return new SizedIcon(icon, icon.getIconWidth(), SAMPLE_ICON.getIconHeight());
  }
  return icon;
}
项目:tools-idea    文件:DefaultLookupItemRenderer.java   
@Nullable
public static Icon getRawIcon(final LookupElement item, boolean real) {
  final Icon icon = _getRawIcon(item, real);
  if (icon != null && icon.getIconHeight() > SAMPLE_ICON.getIconHeight()) {
    return new SizedIcon(icon, icon.getIconWidth(), SAMPLE_ICON.getIconHeight());
  }
  return icon;
}
项目:consulo    文件:ActivateToolWindowAction.java   
private void updatePresentation(@Nonnull Presentation presentation, @Nonnull ToolWindow toolWindow) {
  String title = toolWindow.getStripeTitle();
  presentation.setText(title);
  presentation.setDescription(IdeBundle.message("action.activate.tool.window", title));
  Icon icon = toolWindow.getIcon();
  if (EventLog.LOG_TOOL_WINDOW_ID.equals(myToolWindowId)) {
    icon = AllIcons.Ide.Info_notifications;
  }
  presentation.setIcon(icon == null ? null : new SizedIcon(icon, icon.getIconHeight(), icon.getIconHeight()));
}
项目:consulo    文件:DefaultLookupItemRenderer.java   
@Nullable
public static Icon getRawIcon(final LookupElement item, boolean real) {
  final Icon icon = _getRawIcon(item, real);
  if (icon != null && icon.getIconHeight() > IconUtil.getDefaultNodeIconSize()) {
    return new SizedIcon(icon, icon.getIconWidth(), IconUtil.getDefaultNodeIconSize());
  }
  return icon;
}
项目:intellij-ce-playground    文件:StructureFilterPopupComponent.java   
public CheckboxColorIcon(int size, @NotNull Color color) {
  super(size, color);
  mySize = size;
  mySizedIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, mySize, mySize);
}
项目:intellij-ce-playground    文件:StructureFilterPopupComponent.java   
private SelectFromHistoryAction(@NotNull VcsLogStructureFilter filter) {
  super(getStructureActionText(filter), getTooltipTextForFiles(filter.getFiles(), false).replace("\n", " "), null);
  myFilter = filter;
  myIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, CHECKBOX_ICON_SIZE, CHECKBOX_ICON_SIZE);
  myEmptyIcon = EmptyIcon.create(CHECKBOX_ICON_SIZE);
}
项目:consulo    文件:StructureFilterPopupComponent.java   
public CheckboxColorIcon(int size, @Nonnull Color color) {
  super(size, color);
  mySize = size;
  mySizedIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, mySize, mySize);
}
项目:consulo    文件:StructureFilterPopupComponent.java   
@Override
public CheckboxColorIcon withJBUIPreScaled(boolean preScaled) {
  mySizedIcon = (SizedIcon)mySizedIcon.withJBUIPreScaled(preScaled);
  return (CheckboxColorIcon)super.withJBUIPreScaled(preScaled);
}
项目:consulo    文件:StructureFilterPopupComponent.java   
private SelectFromHistoryAction(@Nonnull VcsLogStructureFilter filter) {
  super(getStructureActionText(filter), getTooltipTextForFilePaths(filter.getFiles(), false).replace("\n", " "), null);
  myFilter = filter;
  myIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, CHECKBOX_ICON_SIZE, CHECKBOX_ICON_SIZE);
  myEmptyIcon = EmptyIcon.create(CHECKBOX_ICON_SIZE);
}