https://github.com/bric3/intellij-platform-swing-components
Small library of Swing components destined to be used on the IntelliJ platform (for plugins)
https://github.com/bric3/intellij-platform-swing-components
intellij-platform intellij-plugin swing
Last synced: 3 months ago
JSON representation
Small library of Swing components destined to be used on the IntelliJ platform (for plugins)
- Host: GitHub
- URL: https://github.com/bric3/intellij-platform-swing-components
- Owner: bric3
- License: mpl-2.0
- Created: 2023-09-14T21:36:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-25T07:20:12.000Z (12 months ago)
- Last Synced: 2025-06-25T08:29:28.380Z (12 months ago)
- Topics: intellij-platform, intellij-plugin, swing
- Language: Kotlin
- Homepage:
- Size: 2.66 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= IntelliJ Platform Swing Components
⚠️ WORK IN PROGRESS ⚠️
[link=https://github.com/bric3/intellij-platform-swing-components/actions/workflows/build.yaml]
image::https://github.com/bric3/intellij-platform-swing-components/actions/workflows/build.yaml/badge.svg[Build Workflow]
The goal of this project is to build a library of UI components
for the IntelliJ Platform, since IntelliJ is based on Swing, these
components are pure Swing but may use IntelliJ specific APIs.
The primary language is Kotlin, but using these components from Java
should be supported, if not then it's an API bug.
== Demo of these components is provided via the demo plugin.
Run the `:components-demo-plugin:runIde` task to launch the demo plugin.
[source,bash]
----
./gradlew :components-demo-plugin:runIde
----
Or the shipped run configuration _demo-plugin [runIde]_ for IntelliJ IDEA.
== Components
* `ScaledJBTable` and `ScaledTableView` fix an issue regarding the row height
when using custom renderer and switching back and forth between presentation mode.
+
Note a fix is coming in https://github.com/JetBrains/intellij-community/commit/f861bdb0e69a9af16b777e1e29cc3131e8e58987[2023.3],
see https://youtrack.jetbrains.com/issue/IDEA-320501/Zooming-in-tables-in-Profiler-TW[IDEA-320501] and https://youtrack.jetbrains.com/issue/IDEA-289745/JBTable.updateUI-does-not-recompute-the-row-height-which-breaks-when-switching-presentation-mode[IDEA-289745].
+
+ Compare without and with the fix:
+
.Presentation mode *before* fix
image::.github/images/ScalableJTable-presentation-mode-nofix.png[Without fix]
+
.Presentation mode *after* fix
image::.github/images/ScalableJTable-presentation-mode-withfix.png[After fix]
+
.Zoom at 150% *before* fix
image::.github/images/ScalableJTable-zoom-150-nofix.png[Without fix]
+
.Zoom at 150% *after* fix
image::.github/images/ScalableJTable-zoom-150-withfix.png[Without fix]
* `ColoredProgressBar`, it allows using a custom color for the progress bar,
the `JProgressBar` with the regular DarculaUI does not allow that.
+
image::.github/images/ColoredProgressBar.png[ColoredProgressBar]
* `HoveringToolbar` allows showing a toolbar when hovering a table row.
+
image::.github/images/HoveringToolbar.gif[HoveringToolbar]
* `SvgIcon` allows using SVG icons, it is based on the `SvgDocument` from https://github.com/weisJ/jsvg[JSVG]
+
image::.github/images/SvgIcon.png[SvgIcon]
* `ExpandableSplitter` allows expanding/collapsing a component in a similar way as the IntelliJ's
Git Toolwindow to show branches.
+
image::.github/images/ExpandableSplitter.gif[ExpandableSplitter]
* `DialogWrapper2` extends `DialogWrapper` with methods to convert `com.intellij.openapi.actionSystem.AnAction` to
`javax.swing.Action`, multiple choice buttons are supported as well.
+
image::.github/images/DialogWrapper2.png[DialogWrapper2]
== Tests
I don't exactly know how to test Swing components at this time,
so this part is skipped for now. This is definitely an area that
needs help.
== License
This work is licensed under *Mozilla Public License 2.0* unless mentioned otherwise
in specific classes or packages. Basically MPL 2 allows commercial use and
distribution under a proprietary license, but it is required:
. to mention the origin and the associated license somewhere.
. to disclose any modifications under the same license.
For more details, it is encouraged to read the https://www.mozilla.org/en-US/MPL/2.0/[license itself].
> IntelliJ Platform Swing Components
>
> Copyright (c) 2023 - Brice Dutheil
>
> This Source Code Form is subject to the terms of the Mozilla Public
> License, v. 2.0. If a copy of the MPL was not distributed with this
> file, You can obtain one at https://mozilla.org/MPL/2.0/.
>
> SPDX-License-Identifier: MPL-2.0