[josm-dev] JosmPlugin, Catching the DataDelete Event

Möller, Matthias mmoeller at psi.de
Wed Nov 25 12:18:02 UTC 2015


Hello,

currently i'am working on a plugin for JOSM and i want to prevent the user from deleting special Nodes.
So the Idea is to catch the Delete Event and display a warning(or a userchoise).
I first looked into the Dataset and DatasetListener. But at the pont when I get the primitiesRemoved() Event in my DatasetListener, the element has already been deleted.
My next idea would be to override the shortcut key DEL and link it to my own DeleteAction. With this Action I can either display a warning or delegate the Selection to the original DeleteAction.

So my question:
Is there a better way to prevent Nodes from being deleted?
Is it a good solution to replace the shortcut key DEL with my own deleteAction?

Thanks in advance

Regards Matthias Möller


More information about the josm-dev mailing list