@Test public void testRelationDependentFieldsManyToMany() { dialog.enableRelationDependentFields(RelationType.MANY_TO_MANY); verifyRelationDependentFields(RelationType.MANY_TO_MANY); }
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); } } }
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); } } } }
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  RelationshipEditionDialog(View view); }
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  RelationshipEditionDialog(View view); @Override Widget asWidget(); @Override @SuppressWarnings("unchecked") void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value); }
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  RelationshipEditionDialog(View view); @Override Widget asWidget(); @Override @SuppressWarnings("unchecked") void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value);  }