Project

General

Profile

Revision 9a512b18

ID9a512b18de9b80617fd118c40746dc31db22aa76
Parent b8da2ad7
Child 64f636f0

Added by Patrick Plitzner over 3 years ago

ref #5923 "Open in.." menu restructuring

  • "BulkEditor" option is removed when already in BulkEditor
  • "BulkEditor" added for Specimen Editor

View differences:

eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
539 539
            class="eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntity"
540 540
            commandId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity">
541 541
         <activeWhen>
542
            <reference
543
                  definitionId="isBulkEditorSupported">
544
            </reference>
542
            <and>
543
               <reference
544
                     definitionId="isBulkEditorSupported">
545
               </reference>
546
               <not>
547
                  <reference
548
                        definitionId="isBulkEditor">
549
                  </reference>
550
               </not>
551
            </and>
545 552
         </activeWhen>
546 553
      </handler>
547 554
      
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorSelectionPropertyTester.java
2 2

  
3 3
import org.eclipse.core.expressions.PropertyTester;
4 4
import org.eclipse.jface.viewers.IStructuredSelection;
5
import org.eclipse.jface.viewers.TreeNode;
5 6

  
6 7
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
7 8
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
......
21 22
				    if(selectedElement instanceof UuidAndTitleCache){
22 23
				        return BulkEditorInputType.getByType(((UuidAndTitleCache) selectedElement).getType())!=null;
23 24
				    }
25
				    else if(selectedElement instanceof TreeNode){
26
				        System.out.println(BulkEditorInputType.getByType(((TreeNode) selectedElement).getValue().getClass())!=null);
27
				        return BulkEditorInputType.getByType(((TreeNode) selectedElement).getValue().getClass())!=null;
28
				    }
24 29
					return BulkEditorInputType.getByType(selectedElement.getClass())!=null;
25 30
				}
26 31
			}
eu.etaxonomy.taxeditor.editor/plugin.xml
2027 2027
      </propertyTester>
2028 2028
      <propertyTester
2029 2029
            class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
2030
            id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
2030
            id="eu.etaxonomy.taxeditor.descriptions.propertyTester"
2031 2031
            namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
2032 2032
            properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor, isIndividualsAssociation"
2033 2033
            type="org.eclipse.jface.viewers.TreeSelection">
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenu.java
12 12
import org.eclipse.jface.action.IContributionItem;
13 13
import org.eclipse.jface.viewers.ISelection;
14 14
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.jface.viewers.TreeNode;
15 16
import org.eclipse.swt.SWT;
16 17
import org.eclipse.swt.events.SelectionAdapter;
17 18
import org.eclipse.swt.events.SelectionEvent;
......
100 101
            if (selectedObject instanceof UuidAndTitleCache){
101 102
                selectedObject = CdmStore.getCommonService().find(CdmBase.class, ((UuidAndTitleCache)selectedObject).getUuid());
102 103
            }
104
            //for tree nodes get the value resp. the object of the node
105
            else if (selectedObject instanceof TreeNode){
106
                selectedObject = ((TreeNode) selectedObject).getValue();
107
            }
103 108
            if(selectedObject instanceof ICdmBase){
104 109
                params.put(command.getId()+".uuid", ((ICdmBase) selectedObject).getUuid()); //$NON-NLS-1$
105 110
            }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtil.java
15 15
import org.eclipse.core.runtime.IConfigurationElement;
16 16
import org.eclipse.core.runtime.IExtensionRegistry;
17 17
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.jface.viewers.TreeNode;
18 19
import org.eclipse.ui.PlatformUI;
19 20
import org.eclipse.ui.commands.ICommandService;
20 21

  
......
48 49
                UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache)input;
49 50
                input = CdmStore.getCommonService().find(uuidAndTitleCache.getType(), uuidAndTitleCache.getUuid());
50 51
            }
52
            //for tree nodes get the value resp. the object of the node
53
            else if (input instanceof TreeNode){
54
                TreeNode treeNode = (TreeNode)input;
55
                input = treeNode.getValue();
56
            }
51 57

  
52 58

  
53 59
            IExtensionRegistry reg = Platform.getExtensionRegistry();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)