ref #6566 Migrate SearchBar
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 19 Apr 2017 09:23:56 +0000 (11:23 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 19 Apr 2017 09:23:56 +0000 (11:23 +0200)
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.navigation/build.properties
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java

index acae2c9f15feeb94e5e64292d63dcc777482b749..45456099cc5cd644c8a4995f69cb91622b2517c4 100644 (file)
@@ -3,6 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: Navigation Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
 Bundle-Version: 4.7.0.qualifier
 Bundle-Name: Navigation Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
 Bundle-Version: 4.7.0.qualifier
+Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.navigation,
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.navigation,
@@ -18,8 +19,9 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.core.expressions,
  eu.etaxonomy.taxeditor.cdmlib,
  eu.etaxonomy.taxeditor.store,
  org.eclipse.core.expressions,
  eu.etaxonomy.taxeditor.cdmlib,
  eu.etaxonomy.taxeditor.store,
- eu.etaxonomy.taxeditor.editor
-Bundle-ActivationPolicy: lazy
+ eu.etaxonomy.taxeditor.editor,
+ org.eclipse.e4.ui.model.workbench;bundle-version="1.2.0.v20160229-1459"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Import-Package: org.eclipse.core.resources,
  org.eclipse.core.runtime,
  org.eclipse.core.runtime.jobs,
 Import-Package: org.eclipse.core.resources,
  org.eclipse.core.runtime,
  org.eclipse.core.runtime.jobs,
@@ -27,5 +29,4 @@ Import-Package: org.eclipse.core.resources,
  org.eclipse.osgi.util;version="1.1.0",
  org.eclipse.ui.forms.widgets,
  org.osgi.framework
  org.eclipse.osgi.util;version="1.1.0",
  org.eclipse.ui.forms.widgets,
  org.osgi.framework
-Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
index 69ef8f5075faababb7f90300b2b33522fc25fb88..a91e33bdd84101031466963ea0cbe08056aea573 100644 (file)
@@ -1,6 +1,3 @@
-source.. = src/main/java/,\
-           src/test/java/,\
-           src/test/resources/
 output.. = target/classes/
 bin.includes = META-INF/,\
                .,\
 output.. = target/classes/
 bin.includes = META-INF/,\
                .,\
@@ -10,7 +7,8 @@ bin.includes = META-INF/,\
                OSGI-INF/l10n/bundle.properties,\
                OSGI-INF/l10n/bundle_de.properties,\
                src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties,\
                OSGI-INF/l10n/bundle.properties,\
                OSGI-INF/l10n/bundle_de.properties,\
                src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties,\
-               src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties
-               
-               
-
+               src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties,\
+               fragment.e4xmi
+source.. = src/main/java/,\
+           src/test/java/,\
+           src/test/resources/
diff --git a/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi b/eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
new file mode 100644 (file)
index 0000000..8b4287e
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_OhwnQCTfEeeiN5lBIuqN3g">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.toolbar.0">
+    <elements xsi:type="menu:ToolControl" xmi:id="_7kZI4CTfEeeiN5lBIuqN3g" elementId="eu.etaxonomy.taxeditor.navigation.toolcontrol.search_bar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.search.SearchBar"/>
+  </fragments>
+</fragment:ModelFragments>
index 1cd97c66fb6cefa3f14460dcb9f4e4b607e6b9c1..fcea5f9b2f8c14b4a82ccf53488a1768eea02b9e 100644 (file)
             </visibleWhen>
          </command>
       </menuContribution>
             </visibleWhen>
          </command>
       </menuContribution>
-      <menuContribution
-            locationURI="toolbar:org.eclipse.ui.main.toolbar">
-         <toolbar
-               id="eu.etaxonomy.taxeditor.navigation.search.toolbar">
-            <control
-                  class="eu.etaxonomy.taxeditor.navigation.search.SearchBar">
-            </control>
-         </toolbar>
-      </menuContribution>
       <menuContribution
             locationURI="menu:eu.etaxonomy.navigation.menu.new">
          <command
       <menuContribution
             locationURI="menu:eu.etaxonomy.navigation.menu.new">
          <command
          </test>
       </definition>
    </extension>
          </test>
       </definition>
    </extension>
+   <extension
+         id="id1"
+         point="org.eclipse.e4.workbench.model">
+      <fragment
+            apply="always"
+            uri="fragment.e4xmi">
+      </fragment>
+   </extension>
 </plugin>
 </plugin>
index 9d4c93f61939cd00424478085050685fd494c4de..ee748ada0aee51fd4ea5cb0890f71031e81d15b6 100644 (file)
@@ -9,6 +9,8 @@
 
 package eu.etaxonomy.taxeditor.navigation.search;
 
 
 package eu.etaxonomy.taxeditor.navigation.search;
 
+import javax.annotation.PostConstruct;
+
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.FocusEvent;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.FocusEvent;
@@ -32,7 +34,6 @@ import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
 import org.eclipse.ui.swt.IFocusService;
 
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import org.eclipse.ui.swt.IFocusService;
 
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
@@ -52,7 +53,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created 15.04.2009
  * @version 1.0
  */
  * @created 15.04.2009
  * @version 1.0
  */
-public class SearchBar extends WorkbenchWindowControlContribution implements IContextListener{
+public class SearchBar implements IContextListener{
        private Text text_search;
        private String secondaryId;
        private ToolBar toolBar;
        private Text text_search;
        private String secondaryId;
        private ToolBar toolBar;
@@ -62,7 +63,7 @@ public class SearchBar extends WorkbenchWindowControlContribution implements ICo
        final private ConfigurationSelectionListener configurationListener = new ConfigurationSelectionListener();
 
        /** {@inheritDoc} */
        final private ConfigurationSelectionListener configurationListener = new ConfigurationSelectionListener();
 
        /** {@inheritDoc} */
-       @Override
+       @PostConstruct
        protected Control createControl(Composite parent) {
                Composite composite = new Composite(parent, SWT.NONE);
 
        protected Control createControl(Composite parent) {
                Composite composite = new Composite(parent, SWT.NONE);
 
@@ -81,7 +82,7 @@ public class SearchBar extends WorkbenchWindowControlContribution implements ICo
         */
        private void registerAtFocusService() {
                IFocusService focusService =
         */
        private void registerAtFocusService() {
                IFocusService focusService =
-                       (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
+                       PlatformUI.getWorkbench().getService(IFocusService.class);
                if (focusService != null) {
                        focusService.addFocusTracker(text_search, "navigation.textControlId");
                }
                if (focusService != null) {
                        focusService.addFocusTracker(text_search, "navigation.textControlId");
                }