import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.ColorResources;
import eu.etaxonomy.taxeditor.preference.Resources;
-import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
private CheckboxElement orderRelevant;
private CheckboxElement isFlat;
- //private TextWithLabelElement titleCacheText;
+ private TextWithLabelElement titleCacheText;
protected RepresentationElement element_Representation;
public TermTreeDetailElement(CdmFormFactory formFactory,
lblStructureText.setText(entity.getTermType().getLabel());
lblStructureText.setForeground(ColorResources.getColor(Resources.BLACK));
-// titleCacheText = formFactory.createTextWithLabelElement(
-// formElement, "Title Cache", entity.getTitleCache(), style);
- element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement, entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
+ titleCacheText = formFactory.createTextWithLabelElement(
+ formElement, "Title Cache", entity.getTitleCache(), style);
+ //element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement, entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
allowDuplicates = formFactory.createCheckbox(formElement, "Allow duplicates", entity.isAllowDuplicate(), style);
if (entity.isContainsDuplicates() && entity.isAllowDuplicate()){
allowDuplicates.setEnabled(false);
@Override
public void handleEvent(Object eventSource) {
+ if (eventSource == titleCacheText) {
+ getEntity().setTitleCache(titleCacheText.getText());
+ }
if (eventSource == element_Representation) {
// getEntity().setTitleCache(titleCacheText.getText());
Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
getEntity().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
}
}
- getEntity().setTitleCache(null);
+ //getEntity().setTitleCache(null);
}
else
if (eventSource == allowDuplicates) {
orderRelevant.setSelection(getEntity().isOrderRelevant());
isFlat.setSelection(getEntity().isFlat());
element_Representation.setTermDto(getEntity(), enabled);
-
+
}
}
\ No newline at end of file