Revision 0f80fd67
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java | ||
---|---|---|
124 | 124 |
Collection<MPart> parts = partService.getParts(); |
125 | 125 |
//check if part is already opened |
126 | 126 |
for (MPart part : parts) { |
127 |
if (part.getObject() instanceof TaxonNameEditorE4){ |
|
128 |
System.out.println(((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid() + " - " + ((TaxonNameEditorE4) part.getObject()).getTaxon().getTitleCache()); |
|
129 |
System.out.println(input.getTaxon().getUuid() + " - " + input.getTaxon().getTitleCache()); |
|
130 |
} |
|
127 | 131 |
if(part.getObject() instanceof TaxonNameEditorE4 |
128 | 132 |
&& ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null |
129 |
&& ((TaxonNameEditorE4) part.getObject()).getTaxon().equals(input.getTaxon())){
|
|
133 |
&& ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(input.getTaxon().getUuid())){
|
|
130 | 134 |
//close part to invoke refresh for new part |
131 | 135 |
partService.hidePart(part); |
132 |
break; |
|
136 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject(); |
|
137 |
editor.init(input); |
|
138 |
return; |
|
133 | 139 |
} |
134 | 140 |
} |
135 | 141 |
MPart part = partService.createPart(NAME_EDITOR_ID); |
... | ... | |
330 | 336 |
} |
331 | 337 |
} |
332 | 338 |
} |
339 |
|
|
340 |
public static void updateEditor(TaxonNode taxonNode, EPartService partService, MApplication application){ |
|
341 |
String treeIndex = taxonNode.treeIndex(); |
|
342 |
Collection<MPart> parts = partService.getParts(); |
|
343 |
for (MPart part : parts) { |
|
344 |
Object object = part.getObject(); |
|
345 |
if(object instanceof TaxonNameEditorE4){ |
|
346 |
TaxonNameEditorE4 taxonEditor = (TaxonNameEditorE4)object; |
|
347 |
TaxonNode node = taxonEditor.getEditorInput().getTaxonNode(); |
|
348 |
if(node.treeIndex().startsWith(treeIndex)){ |
|
349 |
TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstanceFromTaxonBase(node.getTaxon().getUuid()); |
|
350 |
taxonEditor.init(input); |
|
351 |
} |
|
352 |
} |
|
353 |
} |
|
354 |
} |
|
333 | 355 |
} |
Also available in: Unified diff
ref #7065: refresh open nameEditors when using update subtree operations