Project

General

Profile

« Previous | Next » 

Revision 15d272aa

Added by Patrick Plitzner about 7 years ago

ref #6566 Migrate SearchBar

View differences:

eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF
3 3
Bundle-Name: Navigation Bundle
4 4
Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
5 5
Bundle-Version: 4.7.0.qualifier
6
Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
6 7
Bundle-Vendor: EDIT
7 8
Export-Package: eu.etaxonomy.cdm,
8 9
 eu.etaxonomy.taxeditor.navigation,
......
18 19
 org.eclipse.core.expressions,
19 20
 eu.etaxonomy.taxeditor.cdmlib,
20 21
 eu.etaxonomy.taxeditor.store,
21
 eu.etaxonomy.taxeditor.editor
22
Bundle-ActivationPolicy: lazy
22
 eu.etaxonomy.taxeditor.editor,
23
 org.eclipse.e4.ui.model.workbench;bundle-version="1.2.0.v20160229-1459"
24
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
23 25
Import-Package: org.eclipse.core.resources,
24 26
 org.eclipse.core.runtime,
25 27
 org.eclipse.core.runtime.jobs,
......
27 29
 org.eclipse.osgi.util;version="1.1.0",
28 30
 org.eclipse.ui.forms.widgets,
29 31
 org.osgi.framework
30
Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
31
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
32
Bundle-ActivationPolicy: lazy
eu.etaxonomy.taxeditor.navigation/build.properties
1
source.. = src/main/java/,\
2
           src/test/java/,\
3
           src/test/resources/
4 1
output.. = target/classes/
5 2
bin.includes = META-INF/,\
6 3
               .,\
......
10 7
               OSGI-INF/l10n/bundle.properties,\
11 8
               OSGI-INF/l10n/bundle_de.properties,\
12 9
               src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties,\
13
               src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties
14
               
15
               
16

  
10
               src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties,\
11
               fragment.e4xmi
12
source.. = src/main/java/,\
13
           src/test/java/,\
14
           src/test/resources/
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
1
<?xml version="1.0" encoding="ASCII"?>
2
<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">
3
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.toolbar.0">
4
    <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"/>
5
  </fragments>
6
</fragment:ModelFragments>
eu.etaxonomy.taxeditor.navigation/plugin.xml
331 331
            </visibleWhen>
332 332
         </command>
333 333
      </menuContribution>
334
      <menuContribution
335
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
336
         <toolbar
337
               id="eu.etaxonomy.taxeditor.navigation.search.toolbar">
338
            <control
339
                  class="eu.etaxonomy.taxeditor.navigation.search.SearchBar">
340
            </control>
341
         </toolbar>
342
      </menuContribution>
343 334
      <menuContribution
344 335
            locationURI="menu:eu.etaxonomy.navigation.menu.new">
345 336
         <command
......
935 926
         </test>
936 927
      </definition>
937 928
   </extension>
929
   <extension
930
         id="id1"
931
         point="org.eclipse.e4.workbench.model">
932
      <fragment
933
            apply="always"
934
            uri="fragment.e4xmi">
935
      </fragment>
936
   </extension>
938 937
</plugin>
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.navigation.search;
11 11

  
12
import javax.annotation.PostConstruct;
13

  
12 14
import org.eclipse.core.runtime.IProgressMonitor;
13 15
import org.eclipse.swt.SWT;
14 16
import org.eclipse.swt.events.FocusEvent;
......
32 34
import org.eclipse.ui.IWorkbenchPage;
33 35
import org.eclipse.ui.PartInitException;
34 36
import org.eclipse.ui.PlatformUI;
35
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
36 37
import org.eclipse.ui.swt.IFocusService;
37 38

  
38 39
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
......
52 53
 * @created 15.04.2009
53 54
 * @version 1.0
54 55
 */
55
public class SearchBar extends WorkbenchWindowControlContribution implements IContextListener{
56
public class SearchBar implements IContextListener{
56 57
	private Text text_search;
57 58
	private String secondaryId;
58 59
	private ToolBar toolBar;
......
62 63
	final private ConfigurationSelectionListener configurationListener = new ConfigurationSelectionListener();
63 64

  
64 65
	/** {@inheritDoc} */
65
	@Override
66
	@PostConstruct
66 67
	protected Control createControl(Composite parent) {
67 68
		Composite composite = new Composite(parent, SWT.NONE);
68 69

  
......
81 82
	 */
82 83
	private void registerAtFocusService() {
83 84
		IFocusService focusService =
84
			(IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
85
			PlatformUI.getWorkbench().getService(IFocusService.class);
85 86
		if (focusService != null) {
86 87
			focusService.addFocusTracker(text_search, "navigation.textControlId");
87 88
		}

Also available in: Unified diff