+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
+ */
+ @Override
+ public ICdmEntitySession getCdmEntitySession() {
+ return cdmEntitySession;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
+ */
+ @Override
+ public List<ITreeNode> getRootEntities() {
+ if(root != null) {
+ return root.getParentBeans();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+// if(event.getAction() == Action.Delete && Classification.class.equals(event.getEntityType())) {
+// refresh();
+// return;
+// }
+ refresh();
+ for(CdmBase cb : event.getChangedObjects()) {
+ if(cb instanceof TaxonNode) {
+ TaxonNode tn = (TaxonNode)cb;
+ if(tn.getTaxon() == null) {
+ getCommonViewer().refresh(tn.getClassification());
+ } else {
+ getCommonViewer().refresh(cb);
+ }
+ } else if (cb instanceof Classification) {
+ getCommonViewer().refresh();
+ }
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
+ List<String> taxonNodePropertyPaths = Arrays.asList(new String[] {
+ "taxon.name" //$NON-NLS-1$
+ });
+ propertyPathsMap.put("childNodes", taxonNodePropertyPaths); //$NON-NLS-1$
+ return propertyPathsMap;
+ }