Search in sources :

Example 1 with NewErrorTreeViewPanel

use of com.intellij.ide.errorTreeView.NewErrorTreeViewPanel in project intellij-community by JetBrains.

the class PydevConsoleRunnerImpl method showErrorsInConsole.

private void showErrorsInConsole(Exception e) {
    DefaultActionGroup actionGroup = new DefaultActionGroup(createRerunAction());
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);
    // Runner creating
    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(actionToolbar.getComponent(), BorderLayout.WEST);
    NewErrorTreeViewPanel errorViewPanel = new NewErrorTreeViewPanel(myProject, null, false, false, null);
    String[] messages = StringUtil.isNotEmpty(e.getMessage()) ? StringUtil.splitByLines(e.getMessage()) : ArrayUtil.EMPTY_STRING_ARRAY;
    if (messages.length == 0) {
        messages = new String[] { "Unknown error" };
    }
    errorViewPanel.addMessage(MessageCategory.ERROR, messages, null, -1, -1, null);
    panel.add(errorViewPanel, BorderLayout.CENTER);
    final RunContentDescriptor contentDescriptor = new RunContentDescriptor(null, myProcessHandler, panel, "Error running console");
    actionGroup.add(createCloseAction(contentDescriptor));
    showContentDescriptor(contentDescriptor);
}
Also used : RunContentDescriptor(com.intellij.execution.ui.RunContentDescriptor) NewErrorTreeViewPanel(com.intellij.ide.errorTreeView.NewErrorTreeViewPanel)

Example 2 with NewErrorTreeViewPanel

use of com.intellij.ide.errorTreeView.NewErrorTreeViewPanel in project intellij-community by JetBrains.

the class MessageViewHelper method processError.

public synchronized void processError(final SAXParseException ex, final boolean warning) {
    if (myErrors.size() == 0 && myErrorsView == null) {
        myErrorsView = new NewErrorTreeViewPanel(myProject, null, true, true, null);
        myErrorsView.setProcessController(myProcessController);
        openMessageViewImpl();
    }
    final String error = ex.getLineNumber() + "|" + ex.getColumnNumber() + "|" + ex.getSystemId() + "|" + ex.getLocalizedMessage();
    if (!myErrors.add(error)) {
        return;
    }
    VirtualFile file = null;
    final String systemId = ex.getSystemId();
    if (systemId != null) {
        try {
            file = VfsUtil.findFileByURL(new URL(systemId));
        } catch (MalformedURLException e) {
            LOG.warn("systemId = " + systemId);
            LOG.error(e);
        }
    }
    final VirtualFile file1 = file;
    ApplicationManager.getApplication().invokeLater(() -> myErrorsView.addMessage(warning ? MessageCategory.WARNING : MessageCategory.ERROR, new String[] { ex.getLocalizedMessage() }, file1, ex.getLineNumber() - 1, ex.getColumnNumber() - 1, null));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) MalformedURLException(java.net.MalformedURLException) NewErrorTreeViewPanel(com.intellij.ide.errorTreeView.NewErrorTreeViewPanel) URL(java.net.URL)

Example 3 with NewErrorTreeViewPanel

use of com.intellij.ide.errorTreeView.NewErrorTreeViewPanel in project intellij-community by JetBrains.

the class MessageViewHelper method openMessageView.

public synchronized void openMessageView(Runnable rerun) {
    assert myErrorsView == null;
    myErrorsView = new NewErrorTreeViewPanel(myProject, null, true, true, rerun);
    openMessageViewImpl();
}
Also used : NewErrorTreeViewPanel(com.intellij.ide.errorTreeView.NewErrorTreeViewPanel)

Aggregations

NewErrorTreeViewPanel (com.intellij.ide.errorTreeView.NewErrorTreeViewPanel)3 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1