import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import eu.etaxonomy.cdm.hibernate.HHH_9751_Util;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
/**
}
if (!node.getChildren().isEmpty()) {
result.addAll(node.getChildren());
+ HHH_9751_Util.removeAllNull(result);
for (PolytomousKeyNode internalNode : node.getChildren()) {
getChildrenBreadthFirst(result, internalNode);
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
PolytomousKey key = ((PolytomousKeyEditorInput) getEditorInput())
.getKey();
-
+ key = HibernateProxyHelper.deproxy(key, PolytomousKey.class);
+ key.setRoot(HibernateProxyHelper.deproxy(key.getRoot(), PolytomousKeyNode.class));
setPartName(key.getTitleCache());
viewer.setInput(getEditorInput());
public void changed(Object element) {
if(element != null) {
viewer.update(element, null);
+
}
if (element instanceof PolytomousKeyNode) {
viewer.update(child, null);
}
}
+
viewer.refresh();
+ viewer.setSelection(new StructuredSelection(element));
}
/* (non-Javadoc)
public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefaultOperation {
private final PolytomousKeyNode parentNode;
+ private PolytomousKeyNode childNode;
+
+ public PolytomousKeyNode getChildNode() {
+ return childNode;
+ }
private final static String LABEL = "Create new polytomous key node";
*/
@Override
protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
- PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
+ childNode = PolytomousKeyNode.NewInstance();
parentNode.addChild(childNode);
return childNode;
}