Example usage for com.intellij.openapi.actionSystem IdeActions CONSOLE_CLEAR_ALL

List of usage examples for com.intellij.openapi.actionSystem IdeActions CONSOLE_CLEAR_ALL

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem IdeActions CONSOLE_CLEAR_ALL.

Prototype

String CONSOLE_CLEAR_ALL

To view the source code for com.intellij.openapi.actionSystem IdeActions CONSOLE_CLEAR_ALL.

Click Source Link

Usage

From source file:cn.fishy.plugin.idea.ponytail.Console.java

License:Apache License

private Editor createLogEditor() {
    final Editor editor = ConsoleViewUtil.setupConsoleEditor(project, false, false);
    ((EditorMarkupModel) editor.getMarkupModel()).setErrorStripeVisible(true);

    final ClearLogAction clearLog = new ClearLogAction(this);
    clearLog.registerCustomShortcutSet(//  ww  w. ja va  2 s .c om
            ActionManager.getInstance().getAction(IdeActions.CONSOLE_CLEAR_ALL).getShortcutSet(),
            editor.getContentComponent());

    final EditorMouseListener listener = new EditorPopupHandler() {
        public void invokePopup(final EditorMouseEvent event) {
            final ActionManager actionManager = ActionManager.getInstance();
            final ActionPopupMenu menu = actionManager.createActionPopupMenu(ActionPlaces.EDITOR_POPUP,
                    createPopupActions(actionManager, clearLog));
            final MouseEvent mouseEvent = event.getMouseEvent();
            menu.getComponent().show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
        }
    };
    editor.addEditorMouseListener(listener);
    /*Disposer.register(this, new Disposable() {
    @Override
    public void dispose() {
        EditorFactory.getInstance().releaseEditor(editor);
    }
    });*/
    return editor;
}

From source file:com.headwire.aem.tooling.intellij.console.ConsoleLogConsole.java

License:Apache License

private Editor createLogEditor() {
    Project project = myProjectModel.getProject();
    final Editor editor = ConsoleViewUtil.setupConsoleEditor(project, false, false);
    myProjectModel.getProject().getMessageBus().connect().subscribe(ProjectManager.TOPIC,
            new ProjectManagerAdapter() {
                @Override/* w w w  .ja  v a2 s . c o m*/
                public void projectClosed(Project project) {
                    if (project == myProjectModel.getProject()) {
                        EditorFactory.getInstance().releaseEditor(editor);
                    }
                }
            });

    ((EditorMarkupModel) editor.getMarkupModel()).setErrorStripeVisible(true);

    final ClearLogAction clearLog = new ClearLogAction(this);
    clearLog.registerCustomShortcutSet(
            ActionManager.getInstance().getAction(IdeActions.CONSOLE_CLEAR_ALL).getShortcutSet(),
            editor.getContentComponent());

    editor.addEditorMouseListener(new EditorPopupHandler() {
        public void invokePopup(final EditorMouseEvent event) {
            final ActionManager actionManager = ActionManager.getInstance();
            final ActionPopupMenu menu = actionManager.createActionPopupMenu(ActionPlaces.EDITOR_POPUP,
                    createPopupActions(actionManager, clearLog));
            final MouseEvent mouseEvent = event.getMouseEvent();
            menu.getComponent().show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
        }
    });
    return editor;
}