class DialogDescriptorWithValidation implements ValidationUI {

    private final DialogDescriptor dialogDescriptor;

    private DialogDescriptorWithValidation(DialogDescriptor dialogDescriptor) {
        this.dialogDescriptor = dialogDescriptor;
    }

    public static DialogDescriptor dialog(Object innerPane, String title) {<FILL_FUNCTION_BODY>}

    @Override
    public void showProblem(Problem problem) {
        dialogDescriptor.setValid(!problem.isFatal());
    }

    @Override
    public void clearProblem() {
        dialogDescriptor.setValid(true);
    }
}

        DialogDescriptor dd = new DialogDescriptor(innerPane, title);
        if (innerPane instanceof ValidationPanel) {
            ((ValidationPanel) innerPane).getValidationGroup().addUI(new DialogDescriptorWithValidation(dd));
        }
        return dd;
    
<no_super_class>