-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed 'copy key and link' #6871
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
865c8f2
'copy key and link' from right-click menu creates a string that is no…
PremKolar 04843f0
updated authorlist
PremKolar e7e3a17
added entry to change log
PremKolar 77fed31
'copy key and link' now sets html content again and also sets a fallb…
PremKolar 409a416
Update src/main/java/org/jabref/gui/edit/CopyMoreAction.java
PremKolar d022875
Merge branch 'master' into #5835_copyKeyAndLink
PremKolar 2449d2a
CHANGELOG.md
calixtus ce50536
Remove obsolete method
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really puts the html string into the clipboard, so if you paste it into say notepad you get
<a href="url">key</a>
. Instead, its better to add the html, and in addition also a fallback string of the formatkey - url
. In this way, you get the desired behavior also when you paste in applications that do understand html (e.g onenote).In order for this to work, you probably need to add a second fallback argument to
jabref/src/main/java/org/jabref/gui/ClipBoardManager.java
Lines 140 to 145 in 3db4313
which is then added to the ClipboardContent via
putString
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tobiasdiez !
Ah ok that makes sense.. I guess I should have looked deeper into what setHtmlContent() actually does.. I assumed it would be applicable for url's on their own only. So that means, both, setContent() and setHtmlContent() should be called?
Sorry for my noobness! This was my first open-source contribution ever :D
Can I fix the issue tonight (German time) and commit the changes?
thanks,
Niko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, you were on the right track. Calling
setContent
andsetHtmlContent
is the right idea, but I suspect that this will push two different clipboard items. Instead, thesetHtmlContent
should be modified as follows:This should add one clipboard item, containing both the html as well as the normal string. (I hope)
Let me know if you encounter any further questions. There is not such a thing as noobness. We all can learn more. And learning in a relaxed environment is one of the main points of open source, so don't worry. Happy coding!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was exactly my next thought :)
Ok, I will try..
Thanks for the kind words!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, i hope i did what you meant. I have to say, I still don't understand why copyKeyAndLink() creates html content for the clipboard, but e.g. copyKeyAndTitle() does not?
cheers,
Niko