Convert New entry dialog to javafx#4312
Conversation
…wEntryDialog * 'master' of https://github.com/1160300608/jabref: fix pdfImport old dialog problem fix order and empty else statement delete useless class file convert the NewEntryType Dialog to javafx # Conflicts: # src/main/java/org/jabref/gui/EntryTypeDialog.java # src/main/java/org/jabref/gui/actions/NewEntryAction.java
add title pane add bindings Create view model todo Co-authored-by: 1160300608 <18846010223@163.com>
…fetchr bind combobox directly to fetcher improve binding pass preferences to constructor delete obsolete gui test class and old dialog
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks a lot for investing the time to get the PR in. Sadly, there are still a lot of (small) code issues that need to be fixed.
| if (actualType == null) { | ||
| // Find out what type is wanted. | ||
| final EntryTypeDialog etd = new EntryTypeDialog(frame); | ||
| //final EntryTypeDialog etd = new EntryTypeDialog(frame); |
There was a problem hiding this comment.
Remove the old commented code
| //etd.setVisible(true); | ||
| //actualType = etd.getChoice(); | ||
| etv.showAndWait(); | ||
| actualType = etv.getChoice(); |
There was a problem hiding this comment.
It is more in line with the JavaFX way, if EntryTypeView derives from Dialog<EntryType> and then you can get the choice as the return value of showAndWait().
|
|
||
| @FXML private ButtonType generateButton; | ||
| @FXML private TextField idTextField; | ||
| @FXML private ComboBox<IdBasedFetcher> comboBox; |
| @FXML private TitledPane bibTexTitlePane; | ||
| @FXML private TitledPane ieeeTranTitlePane; | ||
| @FXML private TitledPane customTitlePane; | ||
| @FXML private VBox vBox; |
| private final JabRefPreferences prefs; | ||
|
|
||
| private EntryType type; | ||
| private Task<Optional<BibEntry>> fetcherWorker = new FetcherWorker(); |
There was a problem hiding this comment.
move worker to the view model
| if (actualType == null) { | ||
| // Find out what type is wanted. | ||
| final EntryTypeDialog etd = new EntryTypeDialog(frame); | ||
| //final EntryTypeDialog etd = new EntryTypeDialog(frame); |
There was a problem hiding this comment.
Is this method even used with null argument? At least the code below suggests that the JabRefFrame uses the NewEntryAction and does not calls this method.
There was a problem hiding this comment.
I just found out that this method and the insertEntry method are doing roughly the same, I think it makes sense to combine their functionaltiy
|
|
||
| EntryTypeDialog typeChoiceDialog = new EntryTypeDialog(jabRefFrame); | ||
| typeChoiceDialog.setVisible(true); | ||
| //EntryTypeDialog typeChoiceDialog = new EntryTypeDialog(jabRefFrame); |
| // Find out what type is desired | ||
| EntryTypeDialog etd = new EntryTypeDialog(frame); | ||
| etd.setVisible(true); | ||
| //EntryTypeDialog etd = new EntryTypeDialog(frame); |
| //EntryTypeDialog etd = new EntryTypeDialog(frame); | ||
| EntryTypeView etd = new EntryTypeView(frame.getCurrentBasePanel(), frame.getDialogService(), Globals.prefs); | ||
| //etd.setVisible(true); | ||
| etd.showAndWait(); |
There was a problem hiding this comment.
The code below looks like yet another place with code duplication (which is however slightly different to the one above, eg. timestamp generation).
| getBoolean(ENFORCE_LEGAL_BIBTEX_KEY), | ||
| getKeyPattern(), | ||
| getKeywordDelimiter()); | ||
| get(KEY_PATTERN_REGEX), |
There was a problem hiding this comment.
the code formatting was ok before...this indention looks ugly to be honest.
TODO: merge insertentry and newEntry in basePanel
fix event handler
|
Adressed all comments, The Duplicate check is actually different handled and is slightly coupled to the import inspection dialog. This is stuff for a new PR. |
* upstream/master: Wrap preferences in scrollPane as well (#4325)
|
I would like to merge this now, if no further comments are added., |
Followup from #4266
bibtex +custom

biblatex + custom
