Skip to content

bug/issue-42: Use a custom DataFormat for tab drag and drop - #55

Merged
Col-E merged 1 commit into
Col-E:masterfrom
philliplbryant:bug/issue-42
Sep 25, 2026
Merged

Col-E merged 1 commit into
Col-E:masterfrom
philliplbryant:bug/issue-42

Conversation

@philliplbryant

@philliplbryant philliplbryant commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #42

This is a potentially breaking change

Drags are no longer offered as plain text, so applications that detect a Bento drag by checking Dragboard.getString() for DragUtils.PREFIX will stop matching. @Col-E, per my understanding of your comments in previous pull requests, this is a version zero release and similarly breaking changes were preferred to maintaining backward compatibility. As such, I did not include a plain-text fallback. However, as suggested by @richmeyer7, DragUtils.isDockableDrag(Dragboard) was added to mitigate future content changes breaking downstream code. Code that checked getString() for DragUtils.PREFIX should use it instead.

Testing

  • contentIsNotOfferedAsPlainText fails before this change and passes after.
  • contentRoundTrips: the identifier, drag group, and drop target read back from what content() writes.
  • Manually confirmed drag drop into a text editor no longer pastes plain text (e.g. dnd-bento;0;dockable:RQTASVHQ)

* Use a custom BentoFX dockable MIME type and `DataFormat` for drag and drop gestures.
* DRYed up and reused existing code to split the `Dragboard` content.
* Add `DragUtils.isDockableDrag(Dragboard)` so downstream code can recognize a dragged `Header` without inspecting the `Dragboard` content.
* Add `DragUtilsTest` to cover content is no longer offered as plain text, that the `Dragboard` content survives round-trip, and that `isDockableDrag` recognizes only content `DragUtils` wrote.
@Col-E Col-E added the bug Something isn't working label Sep 23, 2026
@philliplbryant philliplbryant changed the title Use a custom DataFormat for tab drag and drop (#42) bug/issue-42: Use a custom DataFormat for tab drag and drop Sep 24, 2026
Comment on lines +186 to +188
static String @Nullable [] splitContent(
@Nullable Function<DataFormat, @Nullable Object> content
) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of odd formatting, mostly noting a comment here for myself as a reminder to format this later

@Col-E
Col-E merged commit cdec6ae into Col-E:master Sep 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab drag and drop can paste DnD text into other applications that support clipboard text

2 participants