ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

IDEA Plugin JB* Components

2021-10-13 22:03:58  阅读:306  来源: 互联网

标签:intellij Plugin components IDEA ui Components docs com JB


Brice Dutheil 昨天 下午 3:09

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 条回复


Yann Cébron:jb: 1 天前

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 HelpIntelliJ 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 HelpIntelliJ Platform Plugin SDK Help

Miscellaneous Swing Components | IntelliJ Platform Plugin SDK (64 kB)

https://plugins.jetbrains.com/docs/intellij/misc-swing-components.html

:+1:1

Yann Cébron:jb: 1 天前

when using https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl.html you’ll get recommended components automatically

IntelliJ Platform Plugin SDK HelpIntelliJ Platform Plugin SDK Help

Kotlin UI DSL | IntelliJ Platform Plugin SDK (64 kB)

https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl.html

Brice Dutheil 1 天前

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.

Yann Cébron:jb: 1 天前

mostly, they fix known bugs in Swing or certain OS

:+1:1

Scott Wells 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.

:向上:1:+1:1:祈祷:1

Brice Dutheil 4 小时前

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

Brice Dutheil 4 小时前

Thank you both

Scott Wells 28 分钟前

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.

Yann Cébron:jb: 24 分钟前

psst com.intellij.ui.HtmlToSimpleColoredComponentConverter

Brice Dutheil 22 分钟前

Interesting, I wonder if one can hook actions on <a> tagged text.

Yann Cébron:jb: 21 分钟前

there’s dedicated com.intellij.ui.components.labels.LinkLabel

Brice Dutheil 19 分钟前

Yes but what if we need different actions for different part of the “text”

Yann Cébron:jb: 18 分钟前

com.intellij.ui.components.JBLabel#createHyperlinkListener and inspect HyperlinkEvent

Scott Wells 2 分钟前

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. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有