vaadin/src/main/java/net/typedrest/vaadin/views/ElementView.java
protected void delete() {
        String question = "Are you sure you want to delete " + getCaption() + "?";
        ConfirmDialog.show(getUI(), question, (ConfirmDialog cd) -> {
            if (cd.isConfirmed()) {
                try {
                    onDelete();
                    close();
                } catch (IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex) {
                    onError(ex);
                } catch (RuntimeException ex) {
                    // Must explicitly send unhandled exceptions to error handler.
                    // Would otherwise get swallowed silently within callback handler.
                    getUI().getErrorHandler().error(new com.vaadin.server.ErrorEvent(ex));
                }
            }
        });
    }
protected void delete() {
        String question = "Are you sure you want to delete " + getCaption() + "?";
        ConfirmDialog.show(getUI(), question, (ConfirmDialog cd) -> {
            if (cd.isConfirmed()) {
                try {
                    onDelete();
                    close();
                } catch (IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex) {
                    onError(ex);
                } catch (RuntimeException ex) {
                    // Must explicitly send unhandled exceptions to error handler.
                    // Would otherwise get swallowed silently within callback handler.
                    getUI().getErrorHandler().error(new com.vaadin.server.ErrorEvent(ex));
                }
            }
        });
    }
Deletes the element.