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())); } }
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())); }
@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; }
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())); }
@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; }
public CheckboxColorIcon(int size, @NotNull Color color) { super(size, color); mySize = size; mySizedIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, mySize, mySize); }
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); }
public CheckboxColorIcon(int size, @Nonnull Color color) { super(size, color); mySize = size; mySizedIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, mySize, mySize); }
@Override public CheckboxColorIcon withJBUIPreScaled(boolean preScaled) { mySizedIcon = (SizedIcon)mySizedIcon.withJBUIPreScaled(preScaled); return (CheckboxColorIcon)super.withJBUIPreScaled(preScaled); }
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); }