IDEA Plugin JB* Components

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


IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components1 天前

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

IDEA Plugin JB* ComponentsIntelliJ Platform Plugin SDK Help

List and Tree Controls | IntelliJ Platform Plugin SDK (64 kB)

https://plugins.jetbrains.com/docs/intellij/lists-and-trees.html

IDEA Plugin JB* ComponentsIntelliJ Platform Plugin SDK Help

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

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

IDEA Plugin JB* Components1

IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components1 天前

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

IDEA Plugin JB* ComponentsIntelliJ Platform Plugin SDK Help

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

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

IDEA Plugin JB* Components

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.

IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components1 天前

mostly, they fix known bugs in Swing or certain OS

IDEA Plugin JB* Components1

IDEA Plugin JB* Components

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.

IDEA Plugin JB* Components1IDEA Plugin JB* Components1IDEA Plugin JB* Components1

IDEA Plugin JB* Components

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

IDEA Plugin JB* Components

Brice Dutheil 4 小时前

Thank you both

IDEA Plugin JB* Components

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.

IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components24 分钟前

psst com.intellij.ui.HtmlToSimpleColoredComponentConverter

IDEA Plugin JB* Components

Brice Dutheil 22 分钟前

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

IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components21 分钟前

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

IDEA Plugin JB* Components

Brice Dutheil 19 分钟前

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

IDEA Plugin JB* Components

Yann CébronIDEA Plugin JB* Components18 分钟前

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

IDEA Plugin JB* Components

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. (已编辑)

上一篇:java API文档使用方法以及文档下载链接


下一篇:接口文档使用