public void mouseClicked(MouseEvent e) { if (renderException != null) { int mx = e.getX(); if (mx > getWidth() - 100) { ExceptionDialog dialog = new ExceptionDialog(null, renderException); dialog.setModal(true); dialog.setVisible(true); } } }
/** * Call it via: * * <pre>ExceptionUtility.exceptionDialog(myFrame, myException, Utility.getLineInf());</pre> * * @param argFrame * @param argException * @param argLineInfo */ public static void exceptionDialog( final Frame argFrame, final Exception argException, final String argLineInfo) { final String eof = System.getProperty("line.separator"); ExceptionDialog ed = new ExceptionDialog(argFrame, true); String exceptionString = argException + eof + ":::::::::::::::::::::::::::::::::" + eof; ed.setInfo(argLineInfo); ed.setExceptionText( exceptionString + ExceptionUtility.getStackTrace(argException.getStackTrace())); ed.setLocationRelativeTo(argFrame); ed.setVisible(true); } // exceptionDialog() method
public static void openExceptionBox(Throwable e, String title, String message, Shell shell) { if (shell == null) { LOG.error(title, e); LOG.error(message, e); } e.printStackTrace(); String eMessage = e.getMessage() == null ? e.toString() : e.getMessage(); if (shell != null) { ExceptionDialog.openError( shell, title, message, new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, eMessage, e)); } }
public static void showExceptionDialog(String header, String content, Throwable throwable) { ExceptionDialog.create(header, content, throwable).showAndWait(); }