Revision 8407c42c
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java | ||
---|---|---|
129 | 129 |
} |
130 | 130 |
} |
131 | 131 |
|
132 |
if(columnIndex >2 || (!PreferencesUtil.isShowRankInChecklistEditor() && columnIndex > 1)){
|
|
132 |
if(columnIndex >2 || (!PreferencesUtil.isShowRankInChecklistEditor() && columnIndex > 0)){
|
|
133 | 133 |
|
134 | 134 |
for (TaxonDescription td : listTaxonDescriptions) { |
135 | 135 |
for (DescriptionElementBase deb : td.getElements()) { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java | ||
---|---|---|
153 | 153 |
if (!PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){ |
154 | 154 |
sameArea = column.getText().equalsIgnoreCase(term.getTitleCache()); |
155 | 155 |
} else{ |
156 |
sameArea = column.getText().equalsIgnoreCase(term.getIdInVocabulary()); |
|
156 |
if (term.getIdInVocabulary() != null){ |
|
157 |
sameArea = column.getText().equalsIgnoreCase(term.getIdInVocabulary()); |
|
158 |
} else{ |
|
159 |
sameArea = column.getText().equalsIgnoreCase(term.getTitleCache()); |
|
160 |
} |
|
157 | 161 |
} |
158 | 162 |
if (sameArea) { |
159 | 163 |
NamedArea area = (NamedArea) term; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LabelElement.java | ||
---|---|---|
11 | 11 |
package eu.etaxonomy.taxeditor.ui.element; |
12 | 12 |
|
13 | 13 |
import org.eclipse.swt.SWT; |
14 |
import org.eclipse.swt.graphics.Color; |
|
15 |
import org.eclipse.swt.graphics.FontData; |
|
14 | 16 |
import org.eclipse.swt.widgets.Label; |
17 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
15 | 18 |
|
16 | 19 |
import eu.etaxonomy.cdm.common.CdmUtils; |
17 | 20 |
|
... | ... | |
49 | 52 |
public void setText(String text) { |
50 | 53 |
label.setText(CdmUtils.Nz(text)); |
51 | 54 |
} |
55 |
|
|
56 |
public void setLayout(TableWrapData layoutConstants){ |
|
57 |
label.setLayoutData(layoutConstants); |
|
58 |
} |
|
59 |
|
|
60 |
public void setForeground(Color color){ |
|
61 |
label.setForeground(color); |
|
62 |
} |
|
52 | 63 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.ui.section.reference; |
12 | 12 |
|
13 |
|
|
13 | 14 |
import java.util.ArrayList; |
14 | 15 |
import java.util.Arrays; |
15 | 16 |
import java.util.List; |
16 | 17 |
|
17 | 18 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.widgets.Display; |
|
20 |
import org.eclipse.swt.widgets.Label; |
|
21 |
import org.eclipse.swt.graphics.Color; |
|
22 |
import org.eclipse.swt.graphics.FontData; |
|
18 | 23 |
|
24 |
import eu.etaxonomy.cdm.common.CdmUtils; |
|
19 | 25 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
20 | 26 |
import eu.etaxonomy.cdm.model.agent.Institution; |
21 | 27 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
22 | 28 |
import eu.etaxonomy.cdm.model.reference.Reference; |
23 | 29 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
24 | 30 |
import eu.etaxonomy.cdm.model.reference.ReferenceType; |
31 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
25 | 32 |
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement; |
26 | 33 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
27 | 34 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
28 | 35 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
29 | 36 |
import eu.etaxonomy.taxeditor.ui.element.IErrorIntolerableElement; |
30 | 37 |
import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler; |
38 |
import eu.etaxonomy.taxeditor.ui.element.LabelElement; |
|
39 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
|
31 | 40 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
32 | 41 |
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement; |
33 | 42 |
import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement; |
... | ... | |
47 | 56 |
public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElement<Reference> |
48 | 57 |
implements IErrorIntolerableElement, IExceptionHandler { |
49 | 58 |
|
59 |
private LabelElement warnForReferencedObjects; |
|
60 |
|
|
50 | 61 |
private ToggleableTextElement toggleableAbbrevCache; |
51 | 62 |
|
52 | 63 |
private TextWithLabelElement text_edition; |
... | ... | |
102 | 113 |
@Override |
103 | 114 |
protected void createControls(ICdmFormElement formElement, |
104 | 115 |
Reference entity, int style) { |
116 |
setWarnForReferencingObjects(formElement); |
|
117 |
|
|
105 | 118 |
toggleable_cache = formFactory.createToggleableTextField(formElement, |
106 | 119 |
"Reference Cache", entity.getTitleCache(), |
107 | 120 |
entity.isProtectedTitleCache(), style); |
... | ... | |
588 | 601 |
} |
589 | 602 |
setIrrelevant(pushedState, except); |
590 | 603 |
} |
604 |
|
|
605 |
public void setWarnForReferencingObjects(ICdmFormElement formElement){ |
|
606 |
Integer referencingObjectsCount = CdmStore.getCommonService().getReferencingObjectsCount(getEntity()); |
|
607 |
if (referencingObjectsCount > 1){ |
|
608 |
if (warnForReferencedObjects == null){ |
|
609 |
warnForReferencedObjects = formFactory.createLabel(formElement, CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects")); |
|
610 |
warnForReferencedObjects.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); |
|
611 |
warnForReferencedObjects.setLayout(LayoutConstants.FILL(2, 2)); |
|
612 |
warnForReferencedObjects.setForeground(Display.getCurrent().getSystemColor( |
|
613 |
SWT.COLOR_RED)); |
|
614 |
|
|
615 |
}else{ |
|
616 |
warnForReferencedObjects.setText(CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects")); |
|
617 |
} |
|
618 |
} |
|
619 |
} |
|
620 |
|
|
591 | 621 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceWizardPage.java | ||
---|---|---|
13 | 13 |
import org.eclipse.swt.SWT; |
14 | 14 |
|
15 | 15 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
16 |
import eu.etaxonomy.cdm.api.service.CommonServiceImpl; |
|
17 |
import eu.etaxonomy.cdm.api.service.ReferenceServiceImpl; |
|
16 | 18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
19 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
17 | 20 |
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage; |
18 | 21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
19 | 22 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
... | ... | |
49 | 52 |
/** {@inheritDoc} */ |
50 | 53 |
@Override |
51 | 54 |
public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){ |
55 |
//TODO: looking for referencing objects |
|
52 | 56 |
ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL); |
53 | 57 |
referenceElement.addExceptionHandler(this); |
54 | 58 |
referenceElement.setEntity(entity); |
59 |
|
|
55 | 60 |
return referenceElement; |
56 | 61 |
} |
57 | 62 |
|
Also available in: Unified diff
ref #6159: fix that some column show no data