ref #6748 Refactor parameter name to avoid ambiguity
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 28 Jun 2017 12:48:14 +0000 (14:48 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 28 Jun 2017 12:48:14 +0000 (14:48 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/ConceptGraphView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java

index 8d5ee3ce9ed9c18487f37d5d127ea770ee867f75..dddb037d4de157446c5ce44c4ea53adc7ef8bc96 100644 (file)
@@ -57,41 +57,41 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
        @Override
        protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
-               if(part == this){
+               if(workbenchPart == this){
                    return;
                }
-        Object part = workbenchPart;
-        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+        Object partObject = workbenchPart;
+        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
         if(wrappedPart!=null){
-            part = wrappedPart;
+            partObject = wrappedPart;
         }
                if(AbstractUtility.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
 
-        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart) {
+        if (partObject instanceof DetailsViewPart || partObject instanceof SupplementalDataViewPart) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
             return;
         }
-        else if(part instanceof BulkEditor && selection instanceof LineSelection){
+        else if(partObject instanceof BulkEditor && selection instanceof LineSelection){
                        if(((LineSelection) selection).getFirstElement() instanceof Taxon){
-                               showViewer(part, (LineSelection) selection);
+                               showViewer(partObject, (LineSelection) selection);
                        }
                        else{
                                showEmptyPage();
                        }
                        return;
                }
-               else if(part instanceof AbstractGraphKeyEditor){
+               else if(partObject instanceof AbstractGraphKeyEditor){
                        showEmptyPage();
                        return;
                }
-               else if(part instanceof MultiPageTaxonEditor){
-                       if(! part.equals(this.part)){
-                               IEditorInput input = ((IEditorPart) part).getEditorInput();
-                               showViewer(part, new StructuredSelection(input));
+               else if(partObject instanceof MultiPageTaxonEditor){
+                       if(! partObject.equals(this.part)){
+                               IEditorInput input = ((IEditorPart) partObject).getEditorInput();
+                               showViewer(partObject, new StructuredSelection(input));
                        }
                }
                else {
index 0a56ab20d38ba4a23dbbe38267f376f58aec2067..d40528d94ea909bc8225904bc1687079ad3c5704 100644 (file)
@@ -41,10 +41,10 @@ public class ConceptGraphView extends AbstractCdmEditorViewPart {
        @Override
        protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
 
-        Object part = workbenchPart;
-        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+        Object partObject = workbenchPart;
+        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
         if(wrappedPart!=null){
-            part = wrappedPart;
+            partObject = wrappedPart;
         }
 //             if(part instanceof ConceptGraphView){
 //                     // ConceptGraphView is maximized
@@ -56,16 +56,16 @@ public class ConceptGraphView extends AbstractCdmEditorViewPart {
                        return;
                }
 
-               if(part instanceof BulkEditor){
+               if(partObject instanceof BulkEditor){
                        showEmptyPage();
                        return;
                }
 
 
-               if(part instanceof MultiPageTaxonEditor){
-                       if(! part.equals(this.part)){
-                               IEditorInput input = ((IEditorPart) part).getEditorInput();
-                               showViewer(part, new StructuredSelection(input));
+               if(partObject instanceof MultiPageTaxonEditor){
+                       if(! partObject.equals(this.part)){
+                               IEditorInput input = ((IEditorPart) partObject).getEditorInput();
+                               showViewer(partObject, new StructuredSelection(input));
                        }
                }
 
index 15d2fdb36685fa4150be922066a52e8c8fa25100..bccefe8a773905bcdd3bc84056569e8b158af4cf 100644 (file)
@@ -155,37 +155,37 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        /** {@inheritDoc} */
        @Override
     protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
+           Object partObject = workbenchPart;
 //             if(AbstractUtility.getActiveE4Editor() == null){
 //                     showEmptyPage();
 //                     return;
 //             }
 
-               if(part == this){
+               if(partObject == this){
                    return;
                }
 
-        Object part = workbenchPart;
-        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
         if(wrappedPart!=null){
-            part = wrappedPart;
+            partObject = wrappedPart;
         }
 
-        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart
-                || part instanceof MediaViewPart) {
+        if (partObject instanceof DetailsViewPart || partObject instanceof SupplementalDataViewPart
+                || partObject instanceof MediaViewPart) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
             return;
         }
                // unpackage TreeNode of DerivateView
-               else if(part instanceof E4PartWrapper && ((E4PartWrapper)part).getPartName().equals("%command.label.DERIVATIVE_EDITOR")){
+               else if(partObject instanceof E4PartWrapper && ((E4PartWrapper)partObject).getPartName().equals("%command.label.DERIVATIVE_EDITOR")){
                    TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
                    if(treeNodeOfSelection!=null){
                        selection = new StructuredSelection(treeNodeOfSelection.getValue());
-                       showViewer(part, (IStructuredSelection) selection);
+                       showViewer(partObject, (IStructuredSelection) selection);
                            return;
                    }
                }
-        else if(part instanceof ChecklistEditor){
+        else if(partObject instanceof ChecklistEditor){
             if(selection instanceof StructuredSelection  && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
                 Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
                 selection = new StructuredSelection(taxon);
@@ -193,9 +193,9 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
         }
                if(selection instanceof IStructuredSelection
                        && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
-                       && part instanceof IPartContentHasFactualData  && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
+                       && partObject instanceof IPartContentHasFactualData  && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
                    featureNodeContainerCache.clear();
-                   showViewer(part, (IStructuredSelection) selection);
+                   showViewer(partObject, (IStructuredSelection) selection);
                    return;
                }
                else{
index 2fc009de04b1c57659b49aba53abc2570b60e492..16bab02332f6c0a2cfe4c00caad09af24c6d549f 100644 (file)
@@ -91,15 +91,15 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
        /** {@inheritDoc} */
        @Override
     protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
-           Object part = workbenchPart;
+           Object partObject = workbenchPart;
 
-           if(part==this){
+           if(partObject==this){
                return;
            }
 
-        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
         if(wrappedPart!=null){
-            part = wrappedPart;
+            partObject = wrappedPart;
         }
 //             if(AbstractUtility.getActiveE4Editor() == null){
 //                     showEmptyPage();
@@ -107,23 +107,23 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
 //             }
 
 
-        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart
-                || part instanceof DescriptiveViewPart) {
+        if (partObject instanceof DetailsViewPart || partObject instanceof SupplementalDataViewPart
+                || partObject instanceof DescriptiveViewPart) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
             return;
         }
 
-               if(part instanceof IPartContentHasMedia && ((IPartContentHasMedia) part).canAttachMedia() ){
+               if(partObject instanceof IPartContentHasMedia && ((IPartContentHasMedia) partObject).canAttachMedia() ){
                    if(selection instanceof IStructuredSelection){
                        Object firstElement = ((IStructuredSelection) selection).getFirstElement();
                        if(firstElement instanceof TreeNode){
-                           showViewer(part, new StructuredSelection(((TreeNode) firstElement).getValue()));
+                           showViewer(partObject, new StructuredSelection(((TreeNode) firstElement).getValue()));
                            return;
                        }
                        else if(firstElement!=null
                            && firstElement instanceof IDescribable<?>){
-                           showViewer(part, (IStructuredSelection) selection);
+                           showViewer(partObject, (IStructuredSelection) selection);
                            return;
                        }
                    }
@@ -133,7 +133,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
                        if(structuredSelection.getFirstElement() instanceof TreeNode){
                                        if (((TreeNode)structuredSelection.getFirstElement()).getValue() instanceof SpecimenOrObservationBase){
                                    structuredSelection = new StructuredSelection(((TreeNode)structuredSelection.getFirstElement()).getValue());
-                                   showViewer(part, structuredSelection);
+                                   showViewer(partObject, structuredSelection);
                                    return;
                                }
                        }
index 8dc14f716c0111291db7b04355a9229657ab77fd..6f761bddb6cc64a16ef4648d364ca23f9db45a2e 100644 (file)
@@ -68,10 +68,10 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
 
        @Override
     protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection){
-           Object part = workbenchPart;
-           Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+           Object partObject = workbenchPart;
+           Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
            if(wrappedPart!=null){
-               part = wrappedPart;
+               partObject = wrappedPart;
            }
            if(AbstractUtility.getActiveE4Editor() == null && !(AbstractUtility.getActiveE4Part() instanceof IConversationEnabled)){
             showEmptyPage();
@@ -104,7 +104,7 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
                //nothing
            }
 
-           if(part == this){
+           if(partObject == this){
                return;
            }
 
@@ -114,7 +114,7 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
 
         IStructuredSelection structuredSelection = (IStructuredSelection) selection;
 
-        if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
+        if((partObject instanceof IEditorPart) || (partObject instanceof IPartContentHasDetails)) {
             if(structuredSelection.size() != 1){
                 showEmptyPage();
                 return;
@@ -129,7 +129,7 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
                     return;
                 }
             }
-            showViewer(part, structuredSelection);
+            showViewer(partObject, structuredSelection);
         }else{
             showEmptyPage();
         }
index 4927a9684645d5128bc60010d57a62205fb5f020..1817a5ab306789fee4b21430fc0f1f7f29fd7050 100644 (file)
@@ -56,17 +56,17 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
        /** {@inheritDoc} */
        @Override
        protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
-           Object part = workbenchPart;
-        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(part);
+           Object partObject = workbenchPart;
+        Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
         if(wrappedPart!=null){
-            part = wrappedPart;
+            partObject = wrappedPart;
         }
                if(AbstractUtility.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
 
-        if(part == this){
+        if(partObject == this){
             return;
         }
 
@@ -76,7 +76,7 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
 
         IStructuredSelection structuredSelection = (IStructuredSelection) selection;
 
-               if((part instanceof EditorPart || part instanceof IPartContentHasSupplementalData)) {
+               if((partObject instanceof EditorPart || partObject instanceof IPartContentHasSupplementalData)) {
                        if(structuredSelection.size() != 1){
                                showEmptyPage();
                                return;
@@ -99,7 +99,7 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
                        else if(structuredSelection.getFirstElement() instanceof GbifResponse){
                            structuredSelection = new StructuredSelection(((GbifResponse)structuredSelection.getFirstElement()).getDerivedUnitFacade().innerDerivedUnit());
                        }
-                       showViewer(part, structuredSelection);
+                       showViewer(partObject, structuredSelection);
                }else{
                        showEmptyPage();
                }