Jtimer-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 639 discussions
r2814 - in trunk/src/main/java/org/chorem/jtimer: data entities io ui ui/report/tree ui/systray ui/treetable ws/xmlrpc
by echatellier@users.chorem.org 09 Mar '12
by echatellier@users.chorem.org 09 Mar '12
09 Mar '12
Author: echatellier
Date: 2012-03-09 15:52:09 +0100 (Fri, 09 Mar 2012)
New Revision: 2814
Url: http://chorem.org/repositories/revision/jtimer/2814
Log:
#78 : Renaming a task break tasks tree rendering
Modified:
trunk/src/main/java/org/chorem/jtimer/data/DataEventListener.java
trunk/src/main/java/org/chorem/jtimer/data/TimerDataManager.java
trunk/src/main/java/org/chorem/jtimer/entities/TimerObject.java
trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java
trunk/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java
trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java
trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java
trunk/src/main/java/org/chorem/jtimer/ui/report/tree/CheckBoxTreeModel.java
trunk/src/main/java/org/chorem/jtimer/ui/systray/SystrayManager.java
trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksCellRenderer.java
trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java
trunk/src/main/java/org/chorem/jtimer/ws/xmlrpc/ChoremXMLRPCClient.java
Modified: trunk/src/main/java/org/chorem/jtimer/data/DataEventListener.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/data/DataEventListener.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/data/DataEventListener.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -70,26 +70,8 @@
* @param task modified task
*/
public void modifyTask(TimerTask task);
-
- /**
- * Before delete project.
- *
- * TODO only usefull for UI (can't known on to delete if already deleted)
- *
- * @param project deleted project
- */
- public void preDeleteProject(TimerProject project);
/**
- * Before delete task.
- *
- * TODO only usefull for UI (can't known on to delete if already deleted)
- *
- * @param task deleted task
- */
- public void preDeleteTask(TimerTask task);
-
- /**
* Delete project.
*
* @param project deleted project
Modified: trunk/src/main/java/org/chorem/jtimer/data/TimerDataManager.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/data/TimerDataManager.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/data/TimerDataManager.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -243,18 +243,11 @@
vetoableDataEventListener.checkDeleteTask(task);
}
- // send notification (before)
- Iterator<DataEventListener> itDataEventListener = dataEventListeners
- .iterator();
- while (itDataEventListener.hasNext()) {
- itDataEventListener.next().preDeleteTask(task);
- }
-
// task deletion
task.getParent().getSubTasks().remove(task);
// send notification
- itDataEventListener = dataEventListeners.iterator();
+ Iterator<DataEventListener> itDataEventListener = dataEventListeners.iterator();
while (itDataEventListener.hasNext()) {
itDataEventListener.next().deleteTask(task);
}
@@ -272,17 +265,10 @@
vetoableDataEventListener.checkDeleteProject(project);
}
- // send notification (before)
- Iterator<DataEventListener> itDataEventListener = dataEventListeners
- .iterator();
- while (itDataEventListener.hasNext()) {
- itDataEventListener.next().preDeleteProject(project);
- }
-
projectList.remove(project);
// send notification
- itDataEventListener = dataEventListeners.iterator();
+ Iterator<DataEventListener> itDataEventListener = dataEventListeners.iterator();
while (itDataEventListener.hasNext()) {
itDataEventListener.next().deleteProject(project);
}
Modified: trunk/src/main/java/org/chorem/jtimer/entities/TimerObject.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/entities/TimerObject.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/entities/TimerObject.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2012 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
Modified: trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
+import java.util.UUID;
import org.apache.commons.lang3.SerializationUtils;
import org.chorem.jtimer.utils.DailySortedMap;
@@ -64,6 +65,9 @@
public static final String PROPERTY_SUB_TASKS = "subTasks";
public static final String PROPERTY_ALERTS = "alerts";
+ /** Task uuid used to managed task equality. */
+ protected String uuid = UUID.randomUUID().toString();
+
/** Task number. */
protected int number;
@@ -369,23 +373,12 @@
/*
* @see java.lang.Object#hashCode()
- *
- * TODO must be added, but cause some errors on tree cell renderer.
- *
+ */
@Override
public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((alerts == null) ? 0 : alerts.hashCode());
- result = prime * result + ((allDaysAndTimes == null) ? 0 : allDaysAndTimes.hashCode());
- result = prime * result + ((allDaysAnnotations == null) ? 0 : allDaysAnnotations.hashCode());
- result = prime * result + (closed ? 1231 : 1237);
- result = prime * result + ((creationDate == null) ? 0 : creationDate.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + number;
- result = prime * result + ((subTasks == null) ? 0 : subTasks.hashCode());
+ int result = uuid.hashCode();
return result;
- }*/
+ }
/*
* @see java.lang.Object#equals(java.lang.Object)
@@ -397,21 +390,7 @@
return false;
}
- TimerTask otherTask = (TimerTask) o;
-
- // name equals
- boolean equals = name != null && name.equals(otherTask.name);
- // creation date equals
- equals &= creationDate == null
- || creationDate.equals(otherTask.creationDate);
- // subtask equals
- equals &= subTasks.equals(otherTask.subTasks);
- // compare times
- equals &= allDaysTimes.equals(otherTask.allDaysTimes);
- // compare times
- equals &= allDaysAnnotations.equals(otherTask.allDaysAnnotations);
-
- return equals;
+ return uuid.equals(((TimerTask)o).uuid);
}
/**
Modified: trunk/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -55,33 +55,47 @@
}
/**
+ * Timer task comparator.
+ */
+ protected static Comparator<TimerTask> timerTaskComparator = new Comparator<TimerTask>() {
+ public int compare(TimerTask o1, TimerTask o2) {
+ if (o1 == null && o2 == null) {
+ return 0;
+ }
+ if (o1 == null) {
+ return 1;
+ }
+ if (o2 == null) {
+ return -1;
+ }
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
+
+ /**
* Get task's subtasks ordered alphabetically.
*
* @param task task
* @return the subTasks ordered
+ * @deprecated since 1.4.0 use {@link #sortTask(task.getSubTasks())}
*/
public static List<TimerTask> getSubTasksOrderedByName(TimerTask task) {
List<TimerTask> taksToSort = task.getSubTasks();
- List<TimerTask> subTasksCopy = new ArrayList<TimerTask>(taksToSort);
- Comparator<TimerTask> c = new Comparator<TimerTask>() {
- public int compare(TimerTask o1, TimerTask o2) {
- if (o1 == null && o2 == null) {
- return 0;
- }
- if (o1 == null) {
- return 1;
- }
- if (o2 == null) {
- return -1;
- }
- return o1.getName().compareTo(o2.getName());
- }
- };
- Collections.sort(subTasksCopy, c);
- return subTasksCopy;
+ return sortTask(taksToSort);
}
/**
+ * Get tasks ordered alphabetically.
+ *
+ * @param tasks tasks
+ * @return {@code tasks}
+ */
+ public static List<TimerTask> sortTask(List<TimerTask> tasks) {
+ Collections.sort(tasks, timerTaskComparator);
+ return tasks;
+ }
+
+ /**
* Get total task time without subtasks time.
*
* @param task task to get time
Modified: trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -1214,22 +1214,6 @@
}
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
-
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
-
- }
-
- /*
* @see org.chorem.jtimer.data.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
Modified: trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -151,22 +151,6 @@
}
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
-
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
-
- }
-
- /*
* @see org.chorem.jtimer.data.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
Modified: trunk/src/main/java/org/chorem/jtimer/ui/report/tree/CheckBoxTreeModel.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/report/tree/CheckBoxTreeModel.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ui/report/tree/CheckBoxTreeModel.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2009 - 2012 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
@@ -126,16 +126,12 @@
result.addAll(core.getData().getProjectsList());
} else { // not root node
TimerTask task = (TimerTask) parent;
-
- // Since sort is not supported by the table, do a manual sorting.
- //result.addAll(t.getSubTasks());
- result.addAll(TimerTaskHelper.getSubTasksOrderedByName(task));
+ result.addAll(task.getSubTasks());
}
// filter list, if only show closed
if (!showClosed) {
CollectionUtils.filter(result, new Predicate() {
-
@Override
public boolean evaluate(Object object) {
@@ -146,10 +142,12 @@
}
return result;
}
-
});
}
+ // Since sort is not supported by the table, do a manual sorting.
+ result = TimerTaskHelper.sortTask(result);
+
return result;
}
Modified: trunk/src/main/java/org/chorem/jtimer/ui/systray/SystrayManager.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/systray/SystrayManager.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ui/systray/SystrayManager.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -222,22 +222,6 @@
}
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
-
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
-
- }
-
- /*
* @see org.chorem.jtimer.data.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
Modified: trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksCellRenderer.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksCellRenderer.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksCellRenderer.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -202,22 +202,6 @@
}
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
-
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
-
- }
-
- /*
* @see org.chorem.jtimer.data.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
Modified: trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -28,7 +28,9 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.swing.SwingUtilities;
import javax.swing.table.TableColumn;
@@ -45,7 +47,6 @@
import org.chorem.jtimer.entities.TimerProject;
import org.chorem.jtimer.entities.TimerTask;
import org.chorem.jtimer.entities.TimerTaskHelper;
-import org.jdesktop.swingx.tree.TreeModelSupport;
import org.jdesktop.swingx.treetable.AbstractTreeTableModel;
/**
@@ -54,6 +55,18 @@
* Cela permet au programme principal de manipuler la liste et d'oublier la
* gestion de l'arbre...
*
+ * Le modele de cet arbre utilise directement des TimerTask au lieu des TreeTableNode
+ * qui ne servent a rien et qui complique tout. Par contre, les tâches étant
+ * les mêmes instances que celle manipulées par le programme, il doit mettre
+ * en cache certains infos pour un rafraichissement correct:
+ * <ul>
+ * <li>Nom : cas de renommage avec changement d'ordre
+ * <li>Sous tache : pour supprimer une tache qui disparaitrait directement du modèle
+ * </ul>
+ *
+ * Voir cet article pour la non utilisation des TreeNode :
+ * http://www.javalobby.org/forums/thread.jspa?threadID=16052&tstart=0
+ *
* @author chatellier
* @version $Revision$
*
@@ -66,14 +79,14 @@
/** log */
private static Log log = LogFactory.getLog(ProjectsAndTasksModel.class);
- /** Add node operation */
+ /** Add node operation. */
public static final int OPERATION_ADD = 0;
- /** Modify node operation */
+ /** Modify node operation. */
public static final int OPERATION_MODIFY = 1;
- /** Delete Node operation */
+ /** Delete Node operation. */
public static final int OPERATION_DELETE = 2;
- /** Tree managed by this model */
+ /** Tree managed by this model. */
protected ProjectsAndTasksTable projectsAndTaskTable;
/** Data. */
@@ -81,10 +94,13 @@
/** Tree column identifiers. */
protected List<String> columnIdentifiers;
-
+
/** Show closed task property. Default to false. */
protected boolean showClosedTask;
+ protected Map<TimerTask, String> taskNameCache;
+ protected Map<Object, List<TimerTask>> subTasksCache;
+
/**
* Constructor.
*
@@ -94,24 +110,17 @@
*/
public ProjectsAndTasksModel(ProjectsAndTasksTable projectsAndTaskTable,
TimerCore core, List<String> columnIdentifiers) {
- // super with root node
super(new TimerProject("root"));
// remember
this.projectsAndTaskTable = projectsAndTaskTable;
this.dataManager = core.getData();
this.columnIdentifiers = columnIdentifiers;
+
+ taskNameCache = new HashMap<TimerTask, String>();
+ subTasksCache = new HashMap<Object, List<TimerTask>>();
}
- /**
- * Accessor to tree model support.
- *
- * @return tree model support
- */
- protected TreeModelSupport getModelSupport() {
- return modelSupport;
- }
-
/*
* @see org.jdesktop.swingx.treetable.TreeTableModel#getColumnCount()
*/
@@ -178,8 +187,8 @@
*/
@Override
public Object getChild(Object parent, int index) {
+
TimerTask t = getFiteredSubListFor(parent).get(index);
-
return t;
}
@@ -190,48 +199,69 @@
public int getChildCount(Object parent) {
int childCount = getFiteredSubListFor(parent).size();
-
return childCount;
}
/**
* Recupere la sous liste: data.getProjectsList() si parent = root
- * getSubTasks() sinon
+ * getSubTasks() sinon (cache results).
*
* @param parent parent to task sublist
* @return filtered list
*/
protected List<TimerTask> getFiteredSubListFor(Object parent) {
+ return getFiteredSubListFor(parent, false);
+ }
- List<TimerTask> result = new ArrayList<TimerTask>();
+ /**
+ * Recupere la sous liste: data.getProjectsList() si parent = root
+ * getSubTasks() sinon.
+ *
+ * @param parent parent to task sublist
+ * @param noCache disable use of cached result and result caching
+ * @return filtered list
+ */
+ protected List<TimerTask> getFiteredSubListFor(Object parent, boolean noCache) {
- // get correct list
- if (parent == root) { // case root node
- result.addAll(dataManager.getProjectsList());
- } else { // not root node
- TimerTask task = (TimerTask) parent;
+ List<TimerTask> result = subTasksCache.get(parent);
+ if (result == null || noCache) {
+ result = new ArrayList<TimerTask>();
- // Since sort is not supported by the table, do a manual sorting.
- //result.addAll(t.getSubTasks());
- result.addAll(TimerTaskHelper.getSubTasksOrderedByName(task));
- }
+ // get correct list
+ if (parent == root) { // case root node
+ List<TimerProject> projects = dataManager.getProjectsList();
+ result.addAll(projects);
+ } else { // not root node
+ TimerTask task = (TimerTask) parent;
+ result.addAll(task.getSubTasks());
+ }
- // filter list, if only show closed
- if (!showClosedTask) {
- CollectionUtils.filter(result, new Predicate() {
+ // filter list, if only show closed
+ if (!showClosedTask) {
+ CollectionUtils.filter(result, new Predicate() {
+ @Override
+ public boolean evaluate(Object object) {
+ boolean result = false;
+ if (object instanceof TimerTask) {
+ TimerTask task = (TimerTask) object;
+ result = !task.isClosed();
+ }
+ return result;
+ }
+ });
+ }
- @Override
- public boolean evaluate(Object object) {
-
- boolean result = false;
- if (object instanceof TimerTask) {
- TimerTask task = (TimerTask) object;
- result = !task.isClosed();
- }
- return result;
+ // Since sort is not supported by the table, do a manual sorting.
+ result = TimerTaskHelper.sortTask(result);
+
+ if (!noCache) {
+ // cache tasks name
+ for (TimerTask task : result) {
+ taskNameCache.put(task, task.getName());
}
-
- });
+
+ subTasksCache.put(parent, result);
+ }
}
return result;
@@ -244,7 +274,6 @@
public int getIndexOfChild(Object parent, Object child) {
int childIndex = getFiteredSubListFor(parent).indexOf(child);
-
return childIndex;
}
@@ -265,7 +294,6 @@
protected void notifyTaskChanged(TimerTask task, int operation) {
// this.modelSupport.
TreePath path = new TreePath(root);
-
updateChildren(task, path, operation);
}
@@ -277,56 +305,66 @@
* @param operation operation (add, modify, delete)
* @return <tt>true</tt> if children have been found and updated in current recursion
*/
- protected boolean updateChildren(TimerTask task, TreePath path,
+ protected synchronized boolean updateChildren(TimerTask task, TreePath path,
int operation) {
TimerTask pathLastComponent = (TimerTask) path.getLastPathComponent();
- // pour ses enfants
boolean updated = false;
- int childCount = getChildCount(pathLastComponent);
+ // get childreen without cache in case of add operation
+ // delete operation MUST use cached result
+ List<TimerTask> subTask = getFiteredSubListFor(pathLastComponent, operation == OPERATION_ADD);
+ int childCount = subTask.size();
for (int childIndex = 0; !updated && childIndex < childCount; ++childIndex) {
- TimerTask taskUO = (TimerTask) getChild(pathLastComponent,
- childIndex);
+ TimerTask taskUO = (TimerTask) subTask.get(childIndex);
- TreePath childTreePath = path.pathByAddingChild(taskUO);
-
if (task.equals(taskUO)) {
// this update only node, not all path...
switch (operation) {
- case OPERATION_ADD:
- getModelSupport().fireChildAdded(path, childIndex, taskUO);
+ case OPERATION_ADD: {
+ subTasksCache.remove(pathLastComponent); // force child recache
+ int newIndex = getIndexOfChild(pathLastComponent, taskUO);
+ modelSupport.fireChildAdded(path, newIndex, taskUO);
// expand path
projectsAndTaskTable.expandPath(path);
break;
-
- case OPERATION_DELETE:
- getModelSupport()
- .fireChildRemoved(path, childIndex, taskUO);
+ }
+ case OPERATION_DELETE: {
+ subTasksCache.remove(pathLastComponent); // invalidate cache
+ subTasksCache.remove(taskUO); // no in cache anymore
+ taskNameCache.remove(taskUO); // no in cache anymore
+ modelSupport.fireChildRemoved(path, childIndex, taskUO);
break;
-
- case OPERATION_MODIFY:
- getModelSupport()
- .fireChildChanged(path, childIndex, taskUO);
+ }
+ case OPERATION_MODIFY: {
+ String cacheName = taskNameCache.get(taskUO);
+ if (cacheName.equals(task.getName())) {
+ // not name modification (time...)
+ modelSupport.fireChildChanged(path, childIndex, taskUO);
+ } else {
+ // name modification (order can change)
+ modelSupport.fireChildRemoved(path, childIndex, taskUO);
+ subTasksCache.remove(pathLastComponent); // force child recache
+ int newIndex = getIndexOfChild(pathLastComponent, taskUO);
+ modelSupport.fireChildAdded(path, newIndex, taskUO);
+ }
break;
-
+ }
default:
if (log.isErrorEnabled()) {
log.error("Unknow operation : " + operation);
}
}
- if (log.isTraceEnabled()) {
- log.trace(" updated : " + childTreePath);
- }
updated = true;
} else {
+ TreePath childTreePath = path.pathByAddingChild(taskUO);
updated = updateChildren(task, childTreePath, operation);
if (updated) {
// ...and by recursion update all path
- getModelSupport().firePathChanged(path);
+ modelSupport.firePathChanged(path);
}
}
}
@@ -362,9 +400,12 @@
tcs.add(tc);
}
+ taskNameCache.clear();
+ subTasksCache.clear();
+
// works but it's not beautiful
// and header are resized
- getModelSupport().fireNewRoot();
+ modelSupport.fireNewRoot();
// hack, restore size after
SwingUtilities.invokeLater(new Runnable() {
@@ -377,29 +418,12 @@
});
}
-
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
- notifyTaskChanged(project, OPERATION_DELETE);
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
- notifyTaskChanged(task, OPERATION_DELETE);
- }
-
- /*
* @see org.chorem.jtimer.data.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
public void deleteProject(TimerProject project) {
-
+ notifyTaskChanged(project, OPERATION_DELETE);
}
/*
@@ -407,7 +431,7 @@
*/
@Override
public void deleteTask(TimerTask task) {
-
+ notifyTaskChanged(task, OPERATION_DELETE);
}
/*
@@ -501,8 +525,8 @@
*/
public void setShowClosed(boolean showClosedTask) {
this.showClosedTask = showClosedTask;
- // TODO add better diff code
- getModelSupport().fireNewRoot();
+ // TODO echatellier 20120309 add better diff code
+ dataLoaded(null);
}
/*
Modified: trunk/src/main/java/org/chorem/jtimer/ws/xmlrpc/ChoremXMLRPCClient.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ws/xmlrpc/ChoremXMLRPCClient.java 2012-03-09 14:46:31 UTC (rev 2813)
+++ trunk/src/main/java/org/chorem/jtimer/ws/xmlrpc/ChoremXMLRPCClient.java 2012-03-09 14:52:09 UTC (rev 2814)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -735,22 +735,6 @@
}
/*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteProject(org.chorem.jtimer.entities.TimerProject)
- */
- @Override
- public void preDeleteProject(TimerProject project) {
-
- }
-
- /*
- * @see org.chorem.jtimer.data.DataEventListener#preDeleteTask(org.chorem.jtimer.entities.TimerTask)
- */
- @Override
- public void preDeleteTask(TimerTask task) {
-
- }
-
- /*
* @see org.chorem.jtimer.event.DataEventListener#deleteProject(org.chorem.jtimer.entities.TimerProject)
*/
@Override
1
0
Author: echatellier
Date: 2012-03-09 15:46:31 +0100 (Fri, 09 Mar 2012)
New Revision: 2813
Url: http://chorem.org/repositories/revision/jtimer/2813
Log:
#483 : Delete running task still tacking time
Modified:
trunk/src/main/java/org/chorem/jtimer/JTimer.java
Modified: trunk/src/main/java/org/chorem/jtimer/JTimer.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-03-07 17:24:20 UTC (rev 2812)
+++ trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-03-09 14:46:31 UTC (rev 2813)
@@ -680,6 +680,7 @@
* Stop a task.
*
* Delegate method. Called by idle detect ?
+ * Called by delete method too.
*
* @param task task to stop
*/
@@ -687,13 +688,14 @@
RunTaskJob rtt = getJobForRunningTask(task);
// test if task is already running
- // should never be call if null !!!
- rtt.wantToStop();
- core.getData().stopTask(task);
-
- // re-enable/disable buttons
- setSelectedSingleRunningTask(false);
- setSelectedSingleStoppedTask(true);
+ if (rtt != null) {
+ rtt.wantToStop();
+ core.getData().stopTask(task);
+
+ // re-enable/disable buttons
+ setSelectedSingleRunningTask(false);
+ setSelectedSingleStoppedTask(true);
+ }
}
/**
@@ -774,6 +776,7 @@
if (confirm == JOptionPane.YES_OPTION) { // approved
try {
+ stopTask(task);
core.getData().deleteTask(task);
} catch (DataViolationException e) {
displayErrorMessage(e.getExceptionKey());
1
0
r2812 - in trunk/src: main/java/org/chorem/jtimer/ui main/java/org/chorem/jtimer/ui/tasks test/java/org/chorem/jtimer/io
by echatellier@users.chorem.org 07 Mar '12
by echatellier@users.chorem.org 07 Mar '12
07 Mar '12
Author: echatellier
Date: 2012-03-07 18:24:20 +0100 (Wed, 07 Mar 2012)
New Revision: 2812
Url: http://chorem.org/repositories/revision/jtimer/2812
Log:
Fix import/unused code
Modified:
trunk/src/main/java/org/chorem/jtimer/ui/HelpFrame.java
trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
trunk/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java
Modified: trunk/src/main/java/org/chorem/jtimer/ui/HelpFrame.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/HelpFrame.java 2012-03-07 17:21:15 UTC (rev 2811)
+++ trunk/src/main/java/org/chorem/jtimer/ui/HelpFrame.java 2012-03-07 17:24:20 UTC (rev 2812)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2008 - 2012 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
@@ -62,9 +62,6 @@
*/
public class HelpFrame extends FrameView implements HyperlinkListener {
- /** serialVersionUID */
- private static final long serialVersionUID = -8693584537185015506L;
-
/** log */
private static Log log = LogFactory.getLog(HelpFrame.class);
Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:21:15 UTC (rev 2811)
+++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:24:20 UTC (rev 2812)
@@ -38,7 +38,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.JTimer;
-import org.chorem.jtimer.JTimerFactory;
import org.chorem.jtimer.data.TimerDataManager;
import org.chorem.jtimer.entities.TimerAlert;
import org.chorem.jtimer.entities.TimerTask;
Modified: trunk/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java
===================================================================
--- trunk/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java 2012-03-07 17:21:15 UTC (rev 2811)
+++ trunk/src/test/java/org/chorem/jtimer/io/GTimerIncrementalSaverTest.java 2012-03-07 17:24:20 UTC (rev 2812)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2008 - 2012 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
@@ -35,8 +35,6 @@
import java.util.SortedMap;
import java.util.TreeMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.AbstractJTimerTest;
import org.chorem.jtimer.entities.TimerAlert;
import org.chorem.jtimer.entities.TimerProject;
@@ -56,9 +54,6 @@
*/
public class GTimerIncrementalSaverTest extends AbstractJTimerTest {
- /** Class log */
- private static Log log = LogFactory.getLog(GTimerIncrementalSaverTest.class);
-
/**
* Test que saveDirectory a une valeur attendue.
*/
1
0
r2811 - in trunk/src/main/java/org/chorem/jtimer: . ui/tasks
by echatellier@users.chorem.org 07 Mar '12
by echatellier@users.chorem.org 07 Mar '12
07 Mar '12
Author: echatellier
Date: 2012-03-07 18:21:15 +0100 (Wed, 07 Mar 2012)
New Revision: 2811
Url: http://chorem.org/repositories/revision/jtimer/2811
Log:
Fix seconds/ms convertion
Modified:
trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java
trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
Modified: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 17:11:12 UTC (rev 2810)
+++ trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 17:21:15 UTC (rev 2811)
@@ -1,25 +1,23 @@
/*
* #%L
- *
- *
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2012 Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
+ * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
@@ -91,11 +89,21 @@
public String getIOSaverDirectory() {
return appConfig.getOption(JTimerOption.IO_SAVER_DIRECTORY.key);
}
-
+
+ /**
+ * Return auto save delay in seconds.
+ *
+ * @return auto save delay
+ */
public long getIOSaverAutoSaveDelay() {
return appConfig.getOptionAsLong(JTimerOption.IO_SAVER_AUTOSAVEDELAY.key);
}
+ /**
+ * Return user idle time threshold in seconds.
+ *
+ * @return idle time threshold
+ */
public long getIdleTime() {
return appConfig.getOptionAsLong(JTimerOption.UI_IDLE_TIME.key);
}
Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-03-07 17:11:12 UTC (rev 2810)
+++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-03-07 17:21:15 UTC (rev 2811)
@@ -160,7 +160,7 @@
// label
JLabel idleLabel = new JLabel(resourceMap.getString("idleMessage", Long
- .valueOf(JTimer.config.getIdleTime() / (60 * 1000))));
+ .valueOf(JTimer.config.getIdleTime() / (60))));
mainComponent.add(idleLabel, new GridBagConstraints(1, 0, 3, 1, 1, 0,
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 0, 0, 3), 0, 0));
Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:11:12 UTC (rev 2810)
+++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 17:21:15 UTC (rev 2811)
@@ -247,7 +247,7 @@
resetTiming();
// get idle time
- long configIdleTime = JTimer.config.getIdleTime();
+ long configIdleTime = JTimer.config.getIdleTime() * 1000;
boolean dontWantToStop = true;
while (dontWantToStop) {
@@ -279,7 +279,7 @@
checkReset();
// if long idleTime is unavailable, if is always false
- if (idleTime >= JTimer.config.getIdleTime()) {
+ if (idleTime >= configIdleTime) {
// to not display negative time near midnight
long idleTimeOffset = Math.min(idleTime, currentTime - taskStartCalendar.getTimeInMillis());
1
0
Author: echatellier
Date: 2012-03-07 18:11:12 +0100 (Wed, 07 Mar 2012)
New Revision: 2810
Url: http://chorem.org/repositories/revision/jtimer/2810
Log:
Fix config file migration (from user home, not /etc)
Modified:
trunk/src/main/java/org/chorem/jtimer/JTimer.java
Modified: trunk/src/main/java/org/chorem/jtimer/JTimer.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-03-07 16:49:27 UTC (rev 2809)
+++ trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-03-07 17:11:12 UTC (rev 2810)
@@ -206,7 +206,7 @@
// add file migration for configuration file created before version 1.4
File homeDir = new File(System.getProperty("user.home"), ".jtimer");
File oldFile = new File(homeDir, "JTimer.properties");
- File newFile = new File(config.appConfig.getConfigPath(), config.appConfig.getConfigFileName());
+ File newFile = new File(config.appConfig.getUserConfigDirectory(), config.appConfig.getConfigFileName());
if (oldFile.isFile() && !newFile.isFile()) {
if (log.isInfoEnabled()) {
log.info("Migration configuration file location");
1
0
r2809 - in trunk/src: main/java/org/chorem/jtimer test/java/org/chorem/jtimer
by echatellier@users.chorem.org 07 Mar '12
by echatellier@users.chorem.org 07 Mar '12
07 Mar '12
Author: echatellier
Date: 2012-03-07 17:49:27 +0100 (Wed, 07 Mar 2012)
New Revision: 2809
Url: http://chorem.org/repositories/revision/jtimer/2809
Log:
Fix configuration test
Modified:
trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java
Modified: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 16:46:58 UTC (rev 2808)
+++ trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 16:49:27 UTC (rev 2809)
@@ -67,7 +67,7 @@
public Class getServiceClass() {
Class serviceClass = null;
try {
- appConfig.getOptionAsClass(JTimerOption.SERVICE_CLASS.key);
+ serviceClass = appConfig.getOptionAsClass(JTimerOption.SERVICE_CLASS.key);
} catch (Exception ex) {
if (log.isWarnEnabled()) {
log.warn("Can't find service class implementation, sync will not work", ex);
Modified: trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java
===================================================================
--- trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-03-07 16:46:58 UTC (rev 2808)
+++ trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-03-07 16:49:27 UTC (rev 2809)
@@ -27,7 +27,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.jtimer.JTimerConfig.JTimerOption;
import org.chorem.jtimer.io.GTimerIncrementalSaver;
import org.chorem.jtimer.io.Saver;
import org.chorem.jtimer.ws.ProjectManagement;
1
0
Author: echatellier
Date: 2012-03-07 17:46:58 +0100 (Wed, 07 Mar 2012)
New Revision: 2808
Url: http://chorem.org/repositories/revision/jtimer/2808
Log:
#250: Udpate to testng 6.4
#482: Update to freemarker 2.3.19
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-07 16:41:22 UTC (rev 2807)
+++ trunk/pom.xml 2012-03-07 16:46:58 UTC (rev 2808)
@@ -257,7 +257,7 @@
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
- <version>2.3.18</version>
+ <version>2.3.19</version>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
@@ -307,7 +307,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>6.3.1</version>
+ <version>6.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
1
0
Author: echatellier
Date: 2012-03-07 17:41:22 +0100 (Wed, 07 Mar 2012)
New Revision: 2807
Url: http://chorem.org/repositories/revision/jtimer/2807
Log:
Modify svn:ignore
Modified:
trunk/
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- target
.settings
.project
.classpath
JTimer.properties
THIRD-PARTY.txt
*testng*.xml
*.ipr
*.iws
*.iml
+ target
.settings
.project
.classpath
*.properties
*testng*.xml
*.ipr
*.iws
*.iml
Deleted: svn:mergeinfo
- /branches/1.3.x:2624-2628
1
0
07 Mar '12
Author: echatellier
Date: 2012-03-07 17:38:55 +0100 (Wed, 07 Mar 2012)
New Revision: 2806
Url: http://chorem.org/repositories/revision/jtimer/2806
Log:
#478: Update to commons-lang 3.1
#481: Migration configuration to NuitonUtils's ApplicationConfig
Added:
trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
trunk/src/test/resources/jtimertest.properties
Removed:
trunk/src/main/resources/JTimer.properties
trunk/src/main/resources/JTimer_default.properties
trunk/src/test/resources/JTimerTestRelatif.properties
Modified:
trunk/pom.xml
trunk/src/main/java/org/chorem/jtimer/JTimer.java
trunk/src/main/java/org/chorem/jtimer/JTimerFactory.java
trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java
trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java
trunk/src/main/java/org/chorem/jtimer/io/Saver.java
trunk/src/main/java/org/chorem/jtimer/package-info.java
trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java
trunk/src/main/java/org/chorem/jtimer/ui/report/ReportUtils.java
trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java
trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java
trunk/src/main/java/org/chorem/jtimer/ui/treetable/dnd/TimerTaskTransferHandler.java
trunk/src/main/resources/log4j.properties
trunk/src/test/java/org/chorem/jtimer/AbstractJTimerTest.java
trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/pom.xml 2012-03-07 16:38:55 UTC (rev 2806)
@@ -10,7 +10,7 @@
<groupId>org.chorem</groupId>
<artifactId>jtimer</artifactId>
- <version>1.3.4-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<name>jTimer</name>
<description>
@@ -172,7 +172,7 @@
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.8</version>
+ <version>2.9.1</version>
<configuration>
<configLocation>${maven.src.dir}/main/config/checkstyle.xml
</configLocation>
@@ -206,6 +206,26 @@
<dependencies>
<dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ <version>2.4.4</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-primitives</groupId>
+ <artifactId>commons-primitives</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.jdesktop.bsaf</groupId>
<artifactId>bsaf</artifactId>
<version>1.9.2</version>
@@ -265,8 +285,8 @@
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Modified: trunk/src/main/java/org/chorem/jtimer/JTimer.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/JTimer.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -31,6 +31,8 @@
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
+import java.io.File;
+import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -55,7 +57,8 @@
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreePath;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.data.DataViolationException;
@@ -76,6 +79,7 @@
import org.chorem.jtimer.ws.ConnectionDataHandler;
import org.chorem.jtimer.ws.ProjectManagement;
import org.jdesktop.application.Action;
+import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationContext;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
@@ -111,6 +115,9 @@
/** I18n resources map. */
protected ResourceMap resourceMap;
+ /** Jtimer application config. */
+ public static JTimerConfig config;
+
/** Single project selection property. */
protected boolean selectedSingleProject;
@@ -161,6 +168,9 @@
// super, but does nothing
super.initialize(args);
+ // load configuration
+ loadConfiguration(args);
+
// init resources map
ApplicationContext ctxt = getContext();
resourceMap = ctxt.getResourceMap();
@@ -185,6 +195,36 @@
}
/**
+ * Load configuration.
+ *
+ * @param args args to parse command line options
+ */
+ protected void loadConfiguration(String[] args) {
+
+ config = new JTimerConfig();
+
+ // add file migration for configuration file created before version 1.4
+ File homeDir = new File(System.getProperty("user.home"), ".jtimer");
+ File oldFile = new File(homeDir, "JTimer.properties");
+ File newFile = new File(config.appConfig.getConfigPath(), config.appConfig.getConfigFileName());
+ if (oldFile.isFile() && !newFile.isFile()) {
+ if (log.isInfoEnabled()) {
+ log.info("Migration configuration file location");
+ }
+ try {
+ FileUtils.copyFile(oldFile, newFile);
+ } catch (IOException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't copy config file to new location", ex);
+ }
+ }
+ }
+
+ // parse after file migration
+ config.parse(args);
+ }
+
+ /**
* startup.
*
* Create frame menu bar. Create main component.
Added: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java (rev 0)
+++ trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -0,0 +1,122 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package org.chorem.jtimer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
+
+/**
+ * JTimer configuration.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class JTimerConfig {
+
+ private static Log log = LogFactory.getLog(JTimerConfig.class);
+
+ protected ApplicationConfig appConfig;
+
+ public JTimerConfig() {
+ appConfig = new ApplicationConfig();
+ for (JTimerOption o : JTimerOption.values()) {
+ if (o.defaultValue != null) {
+ appConfig.setDefaultOption(o.key, o.defaultValue);
+ }
+ }
+ }
+
+ public void parse(String... args) {
+ try {
+ appConfig.parse(args);
+ } catch (ArgumentsParserException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't parse configuration", ex);
+ }
+ }
+ }
+
+ public Class getServiceClass() {
+ Class serviceClass = null;
+ try {
+ appConfig.getOptionAsClass(JTimerOption.SERVICE_CLASS.key);
+ } catch (Exception ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find service class implementation, sync will not work", ex);
+ }
+ }
+ return serviceClass;
+ }
+
+ public String getServiceEndpoint() {
+ return appConfig.getOption(JTimerOption.SERVICE_ENDPOINT.key);
+ }
+
+ public String getServiceResource() {
+ return appConfig.getOption(JTimerOption.SERVICE_RESOURCE.key);
+ }
+
+ public Class getIOSaverClass() {
+ return appConfig.getOptionAsClass(JTimerOption.IO_SAVER_CLASS.key);
+ }
+
+ public String getIOSaverDirectory() {
+ return appConfig.getOption(JTimerOption.IO_SAVER_DIRECTORY.key);
+ }
+
+ public long getIOSaverAutoSaveDelay() {
+ return appConfig.getOptionAsLong(JTimerOption.IO_SAVER_AUTOSAVEDELAY.key);
+ }
+
+ public long getIdleTime() {
+ return appConfig.getOptionAsLong(JTimerOption.UI_IDLE_TIME.key);
+ }
+
+ public enum JTimerOption {
+ CONFIG_FILENAME(ApplicationConfig.CONFIG_FILE_NAME, "jtimer.properties"),
+ SERVICE_CLASS("jtimer.service.class", null),
+ SERVICE_ENDPOINT("jtimer.service.endpoint", null),
+ SERVICE_RESOURCE("jtimer.service.resource", "JTimer"),
+ IO_SAVER_CLASS("jtimer.io.saver.class", "org.chorem.jtimer.io.GTimerIncrementalSaver"),
+ IO_SAVER_DIRECTORY("jtimer.io.saver.directory", "${user.home}/.gtimer"),
+ IO_SAVER_AUTOSAVEDELAY("jtimer.io.saver.autosavedelay", "300"),
+ UI_IDLE_TIME("jtimer.ui.idletime", "300");
+
+ protected String key;
+
+ protected String defaultValue;
+
+ private JTimerOption(String key, String defaultValue) {
+ this.key = key;
+ this.defaultValue = defaultValue;
+ }
+ }
+}
Property changes on: trunk/src/main/java/org/chorem/jtimer/JTimerConfig.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/src/main/java/org/chorem/jtimer/JTimerFactory.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/JTimerFactory.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/JTimerFactory.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -25,16 +25,6 @@
package org.chorem.jtimer;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.Properties;
-
-import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.io.Saver;
@@ -54,15 +44,6 @@
/** Logger */
private static Log log = LogFactory.getLog(JTimerFactory.class);
- /** Default idle time in milliseconds */
- protected static final long DEFAULT_IDLE_TIME = 5 * 60 * 1000; // 5 min
-
- /** Properties */
- protected static Properties props;
-
- /** Configured idle time */
- protected static long idleTime = -1L;
-
/** ProjectManagement */
protected static ProjectManagement projectManagement;
@@ -77,138 +58,6 @@
}
/**
- * Init.
- */
- protected static void init() {
-
- // init once
- if (props == null) {
-
- // change load order here :
- // Take :
- // - classpath one
- // - user home one
- // - ./ one
-
- try {
- props = new Properties();
-
- // read configuration file
- String fileName = getConfigurationFileName();
-
- // use file in classpath
- URL url = JTimerFactory.class.getResource("/" + fileName);
- props.load(url.openStream());
-
- // and override by file in user home
- File homeUserFile = new File(getUserHomeConfigurationFilePath());
- if (homeUserFile.exists()) {
- if (log.isInfoEnabled()) {
- log.info("Use user home configuration in "
- + homeUserFile.getAbsolutePath());
- }
- props.load(new FileInputStream(homeUserFile));
- } else {
-
- // homeUserFile is $HOME/JTimer.properties
- // on linux, parent dir is created by SAF
- // on other, SAF dir is not this one, so
- // could not exists
- if (homeUserFile.getParentFile() != null
- && !homeUserFile.getParentFile().exists()) {
- homeUserFile.getParentFile().mkdirs();
- if (log.isInfoEnabled()) {
- log.info("Creating directory "
- + homeUserFile.getParentFile()
- .getAbsolutePath());
- }
- }
-
- if (log.isInfoEnabled()) {
- log.info("Creating new default configuration file in "
- + homeUserFile.getAbsolutePath());
- }
-
- URL defautFileURL = JTimerFactory.class.getResource("/"
- + getDefaultConfigurationFileName());
- copyConfigurationFile(defautFileURL, homeUserFile);
- }
-
- // read file in current directory
- File currentDirectoryFile = new File(fileName);
- if (currentDirectoryFile.canRead()) {
- props.load(new FileInputStream(currentDirectoryFile));
- }
-
- } catch (IOException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't read configuration file", e);
- }
- }
- }
- }
-
- /**
- * Configuration filepath.
- *
- * @return Configuration filename
- */
- protected static String getUserHomeConfigurationFilePath() {
- // user home
- String filePath = System.getProperty("user.home");
- // + .jtimer directory
- // TODO use saf config
- filePath += File.separator + ".jtimer";
- // add filename
- filePath += File.separator + getConfigurationFileName();
-
- if (log.isDebugEnabled()) {
- log.debug("Look for configuration file in : " + filePath);
- }
-
- return filePath;
- }
-
- /**
- * Configuration filename.
- *
- * @return Configuration filename
- */
- protected static String getConfigurationFileName() {
- String fileName = JTimer.class.getSimpleName() + ".properties";
- return fileName;
- }
-
- /**
- * Default configuration filename.
- *
- * @return Configuration filename
- */
- protected static String getDefaultConfigurationFileName() {
- String fileName = JTimer.class.getSimpleName() + "_default.properties";
- return fileName;
- }
-
- /**
- * Copy copyFrom content in copyTo file.
- *
- * @param copyFrom from
- * @param copyTo to
- * @throws IOException
- */
- protected static void copyConfigurationFile(URL copyFrom, File copyTo)
- throws IOException {
-
- InputStream in = copyFrom.openStream();
- OutputStream out = new FileOutputStream(copyTo);
-
- IOUtils.copy(in, out);
-
- in.close();
- out.close();
- }
-
- /**
* Return an implementation on a distant web service.
*
* Use jtimer.service.class property to found class and
@@ -220,37 +69,26 @@
if (projectManagement == null) {
- // check that init has been done
- init();
+ Class implementationClass = JTimer.config.getServiceClass();
- // get implementation class
- String implementationClass = props
- .getProperty("jtimer.service.class");
- // get service endpoint
- String serviceEndPoint = props
- .getProperty("jtimer.service.endpoint");
- // get service resource name
- String serviceResouceName = props
- .getProperty("jtimer.service.resource");
-
// log
if (log.isInfoEnabled()) {
log.info("Using service class : " + implementationClass);
- log.info(" with service endpoint : " + serviceEndPoint);
- log.info(" with service resource : " + serviceResouceName);
+ log.info(" with service endpoint : " + JTimer.config.getServiceEndpoint());
+ log.info(" with service resource : " + JTimer.config.getServiceResource());
}
// By default jTimer won't synchronize
// so implementationClass can be null
if (implementationClass != null) {
+
try {
// get instance
- projectManagement = (ProjectManagement) Class.forName(
- implementationClass).newInstance();
+ projectManagement = (ProjectManagement)implementationClass.newInstance();
// init instance
- projectManagement.setEndpoint(serviceEndPoint);
- projectManagement.setResourceName(serviceResouceName);
+ projectManagement.setEndpoint(JTimer.config.getServiceEndpoint());
+ projectManagement.setResourceName(JTimer.config.getServiceResource());
} catch (InstantiationException e) {
if (log.isErrorEnabled()) {
log.error("Can't instanciate class : "
@@ -262,11 +100,6 @@
"Can't access class : " + implementationClass,
e);
}
- } catch (ClassNotFoundException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't found class : " + implementationClass,
- e);
- }
}
} else {
if (log.isInfoEnabled()) {
@@ -286,125 +119,37 @@
public static Saver getFileSaver() {
if (saver == null) {
- // check that init has been done
- init();
- // get implementation class
- String implementationClass = props
- .getProperty("jtimer.io.saver.class");
- // get saver directory
- String saverDirectory = props
- .getProperty("jtimer.io.saver.directory");
- // get saver save delay
- String autoSaveDelay = props
- .getProperty("jtimer.io.saver.autosavedelay");
+ Class saverClass = JTimer.config.getIOSaverClass();
- // replace $HOME by user.home
- saverDirectory = getHomeReplacement(saverDirectory);
-
// log
if (log.isInfoEnabled()) {
- log.info("Using saver class : " + implementationClass);
- log.info(" with saver home directory : " + saverDirectory);
- log.info(" with auto save delay : " + autoSaveDelay);
+ log.info("Using saver class : " + saverClass);
+ log.info(" with saver home directory : " + JTimer.config.getIOSaverDirectory());
+ log.info(" with auto save delay : " + JTimer.config.getIOSaverAutoSaveDelay());
}
try {
// get instance
- saver = (Saver) Class.forName(implementationClass)
- .newInstance();
+ saver = (Saver) saverClass.newInstance();
// init instance
- saver.setSaveDirectory(saverDirectory);
+ saver.setSaveDirectory(JTimer.config.getIOSaverDirectory());
// set delay to saver
- try {
- long autoSaveDelayInS = Long.parseLong(autoSaveDelay);
- saver.setAutoSaveDelay(autoSaveDelayInS * 1000);
- } catch (NumberFormatException e) {
- if (log.isWarnEnabled()) {
- log.warn("jtimer.io.saver.autosavedelay is non numeric value",
- e);
- }
- }
+ saver.setAutoSaveDelay(JTimer.config.getIOSaverAutoSaveDelay() * 1000);
+
} catch (InstantiationException e) {
if (log.isErrorEnabled()) {
- log.error("Can't instanciate class : "
- + implementationClass, e);
+ log.error("Can't instanciate class : " + saverClass, e);
}
} catch (IllegalAccessException e) {
if (log.isErrorEnabled()) {
- log.error("Can't access class : " + implementationClass, e);
+ log.error("Can't access class : " + saverClass, e);
}
- } catch (ClassNotFoundException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't found class : " + implementationClass, e);
- }
}
}
return saver;
}
-
- /**
- * Replace $HOME in path.
- *
- * @param path path to replace home
- * @return path without $HOME
- */
- protected static String getHomeReplacement(String path) {
-
- String localPath = path;
-
- // replace $HOME by user.home
- if (localPath != null) {
- // replace / in configuration file by
- // default system file.separator
- // FIXME find better method in 2.0
- localPath = localPath.replace("/", File.separator);
-
- // correct bug on windows system for example
- // \ in path are interpreted on regex
- String escapedUserHome = System.getProperty("user.home")
- .replaceAll("\\\\", "\\\\\\\\");
- localPath = localPath.replaceFirst("\\$HOME", escapedUserHome);
- }
-
- return localPath;
- }
-
- /**
- * Get configuration idle time in ms.
- *
- * @return idle time
- */
- public static long getIdleTime() {
-
- if (idleTime <= 0) {
-
- // check that init has been done
- init();
-
- String idleTimeInS = props.getProperty("jtimer.ui.idletime");
- if (idleTimeInS == null) {
- idleTime = DEFAULT_IDLE_TIME;
- } else {
- try {
- idleTime = Long.parseLong(idleTimeInS) * 1000L;
- } catch (NumberFormatException e) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get idle time as number, using default idle time",
- e);
- }
- idleTime = DEFAULT_IDLE_TIME;
- }
- }
-
- if (log.isInfoEnabled()) {
- log.info("Idle time set to : " + idleTime + "ms");
- }
- }
-
- return idleTime;
- }
}
Modified: trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/entities/TimerTask.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -32,7 +32,7 @@
import java.util.SortedMap;
import java.util.TreeMap;
-import org.apache.commons.lang.SerializationUtils;
+import org.apache.commons.lang3.SerializationUtils;
import org.chorem.jtimer.utils.DailySortedMap;
/**
Modified: trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -87,9 +87,6 @@
public class GTimerIncrementalSaver extends AbstractSaver implements Saver,
DataEventListener {
- /** serialVersionUID. */
- private static final long serialVersionUID = 4999800626942050992L;
-
/** log. */
private static Log log = LogFactory.getLog(GTimerIncrementalSaver.class);
Modified: trunk/src/main/java/org/chorem/jtimer/io/Saver.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/io/Saver.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/io/Saver.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
Modified: trunk/src/main/java/org/chorem/jtimer/package-info.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/package-info.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/package-info.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
Modified: trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/StatusBar.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -35,7 +35,7 @@
import javax.swing.JPanel;
import javax.swing.SwingConstants;
-import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.chorem.jtimer.data.DataEventListener;
import org.chorem.jtimer.data.TimerDataManager;
import org.chorem.jtimer.entities.TimerProject;
Modified: trunk/src/main/java/org/chorem/jtimer/ui/report/ReportUtils.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/report/ReportUtils.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/report/ReportUtils.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2008 - 2012 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
@@ -30,7 +30,7 @@
import java.util.Date;
import java.util.List;
-import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.chorem.jtimer.entities.TimerTask;
import org.chorem.jtimer.entities.TimerTaskHelper;
Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/IdleDialog.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2009 - 2012 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
@@ -40,10 +40,10 @@
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
-import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.jtimer.JTimerFactory;
+import org.chorem.jtimer.JTimer;
import org.jdesktop.application.Action;
import org.jdesktop.application.ApplicationContext;
import org.jdesktop.application.ResourceManager;
@@ -160,7 +160,7 @@
// label
JLabel idleLabel = new JLabel(resourceMap.getString("idleMessage", Long
- .valueOf(JTimerFactory.getIdleTime() / (60 * 1000))));
+ .valueOf(JTimer.config.getIdleTime() / (60 * 1000))));
mainComponent.add(idleLabel, new GridBagConstraints(1, 0, 3, 1, 1, 0,
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(5, 0, 0, 3), 0, 0));
Modified: trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/tasks/RunTaskJob.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -34,7 +34,7 @@
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
-import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.JTimer;
@@ -65,7 +65,7 @@
/** Class logger. */
private static Log log = LogFactory.getLog(RunTaskJob.class);
- /** Parent app referenc. */
+ /** Parent app reference. */
protected JTimer parentApp;
/** The task to manage. */
@@ -77,17 +77,18 @@
/** System information (idle...). */
protected SystemInfo systemInfo;
+ /** Already thrown alert. */
+ protected Collection<TimerAlert> alreadyTrownAlerts;
+
/** The today total task time at start time. */
protected long taskTimingBeforeStartInMs;
/** Calendar instance when timing start. */
protected Calendar taskStartCalendar;
- /** Already thrown alert. */
- protected Collection<TimerAlert> alreadyTrownAlerts;
-
/**
- * Offset to adjust time. Include :
+ * Offset to adjust time for current day.
+ * Include :
* - Task idle time (task was running but time not counted)
* - Manual user incremented time
*/
@@ -206,11 +207,7 @@
taskStartCalendar = Calendar.getInstance();
lastPublishTimestamp = taskStartCalendar.getTimeInMillis();
- // need to be 0 here not managedTask.getTime(new Date());
- // for idle detected when 0hOO goes...
- //taskTimingBeforeStartInMs = managedTask.getTime(new Date());
-
- // need to be this for hibernation in same day
+ // need to be this for hibernate in same day
taskTimingBeforeStartInMs = managedTask.getTime(new Date()) * 1000;
offsetTimeInMs = 0;
}
@@ -250,14 +247,14 @@
resetTiming();
// get idle time
- long configIdleTime = JTimerFactory.getIdleTime();
+ long configIdleTime = JTimer.config.getIdleTime();
boolean dontWantToStop = true;
while (dontWantToStop) {
- long loopTimestamp = Calendar.getInstance().getTimeInMillis();
+ long currentTime = Calendar.getInstance().getTimeInMillis();
// try to detect hibernate idle time
- if (loopTimestamp - lastPublishTimestamp >= configIdleTime) {
+ if (currentTime - lastPublishTimestamp >= configIdleTime) {
// hibernate detected
// update time without idle time for specified day
if (log.isInfoEnabled()) {
@@ -266,7 +263,7 @@
resetTiming();
}
- lastPublishTimestamp = loopTimestamp;
+ lastPublishTimestamp = currentTime;
// check user idle time
long idleTime = 0;
@@ -282,18 +279,22 @@
checkReset();
// if long idleTime is unavailable, if is always false
- if (idleTime >= JTimerFactory.getIdleTime()) {
+ if (idleTime >= JTimer.config.getIdleTime()) {
+ // to not display negative time near midnight
+ long idleTimeOffset = Math.min(idleTime, currentTime - taskStartCalendar.getTimeInMillis());
+
// idle detected
// update time without idle time
- offsetTimeInMs -= configIdleTime;
- publish(taskTimingBeforeStartInMs + loopTimestamp - taskStartCalendar.getTimeInMillis() + offsetTimeInMs);
+ // math.min > for idle detected at 0:00
+ offsetTimeInMs -= idleTimeOffset;
+ publish(taskTimingBeforeStartInMs + currentTime - taskStartCalendar.getTimeInMillis() + offsetTimeInMs);
// send idle detect event
JTimer parentApplication = (JTimer)getApplication();
parentApplication.preIdleDetect();
// ask user what to do (long blocking call)
- int option = IdleDialog.showIdleDialog(loopTimestamp - idleTime);
+ int option = IdleDialog.showIdleDialog(currentTime - idleTime);
// send idle detect event
parentApplication.postIdleDetect();
@@ -301,8 +302,8 @@
checkReset();
// get time after user idle
- long currentTime = Calendar.getInstance().getTimeInMillis();
- lastPublishTimestamp = currentTime;
+ long afterIdleTime = Calendar.getInstance().getTimeInMillis();
+ lastPublishTimestamp = afterIdleTime;
switch (option) {
@@ -314,8 +315,8 @@
case IdleDialog.CONTINUE:
// refresh time
// remove idle time previously added
- offsetTimeInMs += configIdleTime;
- publish(taskTimingBeforeStartInMs + currentTime
+ offsetTimeInMs += idleTimeOffset;
+ publish(taskTimingBeforeStartInMs + afterIdleTime
- taskStartCalendar.getTimeInMillis()
+ offsetTimeInMs);
break;
@@ -323,9 +324,9 @@
default: // RESUME
// resume = increment idle time
- offsetTimeInMs -= currentTime - loopTimestamp;
+ offsetTimeInMs -= afterIdleTime - currentTime;
// update time
- publish(taskTimingBeforeStartInMs + currentTime
+ publish(taskTimingBeforeStartInMs + afterIdleTime
- taskStartCalendar.getTimeInMillis()
+ offsetTimeInMs);
break;
@@ -333,7 +334,7 @@
}
} else {
// pas de idle, met a jour le temps
- publish(taskTimingBeforeStartInMs + loopTimestamp
+ publish(taskTimingBeforeStartInMs + currentTime
- taskStartCalendar.getTimeInMillis() + offsetTimeInMs);
}
Modified: trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/treetable/ProjectsAndTasksModel.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2007 - 2012 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
@@ -36,7 +36,7 @@
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
-import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.data.DataEventListener;
Modified: trunk/src/main/java/org/chorem/jtimer/ui/treetable/dnd/TimerTaskTransferHandler.java
===================================================================
--- trunk/src/main/java/org/chorem/jtimer/ui/treetable/dnd/TimerTaskTransferHandler.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/java/org/chorem/jtimer/ui/treetable/dnd/TimerTaskTransferHandler.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2008 - 2012 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
@@ -36,7 +36,7 @@
import javax.swing.JOptionPane;
import javax.swing.TransferHandler;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.jtimer.data.DataViolationException;
Deleted: trunk/src/main/resources/JTimer.properties
===================================================================
--- trunk/src/main/resources/JTimer.properties 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/resources/JTimer.properties 2012-03-07 16:38:55 UTC (rev 2806)
@@ -1,51 +0,0 @@
-###
-# #%L
-# jTimer
-#
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2007 - 2011 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
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/gpl-3.0.html>.
-# #L%
-###
-# JTimer.properties file
-
-##########################
-# Synchronization Services
-##########################
-# Service class
-#jtimer.service.class=org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient
-# Service resource to use for previous class
-#jtimer.service.resource=JTimer
-# Service endpoint to use for previous class
-#jtimer.service.endpoint=http://localhost:8080
-
-##########################
-# UI Options
-##########################
-# Idle time (integer in seconds)
-jtimer.ui.idletime=300
-
-##########################
-# Save options
-##########################
-# jtimer io saver directory
-jtimer.io.saver.class=org.chorem.jtimer.io.GTimerIncrementalSaver
-# Saver directory
-jtimer.io.saver.directory=$HOME/.gtimer
-# Save delay
-jtimer.io.saver.autosavedelay=300
Deleted: trunk/src/main/resources/JTimer_default.properties
===================================================================
--- trunk/src/main/resources/JTimer_default.properties 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/resources/JTimer_default.properties 2012-03-07 16:38:55 UTC (rev 2806)
@@ -1,51 +0,0 @@
-###
-# #%L
-# jTimer
-#
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2007 - 2011 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
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/gpl-3.0.html>.
-# #L%
-###
-# JTimer.properties file
-
-##########################
-# Synchronization Services
-##########################
-# Service class
-#jtimer.service.class=org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient
-# Service resource to use for previous class
-#jtimer.service.resource=JTimer
-# Service endpoint to use for previous class
-#jtimer.service.endpoint=http://localhost:8080
-
-##########################
-# UI Options
-##########################
-# Idle time (integer in seconds)
-#jtimer.ui.idletime=300
-
-##########################
-# Save options
-##########################
-# jtimer io saver directory
-#jtimer.io.saver.class=org.chorem.jtimer.io.GTimerIncrementalSaver
-# Saver directory
-#jtimer.io.saver.directory=$HOME/.gtimer
-# Save delay
-#jtimer.io.saver.autosavedelay=300
Modified: trunk/src/main/resources/log4j.properties
===================================================================
--- trunk/src/main/resources/log4j.properties 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/main/resources/log4j.properties 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric
+# Copyright (C) 2007 - 2012 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
Modified: trunk/src/test/java/org/chorem/jtimer/AbstractJTimerTest.java
===================================================================
--- trunk/src/test/java/org/chorem/jtimer/AbstractJTimerTest.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/test/java/org/chorem/jtimer/AbstractJTimerTest.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * Copyright (C) 2008 - 2012 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
@@ -57,10 +57,9 @@
/** Class log */
private static Log log = LogFactory.getLog(AbstractJTimerTest.class);
- protected static final String RELATIF_PROPERTIES_RESOURCE = "/JTimerTestRelatif.properties";
-
/** Saver instance on specific test directory. */
protected Saver testSaver;
+
/** Test directory. */
protected File testDataDirectory;
@@ -86,16 +85,18 @@
*/
protected void initDataDirectory() throws IOException {
- URL testConfigFile = AbstractJTimerTest.class
- .getResource(RELATIF_PROPERTIES_RESOURCE);
+ URL testConfigFile = AbstractJTimerTest.class.getResource("/jtimertest.properties");
+ Properties props = new Properties();
+ props.load(testConfigFile.openStream());
- JTimerFactory.props = new Properties();
- JTimerFactory.props.load(testConfigFile.openStream());
testDataDirectory = new File(getTempDirPath(), String.valueOf(System
.currentTimeMillis()));
- JTimerFactory.props.put("jtimer.io.saver.directory", testDataDirectory
+ props.put("jtimer.io.saver.directory", testDataDirectory
.getAbsolutePath());
+ JTimer.config = new JTimerConfig();
+ JTimer.config.appConfig.setOptions(props); // not call parse in test
+
if (log.isDebugEnabled()) {
log.debug("Copy resource test directory to "
+ testDataDirectory.getAbsolutePath());
Modified: trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java
===================================================================
--- trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-03-07 16:38:55 UTC (rev 2806)
@@ -25,12 +25,13 @@
package org.chorem.jtimer;
-import java.util.Properties;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.jtimer.JTimerConfig.JTimerOption;
+import org.chorem.jtimer.io.GTimerIncrementalSaver;
import org.chorem.jtimer.io.Saver;
import org.chorem.jtimer.ws.ProjectManagement;
+import org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -49,61 +50,30 @@
private static Log log = LogFactory.getLog(JTimerFactoryTest.class);
/**
- * Test que les proprietes ne sont pas
- * nulles et que les valeures sont bonnes.
+ * Verifie que les options par default sont bien chargées.
*/
@Test
- public void initTest() {
+ public void testInitConfiguration() {
if (log.isInfoEnabled()) {
log.info("Test property loading " + JTimerFactoryTest.class);
}
- Properties props = JTimerFactory.props;
+ Assert.assertEquals(JTimer.config.getServiceClass(), ChoremXMLRPCClient.class);
+ Assert.assertEquals(JTimer.config.getServiceResource(), "JTimer");
+ Assert.assertEquals(JTimer.config.getServiceEndpoint(), "http://localhost:8080");
- Assert.assertEquals(
- "org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient", props
- .getProperty("jtimer.service.class"));
- Assert.assertEquals("JTimer", props
- .getProperty("jtimer.service.resource"));
- Assert.assertEquals("http://localhost:8080", props
- .getProperty("jtimer.service.endpoint"));
+ Assert.assertEquals(JTimer.config.getIdleTime(), 299);
- Assert.assertEquals("299", props.getProperty("jtimer.ui.idletime"));
-
- Assert.assertEquals("org.chorem.jtimer.io.GTimerIncrementalSaver",
- props.getProperty("jtimer.io.saver.class"));
+ Assert.assertEquals(JTimer.config.getIOSaverClass(), GTimerIncrementalSaver.class);
// Temp dir is dynamic
//Assert.assertEquals(AbstractJTimerTest.getTempDirPath() + "/testngdata",
- // props.getProperty("jtimer.io.saver.directory"));
- Assert.assertEquals("199", props
- .getProperty("jtimer.io.saver.autosavedelay"));
+ // JTimer.config.getIOSaverDirectory());
+ Assert.assertEquals(JTimer.config.getIOSaverAutoSaveDelay(), 199);
}
/**
- * Test que le fichier de conf s'appelle bien JTimer.properties.
- */
- @Test
- public void getConfigurationFileName() {
- String name = JTimerFactory.getConfigurationFileName();
- Assert.assertNotNull(name);
- Assert.assertEquals("JTimer.properties", name);
- }
-
- /**
- * Test que le fichier de path du fichier n'est pas null.
- * Le chemin complet est $HOME/.jtimer/getConfigurationFileName().
- * Mais ca depend de $HOME
- */
- @Test
- public void getConfigurationFilePath() {
- String path = JTimerFactory.getUserHomeConfigurationFilePath();
- Assert.assertNotNull(path);
- Assert.assertTrue(path.endsWith("/.jtimer/JTimer.properties"));
- }
-
- /**
* Test que le saver de fichier s'est bien initialise.
*/
@Test
@@ -114,45 +84,14 @@
}
/**
- * Test la valeur de idletime.
- */
- @Test
- public void getIdleTime() {
- long idleTime = JTimerFactory.getIdleTime();
-
- Assert.assertTrue(idleTime > 0L);
- Assert.assertEquals(299000, idleTime);
- }
-
- /**
- * Test que le $HOME est bien remplacé
- */
- @Test
- public void getHomeReplacementTest() {
-
- Assert.assertEquals("/home/test/.gtimer", JTimerFactory
- .getHomeReplacement("/home/test/.gtimer"));
-
- Assert.assertEquals(System.getProperty("user.home") + "/.gtimer",
- JTimerFactory.getHomeReplacement("$HOME/.gtimer"));
-
- Assert.assertEquals(
- "C:\\Documents And Settings\\user\\.gtimer",
- JTimerFactory
- .getHomeReplacement("C:\\Documents And Settings\\user\\.gtimer"));
- }
-
- /**
* Test que le composant gerant les webservices s'est bien initialise.
*/
@Test
public void getProjectManagementService() {
- ProjectManagement projectManagement = JTimerFactory
- .getProjectManagementService();
+ ProjectManagement projectManagement = JTimerFactory.getProjectManagementService();
Assert.assertNotNull(projectManagement);
- Assert.assertEquals("http://localhost:8080", projectManagement
- .getEndpoint());
- Assert.assertEquals("JTimer", projectManagement.getResourceName());
+ Assert.assertEquals(projectManagement.getEndpoint(), "http://localhost:8080");
+ Assert.assertEquals(projectManagement.getResourceName(), "JTimer");
}
}
Deleted: trunk/src/test/resources/JTimerTestRelatif.properties
===================================================================
--- trunk/src/test/resources/JTimerTestRelatif.properties 2012-02-16 14:27:52 UTC (rev 2805)
+++ trunk/src/test/resources/JTimerTestRelatif.properties 2012-03-07 16:38:55 UTC (rev 2806)
@@ -1,40 +0,0 @@
-###
-# #%L
-# jTimer
-#
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2007 - 2011 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
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/gpl-3.0.html>.
-# #L%
-###
-# Service class
-jtimer.service.class=org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient
-# Service resource to use for previous class
-jtimer.service.resource=JTimer
-# Service endpoint to use for previous class
-jtimer.service.endpoint=http://localhost:8080
-
-# Idle time (integer in seconds)
-jtimer.ui.idletime=299
-
-# jtimer io saver directory
-jtimer.io.saver.class=org.chorem.jtimer.io.GTimerIncrementalSaver
-# Saver directory
-jtimer.io.saver.directory=$HOME/testngdata
-# Save delay
-jtimer.io.saver.autosavedelay=199
\ No newline at end of file
Copied: trunk/src/test/resources/jtimertest.properties (from rev 2803, trunk/src/test/resources/JTimerTestRelatif.properties)
===================================================================
--- trunk/src/test/resources/jtimertest.properties (rev 0)
+++ trunk/src/test/resources/jtimertest.properties 2012-03-07 16:38:55 UTC (rev 2806)
@@ -0,0 +1,40 @@
+###
+# #%L
+# jTimer
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2007 - 2011 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
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
+# #L%
+###
+# Service class
+jtimer.service.class=org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient
+# Service resource to use for previous class
+jtimer.service.resource=JTimer
+# Service endpoint to use for previous class
+jtimer.service.endpoint=http://localhost:8080
+
+# Idle time (integer in seconds)
+jtimer.ui.idletime=299
+
+# jtimer io saver directory
+jtimer.io.saver.class=org.chorem.jtimer.io.GTimerIncrementalSaver
+# Saver directory
+jtimer.io.saver.directory=${user.home}/testngdata
+# Save delay
+jtimer.io.saver.autosavedelay=199
\ No newline at end of file
1
0
Author: echatellier
Date: 2012-02-16 15:27:52 +0100 (Thu, 16 Feb 2012)
New Revision: 2805
Url: http://chorem.org/repositories/revision/jtimer/2805
Log:
Update next version
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-02-16 14:24:23 UTC (rev 2804)
+++ trunk/pom.xml 2012-02-16 14:27:52 UTC (rev 2805)
@@ -5,12 +5,12 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.0.7</version>
+ <version>3.1</version>
</parent>
<groupId>org.chorem</groupId>
<artifactId>jtimer</artifactId>
- <version>1.3.3-SNAPSHOT</version>
+ <version>1.3.4-SNAPSHOT</version>
<name>jTimer</name>
<description>
1
0