/** * <p>Constructs and shows the error dialog, using the given * <code>ErrorInfo</code> to initialize the view.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the dialog shown will be modal. Otherwise, this thread will * block until the error dialog has been shown and hidden on the EDT.</p> * * @param owner Owner of this error dialog. Determines the Window in which the dialog * is displayed; if the <code>owner</code> has * no <code>Window</code>, a default <code>Frame</code> is used * @param info <code>ErrorInfo</code> that incorporates all the information about the error */ public static void showDialog(Component owner, ErrorInfo info) { JXErrorPane pane = new JXErrorPane(); pane.setErrorInfo(info); showDialog(owner, pane); }
@Override public void run() { JDialog dlg = createDialog(owner, pane); dlg.setVisible(true); } };
/** * Create and install the listeners for the Error Pane. * This method is called when the UI is installed. */ protected void installListeners() { //add a listener to the pane so I can reinit() whenever the //bean properties change (particularly error info) errorPaneListener = new ErrorPaneListener(); pane.addPropertyChangeListener(errorPaneListener); }
/** * <p>Constructs and shows the error frame, using the given * <code>ErrorInfo</code> to initialize the view.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the frame shown will be modal. Otherwise, this thread will * block until the error frame has been shown and hidden on the EDT.</p> * * @param owner Owner of this error frame. Determines the Window in which the frame * is displayed; if the <code>owner</code> has * no <code>Window</code>, a default <code>Frame</code> is used * @param info <code>ErrorInfo</code> that incorporates all the information about the error */ public static void showFrame(Component owner, ErrorInfo info) { JXErrorPane pane = new JXErrorPane(); pane.setErrorInfo(info); showFrame(owner, pane); }
/** * <p>Constructs and shows the error frame, using the given * <code>ErrorInfo</code> to initialize the view.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the frame shown will be modal. Otherwise, this thread will * block until the error frame has been shown and hidden on the EDT.</p> * * @param owner Owner of this error frame. Determines the Window in which the frame * is displayed; if the <code>owner</code> has * no <code>Window</code>, a default <code>Frame</code> is used * @param info <code>ErrorInfo</code> that incorporates all the information about the error */ public static void showInternalFrame(Component owner, ErrorInfo info) { JXErrorPane pane = new JXErrorPane(); pane.setErrorInfo(info); showInternalFrame(owner, pane); }
iconLabel = new JLabel(pane.getIcon()); CLASS_NAME + ".ok_button_text", errorMessage.getLocale())); reportButton = new EqualSizeJButton(pane.getActionMap().get(JXErrorPane.REPORT_ACTION_KEY)); pane.setLayout(createErrorPaneLayout()); pane.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right)); pane.add(iconLabel); pane.add(errorScrollPane); pane.add(closeButton); pane.add(reportButton); reportButton.setVisible(false); // not visible by default pane.add(detailButton); pane.add(detailsPanel);
/** * Display a user friendly error frame. * * @param parent parent component * @param message message for user * @param cause exception cause */ public static void showErrorDialog(Component parent, String message, Throwable cause) { JXErrorPane pane = new JXErrorPane(); String details = "<pre>\n" + getDetails(cause) + "\n</pre>"; ErrorInfo info = new ErrorInfo(t("isisfish.error.errorpane.title"), t("isisfish.error.errorpane.htmlmessage", message), details, null, cause, null, null); pane.setErrorInfo(info); if (cause != null) { pane.setErrorReporter(new ErrorHelper()); } JXErrorPane.showDialog(parent, pane); }
collapsedHeight = pane.getHeight(); pane.setSize(pane.getWidth(), expandedHeight == 0 ? collapsedHeight + getDetailsHeight() : expandedHeight); detailsPanel.setVisible(true); configureDetailsButton(true); details.setCaretPosition(0); } else if (collapsedHeight != 0) { //only collapse if the dialog has been expanded expandedHeight = pane.getHeight(); detailsPanel.setVisible(false); configureDetailsButton(false); pane.setSize(pane.getWidth(), collapsedHeight); } else { detailsPanel.setVisible(false); pane.doLayout();
public static void showErrorMessage(final String shortMessage, final String detailedMessage, final Throwable exception) { final Throwable presentedException = ErrorUtils.unwrapForPresentation(exception); if (exception == null) { showErrorMessage(shortMessage, detailedMessage); return; } final String finalDetailedMessage = detailedMessage == null ? "" : detailedMessage; final String finalShortMessage = shortMessage == null ? "" : shortMessage; final ErrorInfo info = new ErrorInfo(finalShortMessage, finalDetailedMessage, null, "error", presentedException, ErrorLevel.SEVERE, null); final JXErrorPane errorPane = new JXErrorPane(); errorPane.setErrorInfo(info); final JDialog dialog = JXErrorPane.createDialog(null, errorPane); centerOnScreen(dialog); JXErrorPane.setDefaultLocale(Locale.ENGLISH); dialog.setLocale(Locale.ENGLISH); dialog.setModal(true); dialog.setTitle(finalShortMessage); dialog.setVisible(true); dialog.toFront(); }
JFrame window = pane.getUI().getErrorFrame(owner); pane.applyComponentOrientation(owner.getComponentOrientation()); } else { pane.applyComponentOrientation(window.getComponentOrientation());
/** * <p>Constructs and shows the error dialog for the given exception. The * exceptions message will be the errorMessage, and the stacktrace will form * the details for the error dialog.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the dialog shown will be modal. Otherwise, this thread will * block until the error dialog has been shown and hidden on the EDT.</p> * * @param e Exception that contains information about the error cause and stack trace */ public static void showDialog(Throwable e) { ErrorInfo ii = new ErrorInfo(null, null, null, null, e, null, null); showDialog(null, ii); }
JXErrorPane errorPane = new JXErrorPane(); if (builder.isActiveReport()) { if (defaultStateErrorInfo != null) { errorPane.setErrorReporter(errorReporter); errorPane.setErrorInfo(errorInfo); showDialog(parent, errorPane);
@Override public void run() { JFrame window = createFrame(owner, pane); window.setVisible(true); } };
@Override public void run() { JInternalFrame window = createInternalFrame(owner, pane); window.setVisible(true); } };
/** * <p>Constructs and shows the error frame, using the given * <code>ErrorInfo</code> to initialize the view.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the frame shown will be modal. Otherwise, this thread will * block until the error frame has been shown and hidden on the EDT.</p> * * @param owner Owner of this error frame. Determines the Window in which the frame * is displayed; if the <code>owner</code> has * no <code>Window</code>, a default <code>Frame</code> is used * @param info <code>ErrorInfo</code> that incorporates all the information about the error */ public static void showFrame(Component owner, ErrorInfo info) { JXErrorPane pane = new JXErrorPane(); pane.setErrorInfo(info); showFrame(owner, pane); }
/** * <p>Constructs and shows the error frame, using the given * <code>ErrorInfo</code> to initialize the view.</p> * * <p>This method may be called from any thread. It will actually show the error * dialog on the AWT event dispatch thread. This method blocks. If called * on the EDT, the frame shown will be modal. Otherwise, this thread will * block until the error frame has been shown and hidden on the EDT.</p> * * @param owner Owner of this error frame. Determines the Window in which the frame * is displayed; if the <code>owner</code> has * no <code>Window</code>, a default <code>Frame</code> is used * @param info <code>ErrorInfo</code> that incorporates all the information about the error */ public static void showInternalFrame(Component owner, ErrorInfo info) { JXErrorPane pane = new JXErrorPane(); pane.setErrorInfo(info); showInternalFrame(owner, pane); }
iconLabel = new JLabel(pane.getIcon()); CLASS_NAME + ".ok_button_text", errorMessage.getLocale())); reportButton = new EqualSizeJButton(pane.getActionMap().get(JXErrorPane.REPORT_ACTION_KEY)); pane.setLayout(createErrorPaneLayout()); pane.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right)); pane.add(iconLabel); pane.add(errorScrollPane); pane.add(closeButton); pane.add(reportButton); reportButton.setVisible(false); // not visible by default pane.add(detailButton); pane.add(detailsPanel);
} else { JXErrorPane pane = new JXErrorPane(); ErrorInfo info = new ErrorInfo(t("jaxx.application.error.ui.other.error"), t("jaxx.application.error.errorpane.htmlmessage", message), null, null, cause, null, null); pane.setErrorInfo(info); pane.setErrorReporter(this); ApplicationActionUI actionUI = context.getActionUI(); if (actionUI != null) { actionUI.close(); JXErrorPane.showDialog(context.getMainUI(), pane);
collapsedHeight = pane.getHeight(); pane.setSize(pane.getWidth(), expandedHeight == 0 ? collapsedHeight + getDetailsHeight() : expandedHeight); detailsPanel.setVisible(true); configureDetailsButton(true); details.setCaretPosition(0); } else if (collapsedHeight != 0) { //only collapse if the dialog has been expanded expandedHeight = pane.getHeight(); detailsPanel.setVisible(false); configureDetailsButton(false); pane.setSize(pane.getWidth(), collapsedHeight); } else { detailsPanel.setVisible(false); pane.doLayout();