import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.Viewer;
import eu.etaxonomy.cdm.model.common.Marker;
/** {@inheritDoc} */
@Override
public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof TreeNode){
+ parentElement = ((TreeNode) parentElement).getValue();
+ }
if (parentElement instanceof IDescribable<?>) {
return getDescriptions((IDescribable<?>) parentElement).toArray();
}
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
return;
}
}
-
+ if(firstElement instanceof TreeNode){
+ firstElement = ((TreeNode) firstElement).getValue();
+ }
if(firstElement instanceof IDescribable<?>
&& partObject instanceof IPartContentHasFactualData
&& !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.TreeNode;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
AbstractPostOperation<?> operation;
Object viewerInput = factualDataPart.getViewer().getInput();
+ if(viewerInput instanceof TreeNode){
+ viewerInput = ((TreeNode) viewerInput).getValue();
+ }
if(viewerInput instanceof SpecimenOrObservationBase<?>){
operation = new CreateSpecimenDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, factualDataPart);
AbstractUtility.executeOperation(operation);