class RelationshipEditionDialog implements PropertyEditionPopup {

    void onCascadeAllChanged() {
        if (view.getCascadeAll()) {
            enableCascadeTypes(true, false);
            view.setCascadePersist(true);
            view.setCascadeMerge(true);
            view.setCascadeRemove(true);
            view.setCascadeRefresh(true);
            view.setCascadeDetach(true);
        } else {
            enableCascadeTypes(true, true);
            if (cascadeAllWasClicked) {
                //if cascade is clicked for second time then we can enable the auto disabling mode
                view.setCascadePersist(false);
                view.setCascadeMerge(false);
                view.setCascadeRemove(false);
                view.setCascadeRefresh(false);
                view.setCascadeDetach(false);
            }
        }
        cascadeAllWasClicked = true;
    }

    @Inject public  RelationshipEditionDialog(View view);

}