gpt4 book ai didi

android - 从代码更改插件操作图标

转载 作者:搜寻专家 更新时间:2023-11-01 09:47:37 25 4
gpt4 key购买 nike

我正在为 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

关于android - 从代码更改插件操作图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37229652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com