branch develop updated (348b57b -> 7b1e363)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git from 348b57b Remove unused sync project new dd8b1cc Fix meta info for window build new 3ca18bd Fix alert box title new 7b1e363 Refactor task editor with saf The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 7b1e363e54a3da254be578c2d9cf6d5a8c970958 Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 14:13:13 2016 +0100 Refactor task editor with saf commit 3ca18bdea8c9f92e2a1e690d8f14f8d3eafdb6da Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 11:41:15 2016 +0100 Fix alert box title commit dd8b1ccb4a406f1cd9b9ff7922d33fb04ca9e325 Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 11:38:20 2016 +0100 Fix meta info for window build Summary of changes: pom.xml | 26 +++ .../java/org/chorem/jtimer/ui/TimerTaskEditor.java | 243 ++++++--------------- .../org/chorem/jtimer/resources/JTimer.properties | 4 +- .../jtimer/ui/resources/TimerTaskEditor.properties | 14 +- .../ui/resources/TimerTaskEditor_fr.properties | 16 +- .../ui/tasks/resources/RunTaskJob.properties | 4 +- .../ui/tasks/resources/RunTaskJob_fr.properties | 4 +- 7 files changed, 109 insertions(+), 202 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit dd8b1ccb4a406f1cd9b9ff7922d33fb04ca9e325 Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 11:38:20 2016 +0100 Fix meta info for window build --- pom.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pom.xml b/pom.xml index f2e8538..8594ace 100644 --- a/pom.xml +++ b/pom.xml @@ -358,6 +358,19 @@ <build> <plugins> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.10</version> + <executions> + <execution> + <id>parse-version</id> + <goals> + <goal>parse-version</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>com.akathist.maven.plugins.launch4j</groupId> <artifactId>launch4j-maven-plugin</artifactId> <version>1.7.8</version> @@ -376,7 +389,20 @@ <errTitle>${project.name}</errTitle> <jre> <minVersion>1.8.0</minVersion> + <maxHeapSize>100</maxHeapSize> </jre> + <versionInfo> + <fileVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.0</fileVersion> + <txtFileVersion>${project.version}</txtFileVersion> + <fileDescription>${project.description}</fileDescription> + <productName>${project.name}</productName> + <productVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.0</productVersion> + <txtProductVersion>${project.version}</txtProductVersion> + <companyName>${project.organization.name}</companyName> + <copyright>${project.inceptionYear} - 2016 ${project.organization.name}</copyright> + <internalName>jtimer</internalName> + <originalFilename>jtimer.exe</originalFilename> + </versionInfo> </configuration> </execution> </executions> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit 3ca18bdea8c9f92e2a1e690d8f14f8d3eafdb6da Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 11:41:15 2016 +0100 Fix alert box title --- .../org/chorem/jtimer/ui/tasks/resources/RunTaskJob.properties | 4 ++-- .../org/chorem/jtimer/ui/tasks/resources/RunTaskJob_fr.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob.properties b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob.properties index 5b3aaaa..8a1dc39 100644 --- a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob.properties +++ b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob.properties @@ -2,7 +2,7 @@ # #%L # jTimer # %% -# Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric +# Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -22,6 +22,6 @@ alert.alertIcon=bell48.png # messages -alert.title = Alert +alert.title = ${Application.title} - Alert alert.dailyAlertMessage = Task '%s' has reached %s for current day ! alert.totalAlertMessage = Task '%s' has reached %s ! diff --git a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob_fr.properties b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob_fr.properties index f064b7e..1ced89e 100644 --- a/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/tasks/resources/RunTaskJob_fr.properties @@ -2,7 +2,7 @@ # #%L # jTimer # %% -# Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric +# Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -20,6 +20,6 @@ # #L% ### # messages -alert.title = Alerte +alert.title = ${Application.title} - Alerte alert.dailyAlertMessage = La t\u00E2che '%s' a atteint %s pour ce jour ! alert.totalAlertMessage = La t\u00E2che '%s' a atteint %s ! -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit 7b1e363e54a3da254be578c2d9cf6d5a8c970958 Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Mar 8 14:13:13 2016 +0100 Refactor task editor with saf --- .../java/org/chorem/jtimer/ui/TimerTaskEditor.java | 243 ++++++--------------- .../org/chorem/jtimer/resources/JTimer.properties | 4 +- .../jtimer/ui/resources/TimerTaskEditor.properties | 14 +- .../ui/resources/TimerTaskEditor_fr.properties | 16 +- 4 files changed, 79 insertions(+), 198 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java b/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java index ca301fb..5a28e48 100644 --- a/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java +++ b/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java @@ -1,5 +1,5 @@ /* - * #%L +z * #%L * jTimer * %% * Copyright (C) 2008 - 2016 CodeLutin, Chorlet Stéphane, Chatellier Eric, Chemit Tony @@ -24,10 +24,9 @@ package org.chorem.jtimer.ui; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Cursor; import java.awt.FlowLayout; +import java.awt.GridLayout; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; @@ -40,10 +39,12 @@ import java.util.Set; import java.util.StringTokenizer; import javax.swing.AbstractAction; +import javax.swing.ActionMap; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSpinner; @@ -58,7 +59,6 @@ import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.JTimer; @@ -67,6 +67,7 @@ import org.chorem.jtimer.data.TimerCore; import org.chorem.jtimer.data.TimerDataManager; import org.chorem.jtimer.entities.TimerTask; import org.chorem.jtimer.entities.TimerTaskHelper; +import org.jdesktop.application.Action; import org.jdesktop.application.ApplicationContext; import org.jdesktop.application.ResourceManager; import org.jdesktop.application.ResourceMap; @@ -78,7 +79,7 @@ import org.jdesktop.swingx.calendar.DateSelectionModel; * * @author sch */ -public class TimerTaskEditor extends JDialog implements ActionListener { +public class TimerTaskEditor extends JDialog { private static final long serialVersionUID = -3612429715471081966L; /** log */ @@ -86,6 +87,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { /** I18n resources map */ protected ResourceMap resourceMap; + protected ActionMap actionMap; /** task title */ protected JTextField titleText; @@ -116,6 +118,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { /** task manager */ protected TimerDataManager dataManager; + protected boolean dataChanged; /** did the modified the title ? */ protected boolean isTitleChanged; /** did the modified annotation ? */ @@ -126,6 +129,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { * this set keep track of days modified (for time, annotations or title). */ protected Set<Date> dateChanged = new HashSet<>(); + /** * days where annotation were modified: You can modify any number of days before you apply changes, * this set keep track of days where annotations were modified. @@ -137,20 +141,6 @@ public class TimerTaskEditor extends JDialog implements ActionListener { */ protected Calendar selectedDay; - /** - * apply button: keep reference in order to be able to call setEnabled(true or false) - */ - protected JButton applyButton; - - /** - * apply and quit button: keep reference in order to be able to call setEnabled(true or false) - */ - protected JButton applyAndQuitButton; - /** - * revert button: keep reference in order to be able to call setEnabled(true or false) - */ - protected JButton revertButton; - /** * TimerTaskEditor * @@ -180,6 +170,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { ApplicationContext ctxt = application.getContext(); ResourceManager mgr = ctxt.getResourceManager(); resourceMap = mgr.getResourceMap(TimerTaskEditor.class); + actionMap = ctxt.getActionMap(this); // set title setTitle(resourceMap.getString("editor.title")); @@ -240,40 +231,18 @@ public class TimerTaskEditor extends JDialog implements ActionListener { */ protected JPanel createCommandPanel() { // apply button - applyButton = new JButton(resourceMap.getString("apply.Action.text")); - applyButton.setActionCommand("apply"); - applyButton.addActionListener(this); - applyButton.setEnabled(false); - addMnemonic("apply.Action.mnemonic", applyButton); - - // apply and quit button - /*applyAndQuitButton= new JButton(resourceMap.getString("applyAndQuit.Action.text")); - applyAndQuitButton.setActionCommand("applyAndQuit"); - applyAndQuitButton.addActionListener(this); - applyAndQuitButton.setEnabled(false); - addMnemonic("applyAndQuit.Action.mnemonic", applyAndQuitButton);*/ - - // revert button - revertButton = new JButton(resourceMap.getString("revert.Action.text")); - revertButton.setActionCommand("revert"); - revertButton.addActionListener(this); - revertButton.setEnabled(false); - addMnemonic("revert.Action.mnemonic", revertButton); + JButton applyButton = new JButton(); + applyButton.setAction(actionMap.get("apply")); // cancel button - JButton cancelButton = new JButton(resourceMap - .getString("cancel.Action.text")); - cancelButton.setActionCommand("cancel"); - cancelButton.addActionListener(this); - addMnemonic("cancel.Action.mnemonic", cancelButton); + JButton cancelButton = new JButton(); + cancelButton.setAction(actionMap.get("cancel")); // command panel JPanel panel = new JPanel(); - panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 1, 0)); - panel.add(applyButton); - //panel.add(applyAndQuitButton); - panel.add(revertButton); + panel.setLayout(new GridLayout(1, 0)); panel.add(cancelButton); + panel.add(applyButton); return panel; } @@ -307,20 +276,17 @@ public class TimerTaskEditor extends JDialog implements ActionListener { */ protected JPanel createEditionPanel() { // timetask label - JLabel spinnerLabel = new JLabel(resourceMap - .getString("label.time.text")); + JLabel spinnerLabel = new JLabel(resourceMap.getString("label.time.text")); // timetask panel JPanel spinnerPanel = createSpinnersPanel(); // annotation label - JLabel annotationLabel = new JLabel(resourceMap - .getString("label.annotation.text")); + JLabel annotationLabel = new JLabel(resourceMap.getString("label.annotation.text")); // timetask textarea annotationText = new JTextArea(); - annotationText.getDocument().addDocumentListener( - annotationChangeListener); + annotationText.getDocument().addDocumentListener(annotationChangeListener); annotationText.setRows(4); annotationText.setLineWrap(true); annotationText.setWrapStyleWord(true); @@ -380,8 +346,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { monthView.setFlaggedDayForeground(Color.BLUE); // single selection - monthView - .setSelectionMode(DateSelectionModel.SelectionMode.SINGLE_SELECTION); + monthView.setSelectionMode(DateSelectionModel.SelectionMode.SINGLE_SELECTION); // upper selectable day Calendar yesterdayCalendar = Calendar.getInstance(); @@ -494,8 +459,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { spinnerS.setValue(0); } } - - } + } updateTask(); } @@ -519,59 +483,6 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * events from command buttons - */ - @Override - public void actionPerformed(ActionEvent e) { - String actionCommand = e.getActionCommand(); - - - if ("cancel".equals(actionCommand)) { - cancel(); - - } else if ("apply".equals(actionCommand)) { - - getRootPane().setCursor( - Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - try { - apply(); - } catch(DataViolationException ex) { - // revert changes - revert(); - - // TODO display UI message - } - - getRootPane().setCursor( - Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - - } else if ("applyAndQuit".equals(actionCommand)) { - - getRootPane().setCursor( - Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - try { - apply(); - } catch(DataViolationException ex) { - // revert changes - revert(); - - // TODO display UI message - } - - getRootPane().setCursor( - Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - - // quit editor - cancel(); - - } else if ("revert".equals(actionCommand)) { - revert(); - } - } - - /** * Monthview selected day. * * @return monthview selected day @@ -697,9 +608,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } dateChanged.add(getSelectedDay().getTime()); - applyButton.setEnabled(true); - applyAndQuitButton.setEnabled(true); - revertButton.setEnabled(true); + setDataChanged(true); updateFlaggedDates(); } @@ -708,7 +617,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { * flag calendar days according to tasktime */ public void updateFlaggedDates() { - ArrayList<Date> dates = new ArrayList<>(); + List<Date> dates = new ArrayList<>(); for (Date date : cloneTask.getAllDaysAndTimes().keySet()) { if (cloneTask.getTime(date) > 0) { @@ -721,75 +630,63 @@ public class TimerTaskEditor extends JDialog implements ActionListener { monthView.setFlaggedDates(dates.toArray(new Date[dates.size()])); } - protected void revert() { - cloneTask = task.clone(); - - dateChanged.clear(); - annotationChanged.clear(); - applyButton.setEnabled(false); - applyAndQuitButton.setEnabled(false); - revertButton.setEnabled(false); - isTitleChanged = false; - isAnnotationChanged = false; - - displayTask(getSelectedDay().getTime()); - updateFlaggedDates(); - } - - protected void apply() { + @Action(enabledProperty = "dataChanged") + public void apply() { - // title - if (isTitleChanged) { - dataManager.editTask(task, cloneTask.getName()); - } - - for (Date date : dateChanged) { - if (log.isDebugEnabled()) { - log.debug("Applying changes on: " + date); + try { + // title + if (isTitleChanged) { + dataManager.editTask(task, cloneTask.getName()); } - - // time - dataManager.changeTaskTime(task, date, cloneTask - .getTime(date)); - - // annotation - if (annotationChanged.contains(date)) { - TimerTaskHelper.removeAnnotation(task, date); - - Map<Date, String> annotations = TimerTaskHelper - .getAnnotationMap(cloneTask, date); - for (Date date2 : annotations.keySet()) { - dataManager.addAnnotation(task, date2, - annotations.get(date2)); + + for (Date date : dateChanged) { + if (log.isDebugEnabled()) { + log.debug("Applying changes on: " + date); + } + + // time + dataManager.changeTaskTime(task, date, cloneTask + .getTime(date)); + + // annotation + if (annotationChanged.contains(date)) { + TimerTaskHelper.removeAnnotation(task, date); + + Map<Date, String> annotations = TimerTaskHelper + .getAnnotationMap(cloneTask, date); + for (Date date2 : annotations.keySet()) { + dataManager.addAnnotation(task, date2, + annotations.get(date2)); + } } } + + /*dateChanged.clear(); + annotationChanged.clear(); + setDataChanged(false); + isTitleChanged = false; + isAnnotationChanged = false;*/ + } catch (DataViolationException ex) { + String title = resourceMap.getString("vetoException.title"); + String message = resourceMap.getString("vetoException.message"); + JOptionPane.showMessageDialog(this, message, title, JOptionPane.ERROR_MESSAGE); + } finally { + dispose(); } - - dateChanged.clear(); - annotationChanged.clear(); - applyButton.setEnabled(false); - applyAndQuitButton.setEnabled(false); - revertButton.setEnabled(false); - isTitleChanged = false; - isAnnotationChanged = false; } - protected void cancel() { + @Action + public void cancel() { dispose(); } - /** - * To add a mnemonic from a i18n key. - * - * @param key the i18n key of the mnemonic - * @param button button where to add mnemonic - * @since 1.4.3 - */ - protected void addMnemonic(String key, JButton button) { - String string = resourceMap.getString(key); - if (StringUtils.isNotBlank(string)) { + public boolean isDataChanged() { + return dataChanged; + } - button.setMnemonic(string.charAt(0)); - } + public void setDataChanged(boolean dataChanged) { + boolean oldValue = this.dataChanged; + this.dataChanged = dataChanged; + firePropertyChange("dataChanged", oldValue, dataChanged); } } diff --git a/src/main/resources/org/chorem/jtimer/resources/JTimer.properties b/src/main/resources/org/chorem/jtimer/resources/JTimer.properties index ea8bf2e..9c25f8f 100644 --- a/src/main/resources/org/chorem/jtimer/resources/JTimer.properties +++ b/src/main/resources/org/chorem/jtimer/resources/JTimer.properties @@ -182,8 +182,8 @@ vetoable.common.duplicated.project.name=A project already exists with that name vetoable.common.duplicated.task.name=A task already exists with that name at this level ! vetoable.common.merge.invalid.types=Can't merge project and task ! vetoable.common.move.invalid.types=Can't move project ! -vetoable.saver.empty.task.name=Empty task name ! -vetoable.saver.invalid.task.characters=Task name contains invalid characters ! +vetoable.saver.empty.name=Empty task name ! +vetoable.saver.invalid.characters=Task name contains invalid characters ! vetoable.ws.chorem.cant.modify.synchronized.project=Can't do this action on a synchronized project ! # Start fail i18n diff --git a/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor.properties b/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor.properties index 0ebe795..74ab915 100644 --- a/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor.properties +++ b/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor.properties @@ -2,7 +2,7 @@ # #%L # jTimer # %% -# Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric, Chemit Tony +# Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric, Chemit Tony # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -25,18 +25,10 @@ apply.Action.text = Apply apply.Action.mnemonic = A apply.Action.shortDescription = Apply changes -applyAndQuit.Action.text = Apply And Quit -applyAndQuit.Action.mnemonic = p -applyAndQuit.Action.shortDescription = Apply changes and quit - -cancel.Action.text = Quit -cancel.Action.mnemonic = Q +cancel.Action.text = Cancel +cancel.Action.mnemonic = C cancel.Action.shortDescription = Revert changes and quit -revert.Action.text = Revert -revert.Action.mnemonic= R -revert.Action.shortDescription = Revert changes - label.time.text = Time: label.annotation.text = Annotation: diff --git a/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor_fr.properties b/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor_fr.properties index e14f8ac..082dac0 100644 --- a/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/resources/TimerTaskEditor_fr.properties @@ -2,7 +2,7 @@ # #%L # jTimer # %% -# Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric, Chemit Tony +# Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric, Chemit Tony # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as @@ -21,22 +21,14 @@ ### editor.title = \u00C9dition de la t\u00E2che -apply.Action.text = Appliquer -apply.Action.mnemonic = A +apply.Action.text = Valider +apply.Action.mnemonic = V apply.Action.shortDescription = Appliquer les changements -applyAndQuit.Action.text = Appliquer et quitter -applyAndQuit.Action.mnemonic = e -applyAndQuit.Action.shortDescription = Appliquer les changements et quitter - -cancel.Action.text = Quitter +cancel.Action.text = Annuler cancel.Action.mnemonic= Q cancel.Action.shortDescription = Annuler et quitter -revert.Action.text = Annuler -revert.Action.mnemonic= n -revert.Action.shortDescription = Annuler les changements - label.time.text = Temps: label.annotation.text = Note: -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm