use of com.intellij.openapi.command.CommandListener in project intellij-community by JetBrains.
the class CoreCommandProcessor method fireCommandStarted.
private void fireCommandStarted() {
ApplicationManager.getApplication().assertIsDispatchThread();
CommandDescriptor currentCommand = myCurrentCommand;
CommandEvent event = new CommandEvent(this, currentCommand.myCommand, currentCommand.myName, currentCommand.myGroupId, currentCommand.myProject, currentCommand.myUndoConfirmationPolicy, currentCommand.myShouldRecordActionForActiveDocument, currentCommand.myDocument);
for (CommandListener listener : myListeners) {
try {
listener.commandStarted(event);
} catch (Throwable e) {
CommandLog.LOG.error(e);
}
}
}
use of com.intellij.openapi.command.CommandListener in project intellij-community by JetBrains.
the class CoreCommandProcessor method fireCommandFinished.
protected void fireCommandFinished() {
ApplicationManager.getApplication().assertIsDispatchThread();
CommandDescriptor currentCommand = myCurrentCommand;
CommandEvent event = new CommandEvent(this, currentCommand.myCommand, currentCommand.myName, currentCommand.myGroupId, currentCommand.myProject, currentCommand.myUndoConfirmationPolicy, currentCommand.myShouldRecordActionForActiveDocument, currentCommand.myDocument);
try {
for (CommandListener listener : myListeners) {
try {
listener.beforeCommandFinished(event);
} catch (Throwable e) {
CommandLog.LOG.error(e);
}
}
} finally {
myCurrentCommand = null;
for (CommandListener listener : myListeners) {
try {
listener.commandFinished(event);
} catch (Throwable e) {
CommandLog.LOG.error(e);
}
}
}
}
Aggregations