
How can I recognize the end of a actitity change?
Hello,
I have the problem to find out when the change (move,change of starttime/ endtime, ) of a activity is ready.
When I use a ActivityInteractionListener, I cannot find out the end of user action only the beginning.
I would like to store the changed data to database.
Code:
private class ActivityInteractionListener implements InteractionListener {
public void interactionOccured(InteractionEvent e) {
final Object o = e.getInteractor().getInteracted();
System.out.println("CMD: " +e.getCommand().getValue());
if (o instanceof ActivityView && e.getSourceEvent() instanceof MouseEvent) {
final ActivityView actView = (ActivityView) o;
final DefaultDateArea dateArea = (DefaultDateArea) actView.getContainer();
JPopupMenu pop = new JPopupMenu();
final Point p = ((MouseEvent) e.getSourceEvent()).getPoint();
Object commandValue = e.getCommand().getValue();
if (DefaultDateArea.AE_POPUP_TRIGGER.equals(commandValue)) {
boolean hasTime = actView.getModel().getBaseDateRange().getHasTime();
String menuText = hasTime ? "Make All Day Event" : "Make Regular Event";
pop.add(menuText).addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Activity act = ((ActivityView) o).getModel();
MutableDateRange dr = act.getDateRangeClone();
dr.setHasTime(!dr.getHasTime());
try {
act.setBaseDateRange(dr.getImmutable());
} catch (PropertyVetoException e1) {
}
monthDateArea.getDateArea().recreateActivityViews();
dayDateArea.getDateArea().recreateActivityViews();
topDayArea.getDateArea().recreateActivityViews();
}
});
pop.show(actView.getContainer(), p.x, p.y);
}
}
Thank you for the helb.
Greetings olaf