Skip to content

Commit

Permalink
[eclipse-lsp4e#254] Add menu item icons
Browse files Browse the repository at this point in the history
  • Loading branch information
travkin79 committed Aug 12, 2024
1 parent 3f99a77 commit 58bca88
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.lsp4e.LanguageServerPlugin;
import org.eclipse.lsp4e.ui.LSPImages;
import org.eclipse.lsp4j.SymbolKind;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.actions.CompoundContributionItem;

public class OutlineViewFilterMenuContributor extends CompoundContributionItem {
Expand Down Expand Up @@ -57,6 +60,11 @@ private static class HideSymbolKindAction extends Action {
super(kind.name(), IAction.AS_CHECK_BOX);
this.kind = kind;
this.setChecked(isHideSymbolKind(kind));

Image img = LSPImages.imageFromSymbolKind(kind);
if (img != null) {
this.setImageDescriptor(ImageDescriptor.createFromImage(img));
}
}

@Override
Expand Down

0 comments on commit 58bca88

Please sign in to comment.