[jabref] 01/03: remove DatePickerButton patch

Tony Mancill tmancill at moszumanska.debian.org
Tue Dec 27 03:04:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch dev
in repository jabref.

commit 2085e25df057f4753d6d7a759473dc378ef6f76c
Author: tony mancill <tmancill at debian.org>
Date:   Mon Dec 26 18:50:52 2016 -0800

    remove DatePickerButton patch
    
    Not needed after koppor's rebased debian_3.8.1 branch.
---
 debian/patches/060_DatePickerButton.patch | 126 ------------------------------
 debian/patches/series                     |   1 -
 2 files changed, 127 deletions(-)

diff --git a/debian/patches/060_DatePickerButton.patch b/debian/patches/060_DatePickerButton.patch
deleted file mode 100644
index dae8055..0000000
--- a/debian/patches/060_DatePickerButton.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-Description: backport libmicroba-java support for 3.8.1 DatePickerButton.java
-Author: tony mancill <tmancill at debian.org>
-Forwarded: not-needed
-
---- a/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
-+++ b/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
-@@ -1,9 +1,14 @@
- package net.sf.jabref.gui.date;
- 
- import java.awt.BorderLayout;
-+import java.awt.event.ActionEvent;
-+import java.awt.event.ActionListener;
-+import java.text.SimpleDateFormat;
- import java.time.LocalDate;
-+import java.time.ZoneId;
- import java.time.format.DateTimeFormatter;
- import java.time.format.DateTimeParseException;
-+import java.util.Date;
- 
- import javax.swing.JComponent;
- import javax.swing.JPanel;
-@@ -11,51 +16,67 @@
- import net.sf.jabref.Globals;
- import net.sf.jabref.gui.IconTheme;
- import net.sf.jabref.gui.fieldeditors.FieldEditor;
-+import net.sf.jabref.logic.util.date.EasyDateFormat;
- import net.sf.jabref.preferences.JabRefPreferences;
- 
--import com.github.lgooddatepicker.components.DatePicker;
--import com.github.lgooddatepicker.components.DatePickerSettings;
--import com.github.lgooddatepicker.optionalusertools.DateChangeListener;
--import com.github.lgooddatepicker.zinternaltools.DateChangeEvent;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- 
-+import com.michaelbaranov.microba.calendar.DatePicker;
-+
- /**
-  * wrapper and service class for the DatePicker handling at the EntryEditor
-  */
--public class DatePickerButton implements DateChangeListener {
-+public class DatePickerButton implements ActionListener {
- 
-     private static final Log LOGGER = LogFactory.getLog(DatePickerButton.class);
- 
--    private final DatePicker datePicker;
-+    private final DatePicker datePicker = new DatePicker();
-     private final JPanel panel = new JPanel();
-     private final FieldEditor editor;
-     private final DateTimeFormatter dateTimeFormatter;
-+    private final boolean isoFormat;
- 
- 
--    public DatePickerButton(FieldEditor pEditor, boolean useIsoFormat) {
-+    public DatePickerButton(FieldEditor pEditor, Boolean useIsoFormat) {
-+        this.isoFormat = useIsoFormat;
-         if (useIsoFormat) {
-             dateTimeFormatter = DateTimeFormatter.ISO_DATE;
-         } else {
-             dateTimeFormatter = DateTimeFormatter.ofPattern(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT));
-         }
- 
--        // Create a date picker with hidden text field (showing button only).
--        DatePickerSettings dateSettings = new DatePickerSettings();
--        dateSettings.setVisibleDateTextField(false);
--        dateSettings.setGapBeforeButtonPixels(0);
--
--        datePicker = new DatePicker(dateSettings);
--        datePicker.addDateChangeListener(this);
--        datePicker.getComponentToggleCalendarButton().setIcon(IconTheme.JabRefIcon.DATE_PICKER.getIcon());
--        datePicker.getComponentToggleCalendarButton().setText("");
--
-+        datePicker.showButtonOnly(true);
-+        datePicker.addActionListener(this);
-+        datePicker.setShowTodayButton(true);
-         panel.setLayout(new BorderLayout());
-         panel.add(datePicker, BorderLayout.WEST);
-         editor = pEditor;
-     }
- 
-     @Override
-+    public void actionPerformed(ActionEvent e) {
-+        Date date = datePicker.getDate();
-+        if (date != null) {
-+            if (isoFormat) {
-+                editor.setText(EasyDateFormat.isoDateFormat().getDateAt(date));
-+            } else {
-+                editor.setText(EasyDateFormat
-+                        .fromTimeStampFormat(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT))
-+                        .getDateAt(date));
-+            }
-+        } else {
-+            // in this case the user selected "none" in the date picker, so we just clear the field
-+            editor.setText("");
-+        }
-+
-+	// Set focus to editor component after changing its text:
-+        editor.getTextComponent().requestFocus();
-+    }
-+
-+
-+/*
-+    @Override
-     public void dateChanged(DateChangeEvent dateChangeEvent) {
-         LocalDate date = datePicker.getDate();
-         String newDate = "";
-@@ -68,6 +89,7 @@
-         // Set focus to editor component after changing its text:
-         editor.getTextComponent().requestFocus();
-     }
-+*/
- 
-     public JComponent getDatePicker() {
-         //return datePicker;
-@@ -81,8 +103,9 @@
-     public void updateDatePickerDate(String dateString) {
-         if(dateString!=null && !dateString.isEmpty()) {
-             try {
--                datePicker.setDate(LocalDate.parse(dateString, dateTimeFormatter));
--            } catch (DateTimeParseException exception) {
-+    		final Date d = Date.from(LocalDate.parse(dateString, dateTimeFormatter).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
-+                datePicker.setDate(d);
-+            } catch (Exception exception) {
-                 LOGGER.warn("Unable to parse stored date for field '"+editor.getFieldName()+"' with current settings. "
-                         + "Clear button in calender popup will not work.");
-             }
diff --git a/debian/patches/series b/debian/patches/series
index be07496..561834e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,5 +3,4 @@
 020_disable_automatic_upgrade_check.patch
 030_xjc.patch
 050_unirest_json.patch
-060_DatePickerButton.patch
 070_restore_normal_colors.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jabref.git



More information about the pkg-java-commits mailing list