跳到正文
cccskills
免费在 GitHub 公开中文介绍

jewel-swing-interop

将 Jewel Compose 界面嵌入 IntelliJ 工具窗口标签页或其他 Swing 面板,选择合适的桥接 API,将 Swing 主题设置传入 Compose,并连接组件与对话框。

原文查看原文说明

Embed Jewel Compose UI in Swing.

JetBrains/intellij-community星标 20,684(GitHub 20,684 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 为工具窗口添加 Compose 标签页
  • 在 Swing 面板中嵌入 Jewel 界面
  • 从 Compose 打开 Swing 对话框
  • 将 Swing 主题应用到 Compose

中文介绍

功能

本技能介绍如何把使用 Jewel Compose 构建的界面嵌入 Swing。对于 IntelliJ Platform 工具窗口,可使用 addComposeTab(...);对于一般的 Swing 宿主,可使用 JewelComposePanel 等入口。在插件界面中,SwingBridgeTheme 会将 Swing 的颜色和文字设置传入 Compose。技能还介绍在需要时启用合成、从 Compose 获取宿主 Swing 组件,以及将文件选择器或对话框操作交给 Swing 处理。

适用场景

当您想用 Compose 构建 IntelliJ 插件界面,并将其放入现有 Swing UI,或想在自定义 Swing 面板中显示 Jewel 界面时,可以使用本技能。它整理了两种 UI 系统交界处需要的设置,包括主题衔接、组件层级、尺寸调整,以及调用 Swing 对话框。

使用示例

  • “请为这个工具窗口添加一个 Compose 标签页。”
  • “请在现有 Swing 面板中显示这个 Jewel 可组合界面。”
  • “请说明如何从 Compose 按钮打开 Swing 文件选择器。”

注意事项

请确认目标 IntelliJ Platform 基准版本和 Jewel API 版本。手动启用合成以及无主题入口属于实验性路径。启用合成时,无限循环动画可能影响性能。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好资料标明实验性路径,并说明循环动画可能影响性能。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足资料要求确认 IntelliJ 和 Jewel 版本,但没有安装步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(2)

  • SKILL.md4.1 KB
  • skill-source.json1021 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/jewel-swing-interop/SKILL.md -->

Jewel Swing Interop

Embed Compose/Jewel into Swing with bridge primitives from ide-laf-bridge and foundation.

Quick Snippets

Tool window tab:

toolWindow.addComposeTab(tabDisplayName = "My Tab") {
    SwingBridgeTheme {
        MyToolWindowContent()
    }
}

Generic Swing host:

val panel = JewelComposePanel {
    MyPluginComposable()
}

Manual compositing enablement (non-toolwindow entrypoint):

enableNewSwingCompositing()
val panel = JewelComposePanel { MyPluginComposable() }

Use The Highest-Level API First

Pick the simplest valid entrypoint:

  1. Tool window tab: ToolWindow.addComposeTab(...).
  2. Generic Swing host: compose(...) / JewelComposePanel(...).
  3. Custom theming flow: composeWithoutTheme(...) / JewelComposeNoThemePanel(...).

Default to themed entrypoints; use no-theme variants only when theme wrapping is intentionally external.

Enable New Swing Compositing Early

Call enableNewSwingCompositing() before attaching Compose content when needed.

Notes:

  1. ToolWindow.addComposeTab(...) already does this internally.
  2. The function is idempotent and safe at multiple entry points.
  3. This improves z-order/resizing behavior but can affect performance with infinitely repeating animations.
  4. Treat enableNewSwingCompositing() and no-theme entrypoints as advanced/experimental paths.

Apply Bridge Theme In Plugin Context

Use SwingBridgeTheme for IntelliJ plugin UI:

  1. Pulls Swing LaF colors/metrics/typography into Compose.
  2. It provides bridge composition locals for icon and new-UI behavior, clipboard access, density scaling, shortcuts, and URI handling.

Do not use standalone IntUiTheme for plugin-hosted Swing integration.

Bridge Compose To Swing/AWT Safely

For bidirectional operations:

  1. Use LocalComponent to get the host Swing component when APIs require Component.
  2. Use bridge utilities for color conversion and LaF key lookup when styling custom interop elements.
  3. Delegate file chooser and dialog operations to Swing (JFileChooser, etc.) from Compose callbacks.

Version Discipline

Treat this skill as Jewel-version scoped.

  1. Ask for target IntelliJ Platform baseline and Jewel API version.
  2. Validate behavior against Jewel release notes when APIs differ by platform generation.
  3. Prefer high-level bridge entrypoints that are stable in target versions.
  4. For shipped skill updates, refresh reference links to the corresponding release tag.

Interop Checklist

Before finishing:

  1. Confirm compositing flag is set at proper entrypoints.
  2. Confirm theme wrapper is SwingBridgeTheme (unless deliberately no-theme).
  3. Confirm host component access uses LocalComponent.
  4. Confirm toolwindow integrations use addComposeTab when applicable.
  5. Confirm interop code avoids creating extra unmanaged ComposePanel wrappers.

References

Read these source files when implementing:

  1. ToolWindowExtensions.kt
  2. JewelComposePanelWrapper.kt
  3. SwingBridgeTheme.kt
  4. Compatibility.kt (enableNewSwingCompositing)
  5. README Swing interoperability section

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

actions

免费有简介

实现或修改 IntelliJ `AnAction`,并在 `plugin.xml` 中注册。将显示名称和说明写入消息资源文件,按需设置图标,并通过事件协程作用域启动挂起任务,避免同步处理阻塞 IDE。

  • 为 IDE 菜单添加操作
  • 修改操作注册或图标
  • 整理操作名称和说明
JetBrains/intellij-community2.1万2026年10月29日 更新

bazel-test-migration

免费有简介

将 IntelliJ JPS 测试模块迁移到 Bazel,并排查仅在 Bazel 中出现的失败。根据症状检查依赖、插件、测试数据和 runfiles,重新生成并验证目标。

  • 将 JPS 测试模块迁移到 Bazel
  • 排查仅在 Bazel 中失败的测试
  • 检查测试依赖和数据配置
JetBrains/intellij-community2.1万2026年10月29日 更新

code-style

免费有简介

按 IntelliJ 项目规范编写或审查 Kotlin 和 Java 代码,涵盖语言选择、格式、密封类型、线程注解及控制流异常处理。

  • 按 IntelliJ 规范编写 Kotlin
  • 审查 Java 代码
  • 检查异常处理和密封类型分支
JetBrains/intellij-community2.1万2026年10月29日 更新

commits

免费有简介

本指南帮助您按 IntelliJ 项目规则拆分更改并撰写提交信息:有工单时使用编号和变更说明,无工单时使用标签与子系统名,并在需要时说明原因和决定。

  • 按项目格式编写带工单号的提交信息
  • 整理测试或文档提交并选择合适标签
  • 按规则修改已有提交信息
JetBrains/intellij-community2.1万2026年10月29日 更新

使用多个 Python 类型检查器比较代码片段或文件的类型推断和报错判断,并汇总各工具的结论、耗时与诊断信息,可保存为 Markdown 报告。

  • 比较不同检查器的类型推断
  • 确认代码是否会被判为类型错误
  • 查看多个工具的诊断差异
JetBrains/intellij-community2.1万2026年10月29日 更新

整理 Compose Desktop 界面中的状态和副作用,让可组合函数负责绘制,由展示器或协调器处理应用决策。了解状态归属、Effect、可复用组件接口、延迟列表键、动画和性能,适用于单项界面修改。

  • 分离界面绘制与展示器决策
  • 整理界面状态的归属
  • 检查 Effect 键和协程用法
JetBrains/intellij-community2.1万2026年10月29日 更新

查看 JetBrains 的全部技能

报告此技能的问题