protected void showErrorPage(final ErrorInfo info) { storeState(); hideProgress(); myRootComponent = null; myErrorMessages.removeAll(); if (info.myShowStack) { info.myMessages.add( 0, new FixableMessageInfo(true, info.myDisplayMessage, "", "", null, null)); ByteArrayOutputStream stream = new ByteArrayOutputStream(); info.myThrowable.printStackTrace(new PrintStream(stream)); myErrorStack.setText(stream.toString()); myErrorStackLayout.show(myErrorStackPanel, ERROR_STACK_CARD); } else { myErrorStack.setText(null); myErrorStackLayout.show(myErrorStackPanel, ERROR_NO_STACK_CARD); } for (FixableMessageInfo message : info.myMessages) { addErrorMessage( message, message.myErrorIcon ? Messages.getErrorIcon() : Messages.getWarningIcon()); } myErrorPanel.revalidate(); myLayout.show(this, ERROR_CARD); DesignerToolWindowManager.getInstance(getProject()).refresh(true); repaint(); }
protected final void showDesignerCard() { myErrorMessages.removeAll(); myErrorStack.setText(null); myLayeredPane.revalidate(); myHorizontalCaption.update(); myVerticalCaption.update(); myLayout.show(this, DESIGNER_CARD); }
private void createErrorCard() { myErrorPanel = new JPanel(new BorderLayout()); myErrorMessages = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 10, 5, true, false)); myErrorPanel.add(myErrorMessages, BorderLayout.PAGE_START); myErrorStack = new JTextArea(50, 20); myErrorStack.setEditable(false); myErrorStackLayout = new CardLayout(); myErrorStackPanel = new JPanel(myErrorStackLayout); myErrorStackPanel.add(new JLabel(), ERROR_NO_STACK_CARD); myErrorStackPanel.add(ScrollPaneFactory.createScrollPane(myErrorStack), ERROR_STACK_CARD); myErrorPanel.add(myErrorStackPanel, BorderLayout.CENTER); add(myErrorPanel, ERROR_CARD); }