Search in sources :

Example 1 with JXErrorPaneExt

use of com.haulmont.cuba.desktop.sys.JXErrorPaneExt in project cuba by cuba-platform.

the class DefaultExceptionHandler method handle.

@Override
public boolean handle(Thread thread, Throwable exception) {
    JXErrorPane errorPane = new JXErrorPaneExt();
    errorPane.setErrorInfo(createErrorInfo(exception));
    JDialog dialog = JXErrorPane.createDialog(App.getInstance().getMainFrame(), errorPane);
    dialog.setMinimumSize(new Dimension(600, (int) dialog.getMinimumSize().getHeight()));
    final DialogWindow lastDialogWindow = getLastDialogWindow();
    dialog.addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosed(WindowEvent e) {
            if (lastDialogWindow != null)
                lastDialogWindow.enableWindow();
            else
                App.getInstance().getMainFrame().activate();
        }
    });
    dialog.setModal(false);
    if (lastDialogWindow != null)
        lastDialogWindow.disableWindow(null);
    else
        App.getInstance().getMainFrame().deactivate(null);
    dialog.setVisible(true);
    return true;
}
Also used : JXErrorPaneExt(com.haulmont.cuba.desktop.sys.JXErrorPaneExt) WindowEvent(java.awt.event.WindowEvent) WindowAdapter(java.awt.event.WindowAdapter) JXErrorPane(org.jdesktop.swingx.JXErrorPane) DialogWindow(com.haulmont.cuba.desktop.sys.DialogWindow)

Aggregations

DialogWindow (com.haulmont.cuba.desktop.sys.DialogWindow)1 JXErrorPaneExt (com.haulmont.cuba.desktop.sys.JXErrorPaneExt)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 JXErrorPane (org.jdesktop.swingx.JXErrorPane)1