Revision fbbfeef9
Added by Katja Luther over 1 year ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OccurrenceStatusElement.java | ||
---|---|---|
13 | 13 |
import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement; |
14 | 14 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
15 | 15 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
16 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
|
16 | 17 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
17 | 18 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
18 | 19 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
... | ... | |
43 | 44 |
super.setEntity(entity); |
44 | 45 |
if (combo_statusType != null){ |
45 | 46 |
DefinedTerm statusType = HibernateProxyHelper.deproxy(entity.getType()); |
46 |
combo_statusType.setSelection(statusType); |
|
47 |
combo_statusType.setSelection(statusType); |
|
48 |
if (statusType == null) { |
|
49 |
Color colorRedSWT = new Color(null, 255, 0, 0); |
|
50 |
combo_statusType.setBackground(colorRedSWT); |
|
51 |
}else { |
|
52 |
combo_statusType.setBackground(NOT_SELECTED); |
|
53 |
} |
|
47 | 54 |
} |
48 | 55 |
this.setSourceLabel("Source"); |
49 | 56 |
|
... | ... | |
65 | 72 |
public void handleEvent(Object eventSource) { |
66 | 73 |
if(eventSource == combo_statusType){ |
67 | 74 |
getEntity().setType(combo_statusType.getSelection()); |
75 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this.getParentElement(), eventSource)); |
|
76 |
if (getEntity().getType() == null) { |
|
77 |
Color colorRedSWT = new Color(null, 255, 0, 0); |
|
78 |
combo_statusType.setBackground(colorRedSWT); |
|
79 |
}else { |
|
80 |
combo_statusType.setBackground(NOT_SELECTED); |
|
81 |
} |
|
68 | 82 |
} |
69 | 83 |
if (getParentElement() instanceof AbstractCdmDetailSection) { |
70 | 84 |
((AbstractCdmDetailSection<?>) getParentElement()).updateTitle(); |
Also available in: Unified diff
ref #10182: do not allow to save derived unit without occurrence status type in wizard