检查 IntelliJ IDE 中的用户界面

huangapple go评论75阅读模式
英文:

Inspect UI in IntelliJ IDEs

问题

我想直接从代码中修改IntelliJ中的一些UI (https://github.com/JetBrains/intellij-community),但是我很难确定特定UI组件所在的面板/类是什么。

有没有一种方法可以告诉“嘿,鼠标光标下面是哪个面板?” - 就像浏览器中的“检查元素”一样。

特定的UI部分是查找面板中的“文件+行号”:
检查 IntelliJ IDE 中的用户界面

我已经添加了来自https://github.com/JetBrains/intellij-community的代码,并尝试通过“查找”面板中的字符串进行搜索,但由于我不是Java开发人员,所以没有找到我要找的东西。

英文:

I want to modify some UI in IntelliJ straight from the code (https://github.com/JetBrains/intellij-community), but I am having a hard time to identify which panel/class that particular UI component is.

Is there a way to tell "Hey, what panel is beneath the mouse cursor?"? - just like "Inspect element" in a browser.

The particular UI piece is the "file + line number" from the find panel:
检查 IntelliJ IDE 中的用户界面

I've added the code from https://github.com/JetBrains/intellij-community and tried searching by strings found in the "Find" panel, but as I'm not a Java developer, haven't found what I'm looking for.

答案1

得分: 4

When running IntelliJ in internal mode (should be by default in your sandbox), you get the UI inspector under Tools > Internal Actions > UI > UI Inspector.

The specific UI element you are looking for is hard to get this way though, because when transferring focus to the UI inspector you lose the find popup.
My guess is that you are looking for an implementation of ItemPresentation, the one in PsiFileImpl might give you a good starting point.

Edit. You can open the UI inspector for any UI element with the shortcut <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Click</kbd>, where you click on the element you want to inspect.

英文:

When running IntelliJ in internal mode (should be by default in your sandbox), you get the UI inspector under Tools > Internal Actions > UI > UI Inspector.

The specific UI element you are looking for is hard to get this way though, because when transferring focus to the UI inspector you lose the find popup.
My guess is that you are looking for an implementation of ItemPresentation, the one in PsiFileImpl might give you a good starting point.


Edit. You can open the UI inspector for any UI element with the shortcut <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Click</kbd>, where you click on the element you want to inspect.

huangapple
  • 本文由 发表于 2023年2月18日 21:41:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75493730.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定