void applyPostedChanges () {
long l;
// If there are any changes, apply them.
if (postedChanges.size() > 0) {
DataRepository data = dashboard.getDataRepository();
String thePath;
// Get the posted changes (keys) and loop through them all
Enumeration keys = postedChanges.keys();
while (keys.hasMoreElements ()) {
// Store the change's key information into k, and data into l.
PropertyKey k = (PropertyKey)keys.nextElement ();
l = ((Long)postedChanges.get (k)).longValue();
if (l != 0) {
thePath = k.path() + "/Time";
// Extract the data from the data repository that corresponds
// to the change we are currently applying.
Object pt = data.getValue (thePath);
// Are they trying to log time against some node which performs
// roll up only? This is bad - don't allow it.
if (pt != null &&
(!(pt instanceof DoubleData) || pt instanceof NumberFunction)) {
System.err.println("Error in TimeLogEditor: time must be logged " +
"to phases (i.e. leaves of the hierarchy).");
continue;
}
if (pt != null)
l += (long)((DoubleData) pt).getInteger ();
// Save the new value into the data repository.
data.putValue(thePath, new DoubleData(l, false));
}
}
}
postedChanges.clear ();
}