Skip to content

Reimplement date editor in JavaFX#2781

Merged
tobiasdiez merged 3 commits into
masterfrom
dateEditor
Apr 22, 2017
Merged

Reimplement date editor in JavaFX#2781
tobiasdiez merged 3 commits into
masterfrom
dateEditor

Conversation

@tobiasdiez

@tobiasdiez tobiasdiez commented Apr 21, 2017

Copy link
Copy Markdown
Member

Another reimplementation of an editor to make JabRef usable again 😸, this time featuring the date editor. The new one uses the built-in JavaFX date picker and so LGoodDatePicker is no longer needed.
untitled
In the progress I discovered a quite hidden feature: when you double-clicked in a date field, then the current date was inserted. I removed this as I think nobody really knew about it in the first place and moreover it also takes 2 clicks to select the current date with the calendar popup.

There are still some layout problems (small width, additional empty line below it) that are probably a result of the mixed Swing and JavaFX stuff. Hopefully, this will be resolved more or less automatically if also the background tab pane is converted to JavaFX.

  • 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?

@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 21, 2017
@koppor

koppor commented Apr 21, 2017

Copy link
Copy Markdown
Member

This also fixes #2755

@tobiasdiez tobiasdiez merged commit 059f805 into master Apr 22, 2017
@tobiasdiez tobiasdiez deleted the dateEditor branch April 22, 2017 12:48
@ambro2

ambro2 commented Apr 23, 2017

Copy link
Copy Markdown
Contributor

Actually I do use the double click feature a lot! I found it in the documentation page for timestamp https://help.jabref.org/en/TimeStamp.
I find it very handy to set the urldate field and, in particular, for setting the timestamp field. My setting for timestamp is "yyyy.MM.dd HH:mm", however the date picker (up to v 4.0.0 beta) with the "today" button set the field with the correct format but at midnight: e.g. 2017.04.23 00:00. The double click instead correctly set hours and minutes.
I tested the development version JabRef-4.0.0-dev--snapshot--2017-04-22--master--059f805e6.jar and the new date picker does not work when setting timestamp with my current setting:

Uncaught exception Occurred in Thread[JavaFX Application Thread,5,main] java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay at java.time.LocalDate.get0(Unknown Source) at java.time.LocalDate.getLong(Unknown Source) at java.time.format.DateTimePrintContext.getValue(Unknown Source) at java.time.format.DateTimeFormatterBuilder$NumberPrinterParser.format(Unknown Source) at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(Unknown Source) at java.time.format.DateTimeFormatter.formatTo(Unknown Source) at java.time.format.DateTimeFormatter.format(Unknown Source) at org.jabref.gui.fieldeditors.DateEditorViewModel$1.toString(DateEditorViewModel.java:24) at org.jabref.gui.fieldeditors.DateEditorViewModel$1.toString(DateEditorViewModel.java:19) at com.sun.javafx.scene.control.skin.ComboBoxPopupControl.updateDisplayNode(ComboBoxPopupControl.java:424) at com.sun.javafx.scene.control.skin.DatePickerSkin.handleControlPropertyChanged(DatePickerSkin.java:141) at com.sun.javafx.scene.control.skin.BehaviorSkinBase.lambda$registerChangeListener$61(BehaviorSkinBase.java:197) at com.sun.javafx.scene.control.MultiplePropertyChangeListenerHandler$1.changed(MultiplePropertyChangeListenerHandler.java:55) at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:89) at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:361) at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81) at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:105) at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112) at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146) at javafx.scene.control.ComboBoxBase.setValue(ComboBoxBase.java:150) at com.sun.javafx.scene.control.skin.DatePickerContent.selectDayCell(DatePickerContent.java:689) at com.sun.javafx.scene.control.skin.DatePickerContent.lambda$createDayCells$174(DatePickerContent.java:731) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470) at javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398) at javafx.scene.Scene$MouseHandler.process(Scene.java:3766) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:381) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:417) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:416) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Unknown Source)

On Windows 10 64 bit:

java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Changing the timestamp settings to "yyyy.MM.dd" it works (but useless for me).

Siedlerchr added a commit that referenced this pull request Apr 23, 2017
* upstream/master:
  Reimplement date editor in JavaFX (#2781)
  Update CONTRIBUTING.md
  Add new author
  Update Checkstyle Version
  fix some more checkstyle warnings
  fix some more checkstyle warnings
  Fix Build failure, hopefully
  Spanish translation (#2773)
  Fixes #2766 If file is not found annotations might be null
  Fix language tests
  Remove preferences and globals from tests (#2768)
  Fix Unable to create Checker
  Fix checkstyle warnings
  New checkstyle rules regarding spacing
  Reimplement owner editior in JavaFX
  Reimplement url editior in JavaFX
  Reimplement journal editior in JavaFX
  New checkstyle rules regarding spacing

# Conflicts:
#	src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java
#	src/main/java/org/jabref/migrations/FileLinksUpgradeWarning.java
Siedlerchr added a commit that referenced this pull request Apr 29, 2017
* upstream/master: (84 commits)
  Update README.md
  Update CHANGELOG.md
  Fixes #2789 Add Referer to API call (#2794)
  Change some FileDialogs to DialogService (#2767)
  Fix for issue 2762: Change CSV export to separate all names using semicolon (#2793)
  Set eclipse line wrapping to maximum
  Do not log an exception if side pane was not found (#2791)
  Added 'Ink' to the supported FileAnnotationType (required to close #2777)
  Renamed parseFileAnnotationType() to parse()
  Reimplement date editor in JavaFX (#2781)
  Update CONTRIBUTING.md
  Add new author
  Fixes handling of unknown PDAnnotation types.
  Update Checkstyle Version
  fix some more checkstyle warnings
  fix some more checkstyle warnings
  Fix Build failure, hopefully
  Spanish translation (#2773)
  Fixes #2766 If file is not found annotations might be null
  Fix language tests
  ...

# Conflicts:
#	src/main/java/org/jabref/logic/util/io/FileUtil.java
@tobiasdiez

Copy link
Copy Markdown
Member Author

Thanks @ambro2 for the feedback. I just fixed the support for timestamps that include hours and minutes. You may try out the version from builds.jabref.org/fixt/ or wait a few days until it is merged in to the development version.

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