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);
}
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));
}
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();
}
Aggregations