Move "link with taxon selection" action to main toolbar
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 16 Nov 2015 09:38:02 +0000 (10:38 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 16 Nov 2015 09:38:02 +0000 (10:38 +0100)
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchComposite.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java

index b7ca0b2d2f03a80d7747a438fc89311f75618e65..9ef904dfb7df762f2ef256513b04b4db66e47555 100644 (file)
       </menuContribution>
       <menuContribution
             allPopups="false"
-            locationURI="toolbar:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
-               icon="icons/synced.gif"
-               label="Link with Taxon Editor"
-               style="toggle">
-            <visibleWhen
-                  checkEnabled="false">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
-         </command>
+            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=eu.etaxonomy.taxeditor.navigation.search.toolbar">
+         <toolbar
+               id="eu.etaxonomy.taxeditor.editor.derivativeViewToolbar">
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
+                  icon="icons/synced.gif"
+                  label="Link with Taxon Selection"
+                  style="toggle">
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="activePartId">
+                     <equals
+                           value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+                     </equals>
+                  </with>
+               </visibleWhen>
+            </command>
+         </toolbar>
       </menuContribution>
    </extension>
    <extension
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ListenToSelectionChangeHandler"
             id="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
-            name="Link with editor">
+            name="Link with taxon selection">
       </command>
         
    </extension>
index 02f3e5d051038f21156117d35f045b057f7155de..b34b7ab192b7a03c6a02cf44ea3080237f1e2d74 100644 (file)
@@ -43,7 +43,6 @@ public class DerivateSearchComposite extends Composite {
     private Label lbltaxonAssignment;
     private Combo comboTaxonAssignment;
     private Label lblTitleCache;
-    private Button buttonToggleLink;
 
     /**
      * Create the composite.
@@ -82,11 +81,7 @@ public class DerivateSearchComposite extends Composite {
         formToolkit.adapt(comboTaxonAssignment);
         formToolkit.paintBordersFor(comboTaxonAssignment);
         comboTaxonAssignment.select(ALL_SPECIMENS);
-
-        buttonToggleLink = new Button(this, SWT.NONE);
-        buttonToggleLink.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        buttonToggleLink.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.editor", "icons/synced.gif"));
-        formToolkit.adapt(buttonToggleLink, true, true);
+        new Label(this, SWT.NONE);
 
         lblTitleCache = new Label(this, SWT.NONE);
         lblTitleCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
@@ -161,7 +156,4 @@ public class DerivateSearchComposite extends Composite {
     public Label getLbltaxonAssignment() {
         return lbltaxonAssignment;
     }
-    public Button getButtonToggleLink() {
-        return buttonToggleLink;
-    }
 }
index 50d91e66a0ab44512791f7557a24134d281a36d4..e87fcc5aa4b7b4af58379b51f6f7a24485697511 100644 (file)
@@ -65,7 +65,6 @@ public class DerivateSearchCompositeController implements Listener{
         derivateSearchComposite.getButtonSearch().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnBrowseTaxa().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnClearTaxon().addListener(SWT.Selection, this);
-        derivateSearchComposite.getButtonToggleLink().addListener(SWT.Selection, this);
 
     }
 
@@ -146,9 +145,6 @@ public class DerivateSearchCompositeController implements Listener{
             derivateSearchComposite.getComboTaxonAssignment().setEnabled(true);
             derivateSearchComposite.getLbltaxonAssignment().setEnabled(true);
         }
-        else if(eventSource==derivateSearchComposite.getButtonToggleLink()){
-            derivativeEditor.toggleListenToSelectionChange();
-        }
     }
 
     /**