import eu.etaxonomy.cdm.api.service.IClassificationService;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch;
import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeComparator;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
if (PreferencesUtil.getSortNodesNaturally()){
comparator = new TaxonNaturalComparator();
} else{
- comparator = new TaxonComparatorSearch();
+ comparator = new TaxonNodeComparator();
}
- TaxonNodeComparator viewerComparator = new TaxonNodeComparator(comparator);
+ TaxonNodeNavigatorComparator viewerComparator = new TaxonNodeNavigatorComparator(comparator);
this.getCommonViewer().setComparator(viewerComparator);
setLinkingEnabled(true);
// this.getCommonViewer().addSelectionChangedListener(new ISelectionChangedListener() {
getConversationHolder().commit();
}
}
- if (cdmEntitySession != null) {
- cdmEntitySession.fireNotifications();
- }
getCommonViewer().refresh();
}
* Refresh this navigators viewer
*/
public void refresh(Set objects) {
-
for(Object obj : objects) {
getCommonViewer().refresh(obj);
}
*/
@Override
public void onChange(CdmChangeEvent event) {
- // TODO Auto-generated method stub
+ for(CdmBase cb : event.getChangedObjects()) {
+ if(cb instanceof TaxonNode) {
+ getCommonViewer().refresh(cb);
+ } else if (cb instanceof Classification) {
+ getCommonViewer().refresh();
+ }
+ }
}
}