}
}
else if (event.isRowActivated()) {
Snmp4jAgentHBCtrlEntryRow row =
(Snmp4jAgentHBCtrlEntryRow) event.getRow();
HeartbeatTask task = new HeartbeatTask(row);
if (row.getSnmp4jAgentHBCtrlDelay().getValue() == 0) {
long startTime = DateAndTime.makeCalendar(
row.getSnmp4jAgentHBCtrlStartTime()).getTimeInMillis() -
heartbeatOffset;
heartbeatTimer.schedule(task,
new Date(startTime),
row.getSnmp4jAgentHBCtrlPeriod().getValue());
}
else {
heartbeatTimer.schedule(task,
row.getSnmp4jAgentHBCtrlDelay().getValue(),
row.getSnmp4jAgentHBCtrlPeriod().getValue());
}
row.setUserObject(task);
}
else if (event.isRowDeactivated()) {
Snmp4jAgentHBCtrlEntryRow row =
(Snmp4jAgentHBCtrlEntryRow) event.getRow();
HeartbeatTask task = (HeartbeatTask) row.getUserObject();
if (task != null) {
task.cancel();
}
}
}