Skip to content
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

Special field editor for fields with entry keys #1637

Merged
merged 10 commits into from
Sep 20, 2016
Merged

Special field editor for fields with entry keys #1637

merged 10 commits into from
Sep 20, 2016

Conversation

oscargus
Copy link
Contributor

Related to JabRef#14 among others.

capture12

There are some fundamental issues with drag and drop, such as the entry in the entry editor keeps changing when selecting other entries to drag. Also, I do not really get the table to update very nicely, even though the code is to a large extent a copy of the file link editor.

One can see this as a proof of concept and maybe something to build further upon. If it wasn't for the weird behaviour of the table, I would be more positive.

Ideally we should specify one or more fields that can be used to relate entries, such as "cites" and "similar" (or something).

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef

@oscargus
Copy link
Contributor Author

oscargus commented Jul 28, 2016

Some comments:

  • There will be a more intelligent text in the right column. Now I just took the title. The idea is to use some layout formatter to get a nice string. Now there is a slightly more intelligent text.
  • It is possible to drag entries from the main table, but hard to know for sure which entry is in the editor when dropping. Disabled drag and drop as it doesn't make sense with the current select entry -> update entry editor
  • The key column can be edited and the right column updates appropriately.
  • No support for entries changing keys (yet, this is already an issue for e.g. the crossref field and should be solver independently). Fixed in Added change listener for crossref field #1645
  • The buttons for the crossref field are wrong. I just removed two to make it look like one cannot move entries up and down (since there can only be one entry there). Fixed
  • It looks like it is possible to right-click on an entry an select it in the main table, but it doesn't work (yet). Fixed
  • When moving entries up and down as well as adding them, there are some weird things going on. Maybe it is needed to synchronize absolutely every access to the underlying list? Fixed
  • The "links" tab is just something I made up in "Set up general fields". crossref (which should be a single line field as the key, btw, if this PR is not finished) and related should be treated as regular fields.

@oscargus oscargus force-pushed the entryfield branch 2 times, most recently from b2e1923 to 99e17cc Compare August 16, 2016 18:55
@oscargus
Copy link
Contributor Author

@JabRef/developers : This can be tested at http://builds.jabref.org/entryfield/ now as it works quite well. Make sure that you show the crossref, related, and/or entryset field(s) in some tab. With this it would also make sense to start thinking about citedby/references fields as it will be easily implementable now.

@oscargus
Copy link
Contributor Author

I'm having some problems getting a bibtex key auto completer to work in the table. Has anyone worked with the auto completer and knows how it works?

@koppor
Copy link
Member

koppor commented Sep 13, 2016

Can we first do something without autocompleter?

I worked with the auto completer ~5 years ago, but I have nearly forgotten anything. And it was a mess.

@koppor
Copy link
Member

koppor commented Sep 13, 2016

Is the current state that we "only" have to test and then this is good to be reviewed?

@oscargus
Copy link
Contributor Author

Yes, I think that it is good to try out. Apart from the auto completer and drag-and-drop (which seems quite hard to get right since the entry editor is updated when selecting fields) this should be OK.

@@ -129,4 +129,20 @@ public void testNoPeriod() {
Assert.assertEquals("B C Bruce, C K von Manson and J Jumper",
a.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly"));
}

@Test
Copy link
Member

Choose a reason for hiding this comment

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

This seems to come from another issue, but we can merge it nevertheless.

@koppor
Copy link
Member

koppor commented Sep 13, 2016

Do you have time to work on the functionality a bit?

  • After clicking + and double clicking on Unknown entry, the editor of the bibtex key has to be focused
  • When double clicking the second column, nothing happens. "Select" should be executed
  • When pressing + and then the "go down" button, an exception is raised
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Row index out of range
        at javax.swing.JTable.boundRow(JTable.java:2143)
        at javax.swing.JTable.setRowSelectionInterval(JTable.java:2166)
        at net.sf.jabref.gui.fieldeditors.EntryLinkListEditor.moveEntry(EntryLinkListEditor.java:343)
        at net.sf.jabref.gui.fieldeditors.EntryLinkListEditor.lambda$new$3(EntryLinkListEditor.java:124)
  • I have to restart JabRef to get "Other fields" shown. Steps: New database, add entry with surelynotknown = {value}, add another entry, switch back to first entry. No tab "Other fields shown". This might really be out of scope.

@koppor
Copy link
Member

koppor commented Sep 13, 2016

Autocompletion: @stefan-kolb might know something (because of #1136), but this might be too far away. @stefan-kolb We would "just" need to have an AutoCompleter for all existing bibtex keys. If this is easy possible, that would be fine.

# Conflicts:
#	src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java
#	src/main/java/net/sf/jabref/model/entry/InternalBibtexFields.java
#	src/test/java/net/sf/jabref/logic/layout/format/AuthorsTest.java
@tobiasdiez
Copy link
Member

BibtexKeyAutoCompleter ?

@oscargus
Copy link
Contributor Author

Yes, the auto completer is there. I just cannot get it to work in a table cell...

@@ -11,7 +11,7 @@

import net.sf.jabref.model.entry.BibEntry;

class TransferableEntrySelection implements Transferable {
public class TransferableEntrySelection implements Transferable {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a heritage from when I tried to implement drag and drop. currently it is not needed.

Copy link
Member

Choose a reason for hiding this comment

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

OK for me to move forward here. I wish the nasty UI issues of #1637 (comment) can be solved.

@oscargus
Copy link
Contributor Author

I removed more unused code. Added double click (and a place holder for focusing on the bibtex key field, which I do not know how to do). I couldn't trigger the error you mentioned, but noted that the last edit is not always saved properly. For example, if one selects a new entry. I do not think this happened earlier, but not sure.

@koppor koppor merged commit 67583d9 into master Sep 20, 2016
@koppor koppor deleted the entryfield branch September 20, 2016 10:24
zesaro pushed a commit to zesaro/jabref that referenced this pull request Nov 22, 2016
@koppor koppor mentioned this pull request Dec 9, 2016
1 task
@koppor koppor changed the title [WIP] Special field editor for fields with entry keys Special field editor for fields with entry keys Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants