Revision 263f5b99
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
112 | 112 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
113 | 113 |
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation; |
114 | 114 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
115 |
import eu.etaxonomy.taxeditor.editor.IDistributionEditor; |
|
115 | 116 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
116 | 117 |
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement; |
117 | 118 |
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; |
... | ... | |
2941 | 2942 |
* object. |
2942 | 2943 |
*/ |
2943 | 2944 |
public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement( |
2944 |
ICdmFormElement parentElement, DescriptionElementBase entity, int style) { |
|
2945 |
ICdmFormElement parentElement, DescriptionElementBase entity, int style, boolean enabled) {
|
|
2945 | 2946 |
AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null; |
2946 | 2947 |
|
2947 | 2948 |
if (entity instanceof CategoricalData) { |
... | ... | |
2950 | 2951 |
} else if (entity instanceof CommonTaxonName) { |
2951 | 2952 |
detailedDescriptionElement = new CommonNameDetailElement(this, parentElement, (CommonTaxonName) entity, |
2952 | 2953 |
style); |
2953 |
} else if (entity instanceof Distribution ) { |
|
2954 |
} else if (entity instanceof Distribution && !enabled) {
|
|
2954 | 2955 |
detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity, |
2955 | 2956 |
style); |
2956 |
} else if (entity instanceof IndividualsAssociation) { |
|
2957 |
detailedDescriptionElement.setEnabled(enabled); |
|
2958 |
} else if (entity instanceof Distribution) { |
|
2959 |
detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity, |
|
2960 |
style); |
|
2961 |
}else if (entity instanceof IndividualsAssociation) { |
|
2957 | 2962 |
detailedDescriptionElement = new IndividualsAssociationDetailElement(this, parentElement, |
2958 | 2963 |
(IndividualsAssociation) entity, style); |
2959 | 2964 |
} else if (entity instanceof QuantitativeData) { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java | ||
---|---|---|
47 | 47 |
* @author n.hoffmann |
48 | 48 |
* @created Feb 26, 2010 |
49 | 49 |
*/ |
50 |
public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements ICdmDetailElement<T>, Observer {
|
|
50 |
public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements ICdmDetailElement<T>, Observer, IEnableableFormElement{
|
|
51 | 51 |
|
52 | 52 |
private T entity; |
53 | 53 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java | ||
---|---|---|
123 | 123 |
public void setEntity(ENTITY entity) { |
124 | 124 |
if (detailElement != null) { |
125 | 125 |
detailElement.setEntity(entity); |
126 |
detailElement.setEnabled(getEnabled()); |
|
126 | 127 |
} |
127 | 128 |
super.setEntity(entity); |
128 | 129 |
setSectionTitle(); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailElement.java | ||
---|---|---|
39 | 39 |
/** {@inheritDoc} */ |
40 | 40 |
@Override |
41 | 41 |
protected void createControls(ICdmFormElement formElement, DescriptionElementBase entity, int style) { |
42 |
formFactory.createDetailedDescriptionDetailElement(formElement, entity, style); |
|
42 |
formFactory.createDetailedDescriptionDetailElement(formElement, entity, style, isEnabled());
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java | ||
---|---|---|
62 | 62 |
* If it is <code>true</code> then it is currently delaying a selection. |
63 | 63 |
*/ |
64 | 64 |
private boolean isInDelay; |
65 |
private boolean isEnabled; |
|
66 | 65 |
private static final Logger logger = Logger.getLogger(AbstractCdmEditorPartE4.class); |
67 | 66 |
|
68 | 67 |
/** |
... | ... | |
207 | 206 |
((DetailsViewerE4)viewer).setInput(element, part); |
208 | 207 |
}else{ |
209 | 208 |
viewer.setInput(element); |
209 |
if (viewer instanceof DetailsViewerE4){ |
|
210 |
((DetailsViewerE4)viewer).setDetailsEnabled(true); |
|
211 |
} |
|
210 | 212 |
} |
211 | 213 |
selectionProvidingPart = activePart; |
212 | 214 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java | ||
---|---|---|
133 | 133 |
private ISelection selection; |
134 | 134 |
private boolean detailsEnabled = true; |
135 | 135 |
|
136 |
public void setInput(Object input, Object activePart) { |
|
136 |
public boolean isDetailsEnabled() { |
|
137 |
return detailsEnabled; |
|
138 |
} |
|
139 |
|
|
140 |
public void setDetailsEnabled(boolean detailsEnabled) { |
|
141 |
this.detailsEnabled = detailsEnabled; |
|
142 |
} |
|
143 |
|
|
144 |
public void setInput(Object input, Object activePart) { |
|
137 | 145 |
if (activePart instanceof IDistributionEditor){ |
138 | 146 |
detailsEnabled = false; |
139 | 147 |
}else{ |
Also available in: Unified diff
fix the recursion of enable or disable distribution details in distribution editor and from factual data view