英文:
Inspect UI in IntelliJ IDEs
问题
我想直接从代码中修改IntelliJ中的一些UI (https://github.com/JetBrains/intellij-community),但是我很难确定特定UI组件所在的面板/类是什么。
有没有一种方法可以告诉“嘿,鼠标光标下面是哪个面板?” - 就像浏览器中的“检查元素”一样。
我已经添加了来自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:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论