Implement this interface to listen to commandStarted and commandFinished events of
ModelAccess.executeCommand(Runnable)
and
ModelAccess.executeCommandInEDT(Runnable)
.
Register the listener with
ModelAccess.addCommandListener(CommandListener)
.
The clients are still in write action while handling both events.
Beware, it's prohibited to start another command while in start/finish notification,
implementation throws (IllegalModelAccessException
if attempt made.
This is different e.g. from
WriteActionListener
where a new write within pre/post notification is possible
(although not sure if this is right as the same reasoning as for commands may apply)
Justification: starting another command from within notification would be confusing for other
listeners. Keeping another command code as part of 'active' command (the one we dispatch
notifications about) would let some other command listeners unaware of changes this new command
may introduce.