正在更改代码中的插件操作图标



我正在为Android Studio开发一个插件(Intellij Idea)。我想在执行操作时更改图标。

但这并没有改变图标。

这是代码-

public void actionPerformed(AnActionEvent event) {
        Project project = event.getData(PlatformDataKeys.PROJECT);
        ActionManager actionManager = event.getActionManager();
        AnAction anAction = actionManager.getAction("York.toggle");
        Presentation presentation = anAction.getTemplatePresentation();
        presentation.setIcon(IconLoader.getIcon("/icons/ic_fav_search_24dp.png"));

        /*String adbPath = getAdpPathOnMachine(project);
        BroadcastHelper.main(new String[]{adbPath});*/
    }

使用com.intellij.openapi.actionSystem.AnActionEvent#getPresentation

最新更新