use of net.sourceforge.processdash.log.time.TimeLoggingModel in project processdash by dtuma.
the class TaskStatusApi method getTargetPath.
/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
// use the prefix, if one was supplied in the request
String result = getPrefix();
// selected task
if (!StringUtils.hasValue(result)) {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
result = tlm.getActiveTaskModel().getPath();
}
// verify that the named path exists and is a leaf task
DashHierarchy hier = getPSPProperties();
PropertyKey key = hier.findExistingKey(result);
if (key == null)
throw new WebApiException("no-such-task", 404, "The task '" + result + "' was not found.");
else if (hier.getNumChildren(key) != 0)
throw new WebApiException("not-leaf-task", 400, "The item '" + result + "' is not a leaf task.");
return result;
}
use of net.sourceforge.processdash.log.time.TimeLoggingModel in project processdash by dtuma.
the class MenuHandler method createSharedActions.
private void createSharedActions(ProcessDashboard pdash) {
showWindowAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
DashController.raiseWindow();
}
};
final TimeLoggingModel timeLoggingModel = pdash.getTimeLoggingModel();
playPauseAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
timeLoggingModel.setPaused(!timeLoggingModel.isPaused());
}
};
changeTaskAction = pdash.getChangeTaskAction();
}
use of net.sourceforge.processdash.log.time.TimeLoggingModel in project processdash by dtuma.
the class SizeMetricApiDispatcher method getTargetPath.
/** Retrieve the target path from the incoming HTTP request */
private String getTargetPath() {
// use the prefix, if one was supplied in the request
String result = getPrefix();
// selected task
if (!StringUtils.hasValue(result)) {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
result = tlm.getActiveTaskModel().getPath();
}
return result;
}
use of net.sourceforge.processdash.log.time.TimeLoggingModel in project processdash by dtuma.
the class DisplayState method writeTimingState.
private void writeTimingState() {
DashboardContext ctx = getDashboardContext();
DashboardTimeLog tl = (DashboardTimeLog) ctx.getTimeLog();
TimeLoggingModel tlm = tl.getTimeLoggingModel();
String path = tlm.getActiveTaskModel().getPath();
String isTiming = tlm.isPaused() ? "false" : "true";
out.write("Content-Type: text/plain\r\n\r\n");
out.write("activeTask=" + path + "\r\n");
out.write("isTiming=" + isTiming + "\r\n");
out.flush();
}
Aggregations