Ignore:
Timestamp:
11/05/19 16:16:11 (5 years ago)
Author:
bnemhaus
Message:

Added the ability to copy/paste recognised files (mostly images) into Expeditee. This functionality already existed when drag n dropping, but now also works when using copy/paste.

At this stage, recognised files get imported as a approapriate Text Item. For example, a image will create a @i Text Item and attach it to your cursor. Ideally this would be the image directly. Unfortunately, items attached to the cursor (FreeItems) are not currently parsed. This is something I will discuss with David as there are confounding issues to consider. For example: surrogates...

Attached to the bottom of this commit message are my current thoughts.

Also made it so when creating a @i through DND or Copy/Paste, that @i is as relative as possible. The users image directories setting is used to achieve this.


  • FreeItems need to be parsed...we would need to deal with primaries/surrogates in them...
  • Do we want FreeItems to be parsed? If I attach an item to my cursor and then enter surrogate mode, should it change?
  • My gut says no. Both because it would be work, and also because it kind of feels like a free win if we do not.
  • But we do want to replace @i with images etc. Therefore, we want an old style parse for FreeItems?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gio/javafx/JavaFXDragAndDropManager.java

    r1097 r1436  
    6666                                                List<File> files = dragboard.getFiles();
    6767                                                if (files != null && files.size() > 0) {
    68                                                         importFileList(files, dropPoint);
     68                                                        importFileList(files, dropPoint, false);
    6969                                                }
    7070                                        } else if (dragboard.hasContent(_URIListDataflavorString)) {
    7171                                                String data = (String) dragboard.getContent(_URIListDataflavorString);
    7272                                                List<File> files = textURIListToFileList(data);
    73                                                 importFileList(files, dropPoint);
     73                                                importFileList(files, dropPoint, false);
    7474                                                success = true;
    7575                                        } else if (dragboard.hasContent(_URIListDataflavorCharArray)) {
     
    7777                                                String uriString = new String(data);
    7878                                                List<File> files = textURIListToFileList(uriString);
    79                                                 importFileList(files, dropPoint);
     79                                                importFileList(files, dropPoint, false);
    8080                                                success = true;
    8181                                        } else if (dragboard.hasString()) {
    8282                                                String str = dragboard.getString();
    8383                                                if (str != null && str.length() > 0) {
    84                                                         importString(str, dropPoint);
     84                                                        importString(str, dropPoint, false);
    8585                                                        success = true;
    8686                                                }
Note: See TracChangeset for help on using the changeset viewer.