Revision d31115e0
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java | ||
---|---|---|
194 | 194 |
public boolean postOperation(CdmBase objectAffectedByOperation) { |
195 | 195 |
boolean result = super.postOperation(objectAffectedByOperation); |
196 | 196 |
|
197 |
if(objectAffectedByOperation != null){ |
|
198 |
|
|
199 |
if(objectAffectedByOperation instanceof DescriptionElementBase){ |
|
200 |
DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation; |
|
201 |
FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement); |
|
202 |
viewer.expandToLevel(container, 1); |
|
203 |
} |
|
204 |
|
|
205 |
StructuredSelection selection = new StructuredSelection(objectAffectedByOperation); |
|
206 |
viewer.setSelection(selection, true); |
|
207 |
} |
|
197 |
// if(objectAffectedByOperation != null){ |
|
198 |
// |
|
199 |
// if(objectAffectedByOperation instanceof DescriptionElementBase){ |
|
200 |
// DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation; |
|
201 |
// FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
202 |
// FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement); |
|
203 |
//// viewer.refresh(featureNodeContainer, true); |
|
204 |
// viewer.expandToLevel(featureNodeContainer, 1); |
|
205 |
// } |
|
206 |
// |
|
207 |
// StructuredSelection selection = new StructuredSelection(objectAffectedByOperation); |
|
208 |
// viewer.setSelection(selection, true); |
|
209 |
// }else{ |
|
210 |
//// viewer.refresh(); |
|
211 |
// } |
|
208 | 212 |
|
209 | 213 |
return result; |
210 | 214 |
} |
211 |
|
|
212 |
/** |
|
213 |
* |
|
214 |
* @param descriptionElement |
|
215 |
* @return |
|
216 |
*/ |
|
217 |
private FeatureNodeContainer getFeatureNodeContainerForDescriptionElement( |
|
218 |
DescriptionElementBase descriptionElement) { |
|
219 |
FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
220 |
FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.getFeatureNodeContainerForDescriptionElement(descriptionElement); |
|
221 |
return featureNodeContainer; |
|
222 |
} |
|
223 | 215 |
|
224 | 216 |
/** {@inheritDoc} */ |
225 | 217 |
@Override |
226 | 218 |
public void changed(Object object) { |
227 |
// viewer.refresh(true); |
|
228 |
// viewer.update(object, null); |
|
229 |
viewer.refresh(object, true); |
|
219 |
if(object instanceof DescriptionElementBase){ |
|
220 |
DescriptionElementBase descriptionElement = (DescriptionElementBase) object; |
|
221 |
FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
222 |
FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement); |
|
223 |
viewer.refresh(featureNodeContainer, true); |
|
224 |
viewer.expandToLevel(featureNodeContainer, 1); |
|
225 |
|
|
226 |
}else{ |
|
227 |
viewer.refresh(true); |
|
228 |
} |
|
229 |
|
|
230 |
if(object != null){ |
|
231 |
StructuredSelection selection = new StructuredSelection(object); |
|
232 |
viewer.setSelection(selection, true); |
|
233 |
} |
|
234 |
|
|
230 | 235 |
super.changed(object); |
231 | 236 |
} |
232 | 237 |
|
Also available in: Unified diff
added a readme file