-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor BaseAction in RightClickMenu #5958
Conversation
…EntryAction, AttachFileAction
…y, copyKeyAndTitle to CopyMoreActions
Wow, thanks for your huge work! So far I could not see anything which is breaking |
Wow 🤩. Good to see that the GUI code gets better. That always causes much changes. I am really happy that you accepted the challange to do so. You can also start working on bigger refactorings. We need to reduce So, I would propose that |
# Conflicts: # src/main/resources/l10n/JabRef_en.properties
Made some final corrections. Should be mergeable now, but I'm not sure if it's best to merge this PR before the next major release. Maybe there are some bugs I did not spot and there would be not much time for the latest dev users to test the changes... |
@tobiasdiez If possible, could you have a quick look? We would merge it to use the current energy of @calixtus and to avoid huge merge conflicts. |
|
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.
Very good work! I haven't found any major issues and as usual the code quality is really good.
I echo the concern of @calixtus and would recommend waiting with the merge after the release this weekend. There is no need to risk that half of the menu is not working (although the risk for this is really low).
# Conflicts: # src/main/resources/l10n/JabRef_en.properties
Sorry, wrong commit title. |
# Conflicts: # src/main/java/org/jabref/gui/JabRefFrame.java
I think the most sensible way to proceed is, after completely extracting But what will need some discussion is how to proceed with the |
Sounds like a reasonable program. 👍 The undo manager needs to be completely rewritten (we are still using the Swing one). My idea was that one needs to only register what action is performed and the undo manager automatically listens to all changes in the open databases. // Somewhere global
UndoManager.listenForChanges(currently open database);
// If an action is performed
try (UndoManager.newOperation("Action name")) {
entry.setField(blaba);
} In this way, the logic package can be completely independent of the undo manager and does not need to care to return change information (e.g. as it's done right now in the Some links that might be helpful: |
The RightClickMenu should now be completely clean of any BaseAction stuff. No more hidden BaseAction in SpecialFields or so. Next step (definitely in another PR) will be to extract BaseAction out of JabRefFrame (main menu and toolbar). But that shouldn't be a big deal anymore (except maybe SaveAction), but most of the funny stuff is already done. |
The ADR on using the Swing Undomanager was in short: Why reimplementing things already industry proven only because the package name is wrong. Maybe with the new module system, we can skip shipping the swing module so we reduce the binary size when reimplementing the UndoManager. |
The new context menu style that is proposed in JabRef#5958 is now used for the ShortScience integration.
# Conflicts: # src/main/java/org/jabref/gui/JabRefFrame.java
b8ef7b7
to
21c6e5e
Compare
I started by bugfixing some missing executablebindings. It totally escalated. Sorry.
I believe this could be the beginning of an approach to get rid of the deprecated BaseAction and OldCommandWrapper stuff.
I stop here, because this PR is becoming quite complex even though I tried to keep my modifications short and simple (e.g. I did not extract BasePanel or Globals.prefs, if I did not had to). This PR is theoretically mergable, but we should talk about it first.
I tested everything by hand, it should all work like before.
L10n yet missing, I'm doing this in the very end.