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

undo keyboard shortcut Ctrl-Z disfunction #9737

Closed
2 tasks done
jh-midi opened this issue Apr 5, 2023 · 8 comments · Fixed by #9777
Closed
2 tasks done

undo keyboard shortcut Ctrl-Z disfunction #9737

jh-midi opened this issue Apr 5, 2023 · 8 comments · Fixed by #9777
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor

Comments

@jh-midi
Copy link

jh-midi commented Apr 5, 2023

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

almalinux

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. ...open library
  2. insert entry
  3. use keyboard shortcut Contol-Z
  4. .=> exception
  5. ...
    I have the same result on windows and os-x

JabRef 5.10--2023-04-05--643319b
Linux 5.14.0-162.22.2.el9_1.x86_64 amd64
Java 19.0.2
JavaFX 20+19

Appendix

Detail information:
Uncaught exception occurred in Thread[#37,JavaFX Application Thread,5,main]
java.lang.IllegalStateException: Only cut/copy/paste supported but got UNDO
	at [email protected]/org.jabref.gui.edit.EditAction.lambda$execute$0(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at [email protected]/org.jabref.gui.edit.EditAction.execute(Unknown Source)
	at [email protected]/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source)
	at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source)
	at [email protected]/org.controlsfx.control.action.Action.handle(Unknown Source)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
	at [email protected]/javafx.scene.control.MenuItem.fire(Unknown Source)
	at [email protected]/com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$2(Unknown Source)
	at [email protected]/com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(Unknown Source)
	at [email protected]/com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at [email protected]/javafx.event.Event.fireEvent(Unknown Source)
	at [email protected]/javafx.scene.Scene.processKeyEvent(Unknown Source)
	at [email protected]/javafx.scene.Scene$ScenePeerListener.keyEvent(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.handleKeyEvent(Unknown Source)
	at [email protected]/com.sun.glass.ui.View.notifyKey(Unknown Source)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Log copied to clipboard.
@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Apr 5, 2023
@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Apr 5, 2023
@Siedlerchr
Copy link
Member

thanks for reporting, I encountered this recently as well

@brunaoo
Copy link
Contributor

brunaoo commented Apr 6, 2023

Hello!
I would like to work on this issue

@koppor
Copy link
Member

koppor commented Apr 8, 2023

You will have to touch nearly the complete code base and introduce the command pattern there. Will take > 100 hours to complete. Much thinking involved: How does proper undo/redo management look like? How is the state of the art in Java in 2023? In Swing/AWT times, it was easy with the "UndoManager", which we also use. However, JabRef did not strictly implement it in all places, because we thought, in JavaFX we need to do it differently.

You are also welcome to try to fix the concrete issue (not solving the underlying issue), but better some step forward than nothing.

@jh-midi
Copy link
Author

jh-midi commented Apr 9, 2023

Control-Z work in JabRef 5.9 ;
In JabRef 5.10 , the menu action Edit>Undo still work
Only the Control-Z shortcut disfunction, it is introduced in JabRef 5.10.
The error message in the window fired by Control-Z seem displaced.

@brunaoo
Copy link
Contributor

brunaoo commented Apr 11, 2023

I believe I can start addressing the concrete problem by working on the org.jabref.gui.maintable.MainTable class. What do you think?

@Siedlerchr
Copy link
Member

@brunaoo You have to look into the EditAction. Probably remove or check the default case

public class EditAction extends SimpleCommand {

@brunaoo
Copy link
Contributor

brunaoo commented Apr 11, 2023

@brunaoo You have to look into the EditAction. Probably remove or check the default case

public class EditAction extends SimpleCommand {

ok!

@Siedlerchr
Copy link
Member

java.lang.IllegalStateException: Only cut/copy/paste supported but got REDO
	at [email protected]/org.jabref.gui.edit.EditAction.lambda$execute$0(EditAction.java:78)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at [email protected]/org.jabref.gui.edit.EditAction.execute(EditAction.java:49)
	at [email protected]/org.jabref.gui.actions.JabRefAction.lambda$new$3(JabRefAction.java:40)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:423)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:64)
	at javafx.base@20/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base@20/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at javafx.base@20/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at javafx.base@20/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@20/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@20/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@20/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@20/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.controls@20/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at javafx.controls@20/com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$2(ControlAcceleratorSupport.java:184)
	at javafx.graphics@20/com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(KeyboardShortcutsHandler.java:383)
	at javafx.graphics@20/com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(KeyboardShortcutsHandler.java:163)
	at javafx.base@20/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@20/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@20/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@20/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@20/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@20/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@20/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base@20/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@20/javafx.scene.Scene.processKeyEvent(Scene.java:2190)
	at javafx.graphics@20/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2711)
	at javafx.graphics@20/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:218)
	at javafx.graphics@20/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:150)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at javafx.graphics@20/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:250)
	at javafx.graphics@20/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@20/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:249)
	at javafx.graphics@20/com.sun.glass.ui.View.handleKeyEvent(View.java:542)
	at javafx.graphics@20/com.sun.glass.ui.View.notifyKey(View.java:966)

@github-project-automation github-project-automation bot moved this from Normal priority to Done in Prioritization May 7, 2023
@calixtus calixtus changed the title undo keyboard shortcut Ctrl-Z disfonction undo keyboard shortcut Ctrl-Z disfunction May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants