[8] Request for review: 7075105: WIN: Provide a way to format HTML on drop (original) (raw)
Denis S. Fokin denis.fokin at oracle.com
Wed Feb 27 09:47:09 PST 2013
- Previous message: hg: jdk8/awt/jdk: 8009158: Incomplete fix for 7178079
- Next message: hg: jdk8/awt/jdk: 8008660: Failure in 2D Queue Flusher thread on Mac
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Please take a look at the next fix.
Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7075105 Webrev can be found at: http://cr.openjdk.java.net/~denis/7075105/webrev.03/
I have executed a number of data transfer and drag and drop tests. No new failures have been found.
The fix intended to introduce three data flavors to represent transferred via clipboard and drag and drop HTML data.
The flavors are presented as fields in the DataFlavor class. The flavors are distinguishable by their mime-type parameters. So I have updated DataFlavor.equals(DataFlavor) implementation.
We lazily build mapping between the native data transfer formats and java flavors in the SystemFlavorMap class. Before we stored values in flavorToNative and nativeToFlavor maps in a type independent way as objects and handled special cases for text flavors latter in the SystemFlavorMap.getFlavorsForNative method. This way we stored both strings and flavors in the same container. I have slightly refactored our code to generify it and introduce froeach loops. I also replaced (Set + LinkedList) approach with LinkedHashSet one which should work the same way.
Conversion from java Transferable to the native data is enabled in WDataTransferer.translateTransferable().
To be able to use a foreach approach instaed of (for + iterator) in convertMimeTypeToDataFlavors method I have changed DataTransferer.standardEncodings() return type.
To be consistent with jdk7 model I have put some AutoCloseable instances in try clauses.
I have also created a pair of tests. One is manual and another is automatic one.
Thank you, Denis.
- Previous message: hg: jdk8/awt/jdk: 8009158: Incomplete fix for 7178079
- Next message: hg: jdk8/awt/jdk: 8008660: Failure in 2D Queue Flusher thread on Mac
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]