Repository navigation
bug/issue-42: Use a custom DataFormat for tab drag and drop - #55
Merged
Merged
Conversation
* 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
reviewed
Sep 25, 2026
Comment on lines
+186
to
+188
| static String @Nullable [] splitContent( | ||
| @Nullable Function<DataFormat, @Nullable Object> content | ||
| ) { |
Owner
There was a problem hiding this comment.
Bit of odd formatting, mostly noting a comment here for myself as a reminder to format this later
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 checkedgetString()forDragUtils.PREFIXshould use it instead.Testing
contentIsNotOfferedAsPlainTextfails before this change and passes after.contentRoundTrips: the identifier, drag group, and drop target read back from whatcontent()writes.dnd-bento;0;dockable:RQTASVHQ)