Skip to content

Files can be dropped to entry preview panel to attach a file again.#3135

Merged
koppor merged 4 commits into
masterfrom
fixClassCast
Aug 20, 2017
Merged

Files can be dropped to entry preview panel to attach a file again.#3135
koppor merged 4 commits into
masterfrom
fixClassCast

Conversation

@koppor

@koppor koppor commented Aug 19, 2017

Copy link
Copy Markdown
Member

This fixes JabRef#245. The issue was caused during a code cleanup at #2723: https://github.com/JabRef/jabref/pull/2723/files#diff-093fbc56554f6c75313823ee81f28ec6L152

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?


if (t.isDataFlavorSupported(urlFlavor)) {
List<File> transferedFiles = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);
files.addAll(transferedFiles.stream().map(file -> file.toPath()).collect(Collectors.toList()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use static reference: File::toPath

@Siedlerchr Siedlerchr Aug 19, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And mabye add a comment that it has to be a File object and not a path. I remember that I fixed this before the regression and that java only recognizes this, if it is file object;)

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 19, 2017
@koppor koppor added this to the v4.0 milestone Aug 19, 2017
}

if (t.isDataFlavorSupported(urlFlavor)) {
List<File> transferedFiles = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a nitpick, but since you're already at it could you please change this variables name from t to someting more meaningful?

Otherwise the code looks fine.

@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 20, 2017
@koppor koppor merged commit c87c527 into master Aug 20, 2017
@koppor koppor deleted the fixClassCast branch August 20, 2017 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop to preview panel does not work any more

5 participants