Skip to content

jabgui still requires java.desktop: AWT clipboard and java.awt.DesktopΒ #764

Description

@calixtus

πŸ€– jabgui/src/main/java/module-info.java:17 still declares requires java.desktop, although no javax.swing reference is left in jabgui β€” the Swing undo manager was the last one, and it is gone.

What still pulls the module in is AWT, in two unrelated places:

  • The clipboard β€” ClipBoardManager uses java.awt.Toolkit, java.awt.datatransfer.DataFlavor, StringSelection, Transferable, UnsupportedFlavorException.
  • Desktop integration β€” java.awt.Desktop in DefaultDesktop, NativeDesktop, Linux and SendAsEMailAction. Note that NativeDesktop already carries the comment "java.awt.Desktop cannot be used as we don't want to rely on AWT", so this half is partly a leftover.

JavaFX has javafx.scene.input.Clipboard, so the first half looks like a swap β€” but the AWT path exists to reach flavours JavaFX does not expose, and that has to be checked rather than assumed. The mail and browse calls need their own per-platform answer.

So this is two pieces of work with one payoff (dropping the module requirement), and neither is undo work. Filed because the undo migration set out to remove java.desktop and got only as far as removing the javax.swing half of it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions