public class DerivedUnitGeneralDetailElement extends
AbstractCdmDetailElement<DerivedUnitFacade> {
+ boolean showOnlyDerivedUnitData = false;
+
private ToggleableTextElement toggleableText_titleCache;
private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
private EntitySelectionElement<NamedArea> selection_country;
private GatheringEventUnitElement element_elevation;
-
/**
* @param formFactory
* @param formElement
*/
public DerivedUnitGeneralDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
- super(formFactory, formElement);
+ super(formFactory, formElement);
}
/*
toggleableText_titleCache = formFactory.createToggleableTextField(
formElement, "Title Cache", entity.getTitleCache(),
entity.isProtectedTitleCache(), style);
- if((AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
+ //TODO for DerivateEditor do not use facade anyore to avoid this special case handling #4539
+ if(showOnlyDerivedUnitData){
+ toggleableText_titleCache.setEnabled(false);
+ }
+ else{
combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
combo_specorobstype.setSelection(entity.getType());
selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
text_collectingNumber = formFactory.createTextWithLabelElement(formElement,
"Collecting number", entity.getFieldNumber(), style);
}
- else{
- toggleableText_titleCache.setEnabled(false);
- }
selection_collection = formFactory
.createSelectionElement(Collection.class,
getConversationHolder(), formElement, "Collection",
toggleableText_titleCache.setText(getEntity().getTitleCache());
}
}
+
+ public void setShowOnlyDerivedUnitData(boolean showOnlyDerivedUnitData) {
+ this.showOnlyDerivedUnitData = showOnlyDerivedUnitData;
+ }
}
*/
public class DerivedUnitGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
- /**
+ //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
+ private DerivedUnitGeneralDetailElement derivedUnitGeneralDetailElement;
+
+ /**
* @param formFactory
* @param conversation
* @param parentElement
*/
@Override
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
- return formFactory.createDerivedUnitGeneralDetailElement(parentElement);
+ derivedUnitGeneralDetailElement = formFactory.createDerivedUnitGeneralDetailElement(parentElement);
+ return derivedUnitGeneralDetailElement;
+ }
+
+ public void setShowOnlyDerivedUnitData(boolean showOnlyDerivedUnitData){
+ derivedUnitGeneralDetailElement.setShowOnlyDerivedUnitData(showOnlyDerivedUnitData);
}
}
destroySections();
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
+ if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
+ derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
+ }
addPart(derivedUnitGeneralDetailSection);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);