toolbar button to clear console contents (IDEA-80849)

This commit is contained in:
Dmitry Jemerov
2012-02-07 12:26:35 +01:00
parent 1067eeddff
commit cf3d60eb8b
@@ -985,7 +985,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
public static class ClearAllAction extends DumbAwareAction {
public ClearAllAction() {
super(ExecutionBundle.message("clear.all.from.console.action.name"));
super(ExecutionBundle.message("clear.all.from.console.action.name"), "Clear the contents of the console", IconLoader.findIcon("/actions/gc.png"));
}
@Override
@@ -1356,21 +1356,20 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
final AnAction autoScrollToTheEndAction = new ScrollToTheEndToolbarAction(myEditor);
//Initializing custom actions
final AnAction[] consoleActions = new AnAction[4 + customActions.size()];
final AnAction[] consoleActions = new AnAction[5 + customActions.size()];
consoleActions[0] = prevAction;
consoleActions[1] = nextAction;
consoleActions[2] = switchSoftWrapsAction;
consoleActions[3] = autoScrollToTheEndAction;
consoleActions[4] = new ClearAllAction();
//consoleActions[4] = new ShowRecentlyChanged();
for (int i = 0; i < customActions.size(); ++i) {
consoleActions[i + 4] = customActions.get(i);
consoleActions[i + 5] = customActions.get(i);
}
ConsoleActionsPostProcessor[] postProcessors = Extensions.getExtensions(ConsoleActionsPostProcessor.EP_NAME);
AnAction[] result = consoleActions;
if (postProcessors != null) {
for (ConsoleActionsPostProcessor postProcessor : postProcessors) {
result = postProcessor.postProcess(this, result);
}
for (ConsoleActionsPostProcessor postProcessor : postProcessors) {
result = postProcessor.postProcess(this, result);
}
return result;
}