-
Enhancement
-
Resolution: Unresolved
-
P4
-
jfx18
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
In the drag DONE event, there is no way to determine whether an underlying file operation was successful or not. Checking with getTransferMode() is not sufficient. For example, you have a JavaFX file browser with two TreeViews and move (drag) files from one TreeView to the other. And then you will update the TreeViews by removing the source TreeItem and adding the target TreeItem when the file operation was successful. But the drag source only knows that the drag was done, not whether the file operation was successful or not. In the DRAG_DROPPED event, you can set setDropCompleted(true) if the file operation was successful and setDropCompleted(false) otherwise. But in the drag DONE event, isDropCompleted() always returns false and TransferMode always returns MOVE, regardless of whether the file operation failed or succeeded.
In the drag DONE event, there is no way to determine whether an underlying file operation was successful or not. Checking with getTransferMode() is not sufficient. For example, you have a JavaFX file browser with two TreeViews and move (drag) files from one TreeView to the other. And then you will update the TreeViews by removing the source TreeItem and adding the target TreeItem when the file operation was successful. But the drag source only knows that the drag was done, not whether the file operation was successful or not. In the DRAG_DROPPED event, you can set setDropCompleted(true) if the file operation was successful and setDropCompleted(false) otherwise. But in the drag DONE event, isDropCompleted() always returns false and TransferMode always returns MOVE, regardless of whether the file operation failed or succeeded.