2014-07-25 16:29:03 +02:00
|
|
|
package org.gcube.portlets.user.td.monitorwidget.client;
|
|
|
|
|
2014-08-28 20:12:34 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.UIOperationsId;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.monitor.OperationMonitor;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.task.JobS;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskS;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsJobS;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.task.WorkerState;
|
|
|
|
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
2014-07-25 16:29:03 +02:00
|
|
|
import com.google.gwt.core.client.EntryPoint;
|
|
|
|
import com.google.web.bindery.event.shared.SimpleEventBus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2014-08-28 20:12:34 +02:00
|
|
|
* @author "Giancarlo Panichi" email: <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
2014-07-25 16:29:03 +02:00
|
|
|
*/
|
2014-08-28 20:12:34 +02:00
|
|
|
public class MonitorWidgetEntry implements EntryPoint {
|
2014-07-25 16:29:03 +02:00
|
|
|
|
|
|
|
public void onModuleLoad() {
|
2014-08-28 20:12:34 +02:00
|
|
|
Log.debug("Test MonitorWidget");
|
|
|
|
SimpleEventBus eventBus = new SimpleEventBus();
|
|
|
|
MonitorDialog monitorWidget = new MonitorDialog("1", eventBus);
|
2014-08-08 16:39:25 +02:00
|
|
|
monitorWidget.show();
|
2014-08-28 20:12:34 +02:00
|
|
|
OperationMonitor operationMonitor = new OperationMonitor("1",
|
|
|
|
UIOperationsId.EditRow);
|
|
|
|
operationMonitor.setTask(createTaskForTest());
|
|
|
|
monitorWidget.updateOperationMonitor(operationMonitor);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private TaskS createTaskForTest() {
|
|
|
|
ArrayList<ValidationsJobS> validationsJobs = new ArrayList<ValidationsJobS>();
|
|
|
|
ValidationsJobS validationJobS = new ValidationsJobS("1",
|
|
|
|
WorkerState.IN_PROGRESS, 0.5f, "Row Validate", null,
|
|
|
|
"Validation in progress");
|
|
|
|
validationsJobs.add(validationJobS);
|
|
|
|
|
|
|
|
ArrayList<JobS> jobs = new ArrayList<JobS>();
|
|
|
|
JobS job1 = new JobS("1", 0.8f, "Edit Row Job for Human",
|
|
|
|
"Edit Row Job", WorkerState.IN_PROGRESS, null, validationsJobs);
|
|
|
|
jobs.add(job1);
|
|
|
|
|
|
|
|
JobS job2 = new JobS("2", 0.3f, "Add Row Job for Human",
|
|
|
|
"Add Row Job", WorkerState.IN_PROGRESS, null, validationsJobs);
|
|
|
|
jobs.add(job2);
|
|
|
|
|
|
|
|
JobS job3 = new JobS("3", 0.72f, "Delete Job for Human",
|
|
|
|
"Delete Row Job", WorkerState.IN_PROGRESS, null, validationsJobs);
|
|
|
|
jobs.add(job3);
|
|
|
|
|
|
|
|
TaskS task = new TaskS("1", 0.3f, State.IN_PROGRESS, null, "default",
|
|
|
|
new Date(), null, jobs);
|
|
|
|
|
|
|
|
return task;
|
|
|
|
|
2014-07-25 16:29:03 +02:00
|
|
|
}
|
|
|
|
}
|