[josm-dev] JosmPlugin, Catching the DataDelete Event
Paul Hartmann
phaaurlt at gmail.com
Wed Nov 25 12:55:42 UTC 2015
On 25.11.2015 13:18, Möller, Matthias wrote:
> 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).
Could you give a little more context, what the plugin is supposed to do
and why certain nodes should not be deleted?
> [...]
> So my question:
> Is there a better way to prevent Nodes from being deleted?
The cleanest solution is to patch JOSM core so your plugin can intercept
the delete action. (Similar to DatasetListener, but the "listener"
returns a boolean value which tells JOSM to continue or abort the delete
action.)
> Is it a good solution to replace the shortcut key DEL with my own deleteAction?
No, not only will you get shortcut conflict messages on the console, but
the user can still remove all nodes in delete mode (ctrl+del).
Paul
More information about the josm-dev
mailing list