class RelationshipEditionDialog implements PropertyEditionPopup {

    void enableRelationDependentFields(RelationType relationType) {
        if (relationType != null) {
            switch (relationType) {
                case ONE_TO_ONE:
                    view.setOptionalVisible(true);
                    view.setMappedByVisible(true);
                    view.setOrphanRemovalVisible(true);
                    break;
                case ONE_TO_MANY:
                    view.setOptionalVisible(false);
                    view.setMappedByVisible(true);
                    view.setOrphanRemovalVisible(true);
                    break;
                case MANY_TO_ONE:
                    view.setOptionalVisible(true);
                    view.setMappedByVisible(false);
                    view.setOrphanRemovalVisible(false);
                    break;
                case MANY_TO_MANY:
                    view.setOptionalVisible(false);
                    view.setMappedByVisible(true);
                    view.setOrphanRemovalVisible(false);
            }
        }
    }

    @Inject public  RelationshipEditionDialog(View view);

}