Skip to content

docs: add SwingBridge interoperability section#5603

Open
taefi wants to merge 2 commits into
mainfrom
swingbridge-interop
Open

docs: add SwingBridge interoperability section#5603
taefi wants to merge 2 commits into
mainfrom
swingbridge-interop

Conversation

@taefi
Copy link
Copy Markdown
Contributor

@taefi taefi commented May 24, 2026

Summary

  • New documentation under articles/tools/modernization-toolkit/swing-bridge/interop/ covering the SwingBridge interop API and tooling that lets a hybrid Vaadin/Swing application call across the boundary type-safely.
  • Five pages in the subsection:
    • index.adoc — mental model, ingredients table, decision tree, shipped-vs-roadmap status, and a "Prerequisites → Adding the Annotations JAR" recipe for Maven, Gradle, Ant, and IDE-managed Swing projects.
    • calling-swing-methods.adoc@ExposedMethod, the four invocation shapes, WINDOW/SINGLETON/STATIC_ONLY discovery, @InstanceProvider, and BridgeHandle.onReady / requestAsync / isReady.
    • listening-to-swing-events.adoc@VaadinCallback, the three Dispatch modes, setter-vs-adder/remover wiring, and the Registration cleanup pattern.
    • sharing-domain-types.adoc — the parent-first classloader invariant and the three domain-type strategies (Type 3 / 3+ shipped; Type 1 / Type 2 explicitly flagged roadmap).
    • patterns.adoc — Vaadin-rendered LOV dialog, BeforeLeaveObserver navigation guard, calling a bridge from a view that doesn't host the Swing component, and the SwingBridge.runInAppContext(...) AppContext escape hatch.
  • Bumps :swing-bridge-version: in articles/_vaadin-version.adoc from 1.1.2 to 1.2.0 so every doc that resolves the attribute (Maven coordinates, Gradle, the direct-download curl URL, installation-from-scratch, etc.) shows the release version that ships these APIs.

All API and annotation names match the live source on the internalize-swing-bridge-toolkit branch of vaadin/vaadin-swing-bridge (PRs #190 / #191): packages under com.vaadin.swingbridge.interop.*, static entry point SwingBridge.interop(), typed handle via SwingBridge.interop().of(MyBridge.class). Type 1 / Type 2 codegen Mojos are described as roadmap only, not as recipes.

Test plan

  • npm run dspublisher:start and confirm the SwingBridge section sidebar shows the new "Interoperability" subsection with index + four pages in the order: Calling Swing Methods, Listening to Swing Events, Sharing Domain Types, Patterns and Cookbook.
  • On the Interoperability index page: section_outline-rendered "Topics" entries show @ExposedMethod, @VaadinCallback, and SwingBridge in monospace.
  • On each sub-page: cross-references resolve (no broken <<...#>> xrefs).
  • On the Interop index → Prerequisites → Adding the Annotations JAR section: the Maven, Gradle, and manual snippets all show 1.2.0 (from the _vaadin-version.adoc attribute), and the curl URL is https://maven.vaadin.com/vaadin-addons/com/vaadin/swing-bridge-annotations/1.2.0/swing-bridge-annotations-1.2.0.jar.
  • articles/tools/modernization-toolkit/swing-bridge/installation-from-scratch.adoc still renders cleanly with the bumped 1.2.0 Maven <swing-bridge.version>.
  • Vale lint passes for the new pages.

🤖 Generated with Claude Code

Documents the SwingBridge interop API and tooling that lets a hybrid
Vaadin/Swing application call across the boundary type-safely. New
section under modernization-toolkit/swing-bridge/interop/ covers calling
Swing methods (@ExposedMethod, BridgeHandle), handling Swing events
(@VaadinCallback, Dispatch modes), sharing domain types across the
classloader split, and higher-order patterns (LOV dialog, navigation
guard, runInAppContext). Bumps the doc-wide :swing-bridge-version:
attribute to 1.2.0 so coordinates and download URLs render consistently
for the release that ships these APIs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 24, 2026

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-5603.fly.dev

Built from d28eaa4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant