Revision c41a916e
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java | ||
---|---|---|
148 | 148 |
this.dirty.setDirty(isDirty); |
149 | 149 |
} |
150 | 150 |
|
151 |
public boolean isDirty(){ |
|
151 |
@Override |
|
152 |
public boolean isDirty(){ |
|
152 | 153 |
return dirty.isDirty(); |
153 | 154 |
} |
154 | 155 |
|
... | ... | |
209 | 210 |
|
210 | 211 |
CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(getRootEntities()); |
211 | 212 |
|
212 |
Object[] expandedElements = viewer.getExpandedElements(); |
|
213 | 213 |
initialiseRootEntities(); |
214 |
viewer.setExpandedElements(expandedElements); |
|
215 | 214 |
|
216 | 215 |
this.setDirty(false); |
217 | 216 |
} |
218 | 217 |
|
219 | 218 |
private void initialiseRootEntities() { |
219 |
Object[] expandedElements = viewer.getExpandedElements(); |
|
220 | 220 |
viewer.getTree().removeAll(); |
221 | 221 |
List<FeatureTree> trees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null); |
222 | 222 |
viewer.setInput(trees); |
223 |
viewer.setExpandedElements(expandedElements); |
|
223 | 224 |
} |
224 | 225 |
|
225 | 226 |
@PreDestroy |
... | ... | |
300 | 301 |
public boolean postOperation(Object objectAffectedByOperation) { |
301 | 302 |
initialiseRootEntities(); |
302 | 303 |
viewer.refresh(); |
303 |
if(objectAffectedByOperation != null){ |
|
304 |
if(objectAffectedByOperation instanceof FeatureNode){ |
|
305 |
FeatureNode node = (FeatureNode)objectAffectedByOperation; |
|
306 |
viewer.expandToLevel(node.getFeatureTree(), 1); |
|
304 | 307 |
StructuredSelection selection = new StructuredSelection(objectAffectedByOperation); |
305 | 308 |
viewer.setSelection(selection); |
306 |
viewer.expandToLevel(objectAffectedByOperation, 1); |
|
307 | 309 |
} |
308 | 310 |
return true; |
309 | 311 |
} |
Also available in: Unified diff
Fix selection when creating new nodes