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

UI consistency - BibTexStringEditorDialog rework #6287

Merged
merged 24 commits into from
May 8, 2020
Merged

Conversation

calixtus
Copy link
Member

@calixtus calixtus commented Apr 14, 2020

Follow up to #5737 . Took me only about four and a half months to figure that out. Thanks @tobiasdiez 😜 : Node.lookup did not work, as the textfield node was not present at the time a edit cell was created.

Good news is: I found a way to bypass the restrictions of the private textfield variable, bad news is, it's a bit of a hack, but hopefully somewhat leightweight.
Also changes in tables should now be commited, if the focus is lost. Temporarily removed again, since there are deeper issues with the CellFactory.

Im still working on some minor issues. Especially the validation in tablecells is completly dysfunctional.

grafik

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@calixtus
Copy link
Member Author

calixtus commented Apr 22, 2020

Finally most of the dialog works, but I had several problems with listening to the focus lost event.
This revealed some deeper issue with the CellFactory I have been investigating the last few days.
There was a very strange issue with the cells: Editing worked only on the first item and on the fifth and so on in case a listener is registered with the TableCell. At first I was not able to understand the issue, so I decided to work on the validation in the meantime, since the controlsfx-validation decoration did not work too (the icon was b/w and hidden behind the border of the cell, I chose to highlight the whole cell instead by a pseudo class, as we did in #6151). This led me finally to understand the direction, where the issue with the first and the fifth row came from. Probably JabRef is reusing nodes again to create TableRows. A picture is better than a thousand words:

grafik

There seems to be something wrong with the CellFactory. I tried to understand the issue, but had no success yet, so I could use some advise. Maybe @tobiasdiez can help me here, since he was able to solve a similar problem with the ListCellFactory in #5454 (I tried his solution here. Did I do something wrong?)

@koppor koppor changed the title [WIP] UI consistency - BibTexStringEditorDialog rework UI consistency - BibTexStringEditorDialog rework Apr 23, 2020
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Mhh strange. I've one idea, but not sure if this already suffices to fix this issue. The general point is that upon the initial rendering, the whole view port is filed with rows. These rows are then always reused and the method updateItem is called when the things that should be displayed in the row change.

From your screenshot, I would guess that there is a problem with the empty part of the code, as these rows are clearly empty but nonetheless are highlighted.

if (validationStatusProperty != null) {
validationStatusProperty.apply(viewModel).getHighestMessage().ifPresent(message -> {
setTooltip(new Tooltip(message.getMessage()));
subscriptions.add(BindingsHelper.includePseudoClassWhen(this, INVALID_PSEUDO_CLASS,
Copy link
Member

Choose a reason for hiding this comment

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

This line should probably be outside of the isPresent block as you want to subscribe to the validProperty in either case.

@calixtus
Copy link
Member Author

calixtus commented May 4, 2020

This should now be somewhat ready for review.
This should already an improvement to the earlier version of this dialog. Auto edit works etc. But due to a bug in JavaFX commit on focus lost is not working. A workaround I tried produces only more problems. This seems to be a known issue, but there is no progress in fixing it since 2017. ( https://bugs.openjdk.java.net/browse/JDK-8089514 ).
So I'll leave it at this point. I believe the dialog is better then before, although it is not perfect.

@calixtus calixtus marked this pull request as ready for review May 4, 2020 13:35
@calixtus calixtus added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 4, 2020
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Nice that you found a working version. LGTM!

@koppor koppor merged commit d18ce55 into master May 8, 2020
@koppor koppor deleted the ui_consistency branch May 8, 2020 20:25
Siedlerchr added a commit that referenced this pull request May 9, 2020
* upstream/master:
  Ignore generated .mv file
  Fix checkstyle, moved some comments for better understanding
  Sorting custom entry fields that contain numerical values (#6426)
  UI consistency - BibTexStringEditorDialog rework (#6287)
  Squashed 'src/main/resources/csl-styles/' changes from 270cd32..c35d219
koppor pushed a commit that referenced this pull request Dec 17, 2022
84dba23 Update international-union-of-crystallography.csl (#6279)
13dd9e8 Update zeitschrift-fur-deutsche-philologie.csl (#6340)
d95b652 Create cahiers-mondes-anciens.csl (#6203)
ded567c Create rassegna-degli-archivi-di-stato-bibliografia-generale.csl (#6275)
124777a Create scientific-online-letters-on-the-atmosphere.csl (#6261)
3c276e7 Create american-medical-association-no-url-alphabetical.csl (#6252)
595ad95 Bump mathieudutour/github-tag-action from 6.0 to 6.1 (#6287)
7008128 Create cambridge-a (#6336)
17e930c Update norsk-apa-manual-note.csl (#6338)
b360859 Update norsk-apa-manual.csl (#6337)
f6c778e Update emerald-harvard.csl (#6335)
d6c6a16 Fix Brazilian quotes on  chicago-author-date.csl (#6317)
a1549b6 Update medizinische-hochschule-hannover.csl (#6330)
da88073 Update journal-of-the-american-college-of-cardiology.csl (#6334)
a520d8e Bump nokogiri from 1.13.9 to 1.13.10 (#6333)
ba54b44 Update royal-society-of-chemistry.csl (#6328)
1378ba7 LUSEM: Remove full stop (#6332)
9e3cf89 Create interpreting.csl (#6254)
bef74ed Create conservation-science-and-practice.csl (#6258)
9fb7eb7 Bug fixes triangle.csl (#6251)
e6112ba Update ucl-university-college-apa.csl (#6250)
6dcba3a Update engineering-technology-and-applied-science-research.csl (#6247)
00fe4a2 Create constructivist-foundations.csl (#6243)
03ad71b Create les-mondes-du-travail.csl (#6234)
a2bce86 Corrections based on author instructions (#6306)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 84dba23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants