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

migrate-settings-to-compose-swing

将现有 Swing 设置页面迁移到 Compose Swing,梳理状态、事件和设置应用顺序,并准备表单预览与测试,便于在 IDE 中检查迁移后的界面和行为。

原文查看原文说明

Move a Swing settings page to Compose Swing, with previews and tests.

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

实测评分 未实测

查看安装方法

适用场景

  • 将 Swing 设置页迁移到 Compose Swing
  • 把设置表单与控制器分开
  • 为迁移后的表单添加预览和测试
  • 保留 Apply 和 Reset 的行为

中文介绍

功能

本技能指导你把现有 Swing 设置页面迁移到 Compose Swing,并从梳理页面到完成检查逐步推进。它会帮助你盘点页面、嵌套编辑表单、输入校验、搜索以及 Apply、Reset、Cancel 的行为,再将状态和事件整理到控制器与 Composable 之间。重建界面时沿用已有组件,并保留设置事务、应用顺序、输入校验、焦点和无障碍支持。它还会为各表单准备预览和测试,并在 IDE 中对照原页面检查外观与操作。

适用场景

当你要把 JetBrains IDE 的设置页面替换为 Compose Swing 时,可以使用本技能。如果迁移必须保留既有设置的应用顺序或共享模型,或者还需要表单级测试、预览及 IDE 中的显示检查,它也能帮助你安排这些工作。

使用示例

  • “请按步骤整理这个 Swing 设置页面迁移到 Compose Swing 的工作。”
  • “请把设置表单从控制器中分离,并添加预览和测试。”

注意事项

工作流程包含阅读 Compose Swing UI DSL、组件状态和测试规范的库文档。流程假设你会在 IDE 中打开并检查预览和实际页面。

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

文档检查

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

安全性发送数据、删除文件、执行命令等是否有说明
A良好要求报告未迁移页面和无法完成的检查。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足需要查阅库文档并在 IDE 中检查,但未提供安装步骤。

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

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

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

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

包含的文件(1)

  • SKILL.md5.6 KB

SKILL.md(原文)

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

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/migrate-settings-to-compose-swing/SKILL.md -->

Migrating Swing settings pages

Extract the UI into declarative Compose Swing functions: state down, events up. Keep the configurable's transaction and application order.

Read kotlin-ui-dsl.md, README.md, and raw-swing.md. Read the library's component state and testing contracts.

Steps

Preserve unrelated files. Report unrelated renderer failures separately.

  1. Inventory every page, nested editor, and extension-provided form in the requested screen. Identify its model, UI owner, validation, search, and Apply, Reset, and Cancel behavior.
  2. Separate the controller from the form before changing layout. The controller reads the working model into state and handles events. The composable receives values and callbacks. It must render without a live project model. Use content slots for specialized controls that need platform services.
  3. Build one composition at the page boundary. Use the existing owner's lifetime. Child forms are composables in that composition; they take no disposable and create no host. Preserve configurables that own navigation, shared models, or application order. Use ComposeSwingSearchableConfigurable for a standalone page without those contracts.
  4. Use the base library's declarative controls for buttons, labels, text, and choices. Replace control-field reads with state reads. A programmatic Reset updates state. It does not publish a user edit. A migration creates no new components. When no library or IntelliJ component covers a control, stop and report it as a missing component. A new component is a reusable composable in the IntelliJ components package. It follows every rule of the library's custom components guide.
  5. Rebuild a Kotlin UI DSL panel { } with FormPanel. A page without the DSL keeps its layout structure. Preserve bundle keys, spacing, focus, labels, accessibility, and validation. Derive enabled and visible regions from state. Use one authority for each property. Keep hidden controls in the composition when their identity or state must survive.
  6. Add zero-argument composables with org.jetbrains.compose.swing.tooling.Preview beside each production form. Preview state and callbacks must call the same form. Include inherited values and disabled regions. Use the default preview size. A preview must not construct a project, configurable, transaction, or composition host. Use the preview to expose dependencies that belong in the controller.
  7. Test each migrated form in runComposeSwingTest, with the form passed to its setContent. Drive user actions, adopt callbacks into state, and assert the rendered result after recomposition. Test Reset, enabled regions, selection, labels, and value preservation. Test Apply, Cancel, model validation, disposal, and rebuilding through the owner's public API. Lifecycle tests alone do not verify the form. Confirm that the runner executed the intended tests.
  8. Open and interact with the previews in the IDE. Compare the live pages with the original. Check spacing, focus traversal, accessibility, keyboard actions, resizing, and the IDE look and feel. The running IDE must use the same form APIs as the compiled source. Report an API mismatch with the required IDE build; do not change the form to fit a stale runtime.

Rules

  • State. Each value has one owner. Hoist shared values and derive presentation from them. Preserve staged values across navigation. Key repeated editors by model identity. Do not cache model values with remember when Reset or another page can change them.
  • Transactions. Keep edits in the existing working model. Use bind(...) for persisted settings owned by ComposeSwingSearchableConfigurable. Preserve property transformations and change notifications. A standalone configurable calls requestModifiedCheck() for state changes without a user gesture.
  • Lifecycle. Dispose the root composition with its UI owner. Rebuilding creates a new composition. Do not dispose on temporary detachment. Do not add a disposable for each child form. An override of ComposeSwingSearchableConfigurable.disposeUIResources must call super.
  • Threading. Reach PSI, VFS, documents, and the project model from a LaunchedEffect.
  • Validation. Keep input-time and apply-time checks. Use ConfigurationException for apply-time refusal and the error-outline modifier for field errors.
  • Search. A composition host waits for a window and is empty during offscreen traversal. Use the standalone configurable's immediate composition when that traversal is required. Index conditionally absent strings with a SearchableOptionContributor when they must remain findable.
  • Verification. The headless harness verifies state, callbacks, and structure. Verify painting, preferred sizes, attach-scoped behavior, and visual parity in a realized IDE window. Report unconverted pages and unavailable checks. A wrapper around an unchanged form is not a completed page.

评价

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

评论

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

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

提交后会立即公开。请勿填写邮箱、电话等个人信息。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 的全部技能

报告此技能的问题