Revision 39392527
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java | ||
---|---|---|
96 | 96 |
public static void openDistributionEditor(UUID parentTaxonUuid, EModelService modelService, EPartService partService, MApplication application){ |
97 | 97 |
Collection<MPart> parts = partService.getParts(); |
98 | 98 |
String partId = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_CHECKLIST_E4_DISTRIBUTIONEDITORPART; |
99 |
String partIdFactualData = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVE_E4_FACTUALDATAPARTE4; |
|
100 |
String partIdMedia = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_MEDIA_E4_MEDIAVIEWPARTE4; |
|
101 |
closePart(partIdMedia, partService); |
|
102 |
closePart(partIdFactualData, partService); |
|
99 | 103 |
MPart part = showPart(partId, modelService, partService, application); |
100 | 104 |
DistributionEditorPart editor = (DistributionEditorPart) part.getObject(); |
101 | 105 |
editor.init(parentTaxonUuid); |
... | ... | |
136 | 140 |
return partService.showPart(part, PartState.ACTIVATE); |
137 | 141 |
} |
138 | 142 |
|
143 |
public static MPart showPart(String partId, EModelService modelService, EPartService partService){ |
|
144 |
MPart part = partService.findPart(partId); |
|
145 |
if(part==null || modelService.getPartDescriptor(partId).isAllowMultiple()){ |
|
146 |
part = partService.createPart(partId); |
|
147 |
partService.activate(part); |
|
148 |
}else{ |
|
149 |
partService.activate(part); |
|
150 |
} |
|
151 |
|
|
152 |
return part; |
|
153 |
} |
|
154 |
|
|
139 | 155 |
public static void openTaxonNodeE4(UUID taxonNodeUuid, EModelService modelService, EPartService partService, MApplication application) { |
140 | 156 |
TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstance(taxonNodeUuid); |
141 | 157 |
openNameEditor_internal(input, modelService, partService, application); |
... | ... | |
188 | 204 |
|
189 | 205 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject(); |
190 | 206 |
editor.init(input); |
207 |
String partIdFactualData = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVE_E4_FACTUALDATAPARTE4; |
|
208 |
String partIdMedia = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_MEDIA_E4_MEDIAVIEWPARTE4; |
|
209 |
showPart(partIdMedia, modelService, partService); |
|
210 |
showPart(partIdFactualData, modelService, partService); |
|
191 | 211 |
} |
192 | 212 |
|
193 | 213 |
public static MPart checkForChanges(UUID taxonUUID, EPartService partService ){ |
... | ... | |
370 | 390 |
} |
371 | 391 |
} |
372 | 392 |
|
393 |
|
|
394 |
public static void closePart(String partID, EPartService partService){ |
|
395 |
|
|
396 |
Collection<MPart> parts = partService.getParts(); |
|
397 |
for (MPart part : parts) { |
|
398 |
String elementId = part.getElementId(); |
|
399 |
if (elementId.equals(partID)){ |
|
400 |
partService.hidePart(part); |
|
401 |
} |
|
402 |
} |
|
403 |
} |
|
404 |
|
|
373 | 405 |
public static void updateEditor(TaxonNode taxonNode, TaxonNameEditorE4 editor){ |
374 | 406 |
String treeIndex = taxonNode.treeIndex(); |
375 | 407 |
TaxonNode node = editor.getEditorInput().getTaxonNode(); |
Also available in: Unified diff
ref #7854: close factual data view when opening distribution editor and open it when opening name editor