import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
-import eu.etaxonomy.taxeditor.model.LineSelection;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
if(part == this){
return;
}
- if(! (part instanceof BulkEditor)){
- setContentDescription("");
- showEmptyPage();
- return;
- }
-
- if(! (selection instanceof LineSelection)){
- return;
- }
- LineSelection lineSelection = (LineSelection) selection;
-
- if(lineSelection.size() != 1){
- return;
- }
-
- if(! (lineSelection.getFirstElement() instanceof IdentifiableEntity)){
- return;
- }
-
- showViewer(part, lineSelection);
+ if(selection instanceof IStructuredSelection){
+ showViewer(part, (IStructuredSelection) selection);
+ }
}
/** {@inheritDoc} */
public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
// this.part = part;
- updateReferencingObjects(((IdentifiableEntity) selection.getFirstElement()).getUuid(),selection.getFirstElement().getClass() );
+ Object firstElement = selection.getFirstElement();
+ if(firstElement instanceof TreeNode){
+ firstElement = ((TreeNode) firstElement).getValue();
+ }
+ if(firstElement instanceof IdentifiableEntity){
+ updateReferencingObjects(((IdentifiableEntity) firstElement).getUuid(),firstElement.getClass() );
+ }
+ else{
+ setContentDescription("");
+ }
}
/** {@inheritDoc} */
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
<command
- commandId="eu.etaxonomy.taxeditor.editor.derivate.delete"
+ commandId="org.eclipse.ui.edit.delete"
label="%command.label.52"
style="push">
</command>
label="%command.label.54"
style="push">
</command>
+ <dynamic
+ class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+ id="eu.etaxonomy.taxeditor.editor.derivativeEditor.CdmViewerContextMenu">
+ </dynamic>
<dynamic
class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
- commandId="eu.etaxonomy.taxeditor.editor.view.derivate.command.delete">
+ commandId="org.eclipse.ui.edit.delete">
<activeWhen>
<with
variable="activePartId">
</reference>
</activeWhen>
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.handler.defaultHandler.OpenReferencingObjectsView"
+ commandId="eu.etaxonomy.taxeditor.openReferencingObjectsView">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
<extension
name="%extension.name"