标签:intellij Plugin components IDEA ui Components docs com JB
Hi,
Is there a reference documentation somewhere about the JB*
components, what each bring over the regular swing ones. Without (Java)doc currently we can look at the code but it’d be nice if a reference was available. (The current code base is in Java)
14 条回复
some are documented here https://plugins.jetbrains.com/docs/intellij/lists-and-trees.html and https://plugins.jetbrains.com/docs/intellij/misc-swing-components.html
IntelliJ Platform Plugin SDK Help
List and Tree Controls | IntelliJ Platform Plugin SDK (64 kB)
https://plugins.jetbrains.com/docs/intellij/lists-and-trees.html
IntelliJ Platform Plugin SDK Help
Miscellaneous Swing Components | IntelliJ Platform Plugin SDK (64 kB)
https://plugins.jetbrains.com/docs/intellij/misc-swing-components.html
1
when using https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl.html you’ll get recommended components automatically
IntelliJ Platform Plugin SDK Help
Kotlin UI DSL | IntelliJ Platform Plugin SDK (64 kB)
https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl.html
I have seen some these links and they are indeed what I am looking for, but the UI toolkit you’ve built have way more component or utils, JBScrollPane, JBLabel, JBTextField, CellRendererPanel, RelativeFont, JBFont, etc.
mostly, they fix known bugs in Swing or certain OS
1
Obviously far from scientific, but my stance is to use the JB version of a component over the Swing version of the same component when available assuming that 1) it's going to provide a more homogeneous look-and-feel within the host IDE; 2) it's likely that it's fixed bugs and/or tuned to perform better. And note that not all JB components are named as such, e.g., ComboBox
vs. JComboBox
.
111
Yes I discovered the ComboBox yesterday as well, there are not all located in the same ui
parent packages, eg:
com.intellij.ui.table.JBTable
com.intellij.openapi.ui.ComboBox
Thank you both
On the same topic, one of my absolute favorite JB components is SimpleColoredComponent
and its derivatives Colored*CellRenderer
. Think of these as being a replacement for JLabel
when you want to have styled text fragments.
psst com.intellij.ui.HtmlToSimpleColoredComponentConverter
Interesting, I wonder if one can hook actions on <a>
tagged text.
there’s dedicated com.intellij.ui.components.labels.LinkLabel
Yes but what if we need different actions for different part of the “text”
com.intellij.ui.components.JBLabel#createHyperlinkListener
and inspect HyperlinkEvent
I actually implemented my own very simple HyperlinkLabel
component because LinkLabel
didn't quite do what I wanted/needed. Specifically I wanted a label that could behave like a hyperlink in some situations and like a regular label in others when there's no clickable status. It ends up being <50 lines of code (including white space) as a small subclass of SimpleColoredComponent
, so the cost of ownership is very, very low for a component that does exactly what I need. (已编辑)
标签:intellij,Plugin,components,IDEA,ui,Components,docs,com,JB 来源: https://www.cnblogs.com/beansoft/p/15404407.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。