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

Source tab doi #3104

Merged
merged 4 commits into from Aug 14, 2017
Merged

Source tab doi #3104

merged 4 commits into from Aug 14, 2017

Conversation

lenhard
Copy link
Member

@lenhard lenhard commented Aug 14, 2017

Fixes #3103 by making sure that updates to the source tab are always performed on the FXApplication Thread.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?

@matthiasgeiger
Copy link
Member

The panel is now updated correctly, however, upon hitting "replace entry" after fetching the BibTeX data there are still some exceptions:

Log File
Uncaught exception Occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.IllegalStateException: Not on FX application thread; currentThread = AWT-EventQueue-0
  at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:236)
  at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:423)
  at javafx.scene.Parent$2.onProposedChange(Parent.java:367)
  at com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:317)
  at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.addTab(TabPaneSkin.java:879)
  at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.access$1100(TabPaneSkin.java:685)
  at com.sun.javafx.scene.control.skin.TabPaneSkin.addTabs(TabPaneSkin.java:332)
  at com.sun.javafx.scene.control.skin.TabPaneSkin.lambda$initializeTabListener$485(TabPaneSkin.java:415)
  at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
  at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
  at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
  at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
  at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
  at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
  at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:155)
  at org.jabref.gui.entryeditor.EntryEditor.readdOtherFieldsTab(EntryEditor.java:253)
  at org.jabref.gui.entryeditor.EntryEditor.rebuildOtherFieldsTab(EntryEditor.java:241)
  at org.jabref.gui.entryeditor.EntryEditor.listen(EntryEditor.java:222)
  at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
  at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
  at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
  at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
  at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
  at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
  at com.google.common.eventbus.EventBus.post(EventBus.java:217)
  at org.jabref.model.entry.BibEntry.setField(BibEntry.java:427)
  at org.jabref.model.entry.BibEntry.setField(BibEntry.java:448)
  at org.jabref.gui.mergeentries.MergeFetchedEntryDialog$ReplaceAction.actionPerformed(MergeFetchedEntryDialog.java:137)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$500(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.WaitDispatchSupport$2.run(Unknown Source)
  at java.awt.WaitDispatchSupport$4.run(Unknown Source)
  at java.awt.WaitDispatchSupport$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.awt.WaitDispatchSupport.enter(Unknown Source)
  at java.awt.Dialog.show(Unknown Source)
  at java.awt.Component.show(Unknown Source)
  at java.awt.Component.setVisible(Unknown Source)
  at java.awt.Window.setVisible(Unknown Source)
  at java.awt.Dialog.setVisible(Unknown Source)
  at org.jabref.gui.mergeentries.FetchAndMergeWorker.done(FetchAndMergeWorker.java:67)
  at javax.swing.SwingWorker$5.run(Unknown Source)
  at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
  at sun.swing.AccumulativeRunnable.run(Unknown Source)
  at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
  at javax.swing.Timer.fireActionPerformed(Unknown Source)
  at javax.swing.Timer$DoPostEvent.run(Unknown Source)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$500(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)

Uncaught exception Occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.IllegalStateException: Not on FX application thread; currentThread = AWT-EventQueue-0
  at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:236)
  at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:423)
  at javafx.scene.Parent$2.onProposedChange(Parent.java:367)
  at com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:317)
  at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.addTab(TabPaneSkin.java:879)
  at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.access$1100(TabPaneSkin.java:685)
  at com.sun.javafx.scene.control.skin.TabPaneSkin.addTabs(TabPaneSkin.java:332)
  at com.sun.javafx.scene.control.skin.TabPaneSkin.lambda$initializeTabListener$485(TabPaneSkin.java:415)
  at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
  at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
  at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
  at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
  at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
  at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
  at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:155)
  at org.jabref.gui.entryeditor.EntryEditor.readdOtherFieldsTab(EntryEditor.java:253)
  at org.jabref.gui.entryeditor.EntryEditor.rebuildOtherFieldsTab(EntryEditor.java:241)
  at org.jabref.gui.entryeditor.EntryEditor.listen(EntryEditor.java:222)
  at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
  at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
  at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
  at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
  at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
  at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
  at com.google.common.eventbus.EventBus.post(EventBus.java:217)
  at org.jabref.model.entry.BibEntry.setField(BibEntry.java:427)
  at org.jabref.model.entry.BibEntry.setField(BibEntry.java:448)
  at org.jabref.gui.mergeentries.MergeFetchedEntryDialog$ReplaceAction.actionPerformed(MergeFetchedEntryDialog.java:137)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$500(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.WaitDispatchSupport$2.run(Unknown Source)
  at java.awt.WaitDispatchSupport$4.run(Unknown Source)
  at java.awt.WaitDispatchSupport$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.awt.WaitDispatchSupport.enter(Unknown Source)
  at java.awt.Dialog.show(Unknown Source)
  at java.awt.Component.show(Unknown Source)
  at java.awt.Component.setVisible(Unknown Source)
  at java.awt.Window.setVisible(Unknown Source)
  at java.awt.Dialog.setVisible(Unknown Source)
  at org.jabref.gui.mergeentries.FetchAndMergeWorker.done(FetchAndMergeWorker.java:67)
  at javax.swing.SwingWorker$5.run(Unknown Source)
  at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
  at sun.swing.AccumulativeRunnable.run(Unknown Source)
  at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
  at javax.swing.Timer.fireActionPerformed(Unknown Source)
  at javax.swing.Timer$DoPostEvent.run(Unknown Source)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$500(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)

@lenhard
Copy link
Member Author

lenhard commented Aug 14, 2017

Indeed, thanks for pointing out! Should be fixed now.

It seems that we (I) need be more careful when updating FX components based on model events.

Copy link
Member

@matthiasgeiger matthiasgeiger left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -219,7 +219,9 @@ public void keyPressed(java.awt.event.KeyEvent e) {
public synchronized void listen(FieldAddedOrRemovedEvent event) {
// other field deleted -> update other fields tab
if (OtherFieldsTab.isOtherField(entryType, event.getFieldName())) {
rebuildOtherFieldsTab();
DefaultTaskExecutor.runInJavaFXThread(() -> {
Copy link
Member

Choose a reason for hiding this comment

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

You can actually omit the curly braces and write it as one liner:
DefaultTaskExecutor.runInJavaFXThread(() -> rebuildOtherFieldsTab());

@lenhard lenhard merged commit 97db424 into master Aug 14, 2017
@lenhard lenhard deleted the source-tab-doi branch August 14, 2017 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants