Project

General

Profile

« Previous | Next » 

Revision 0c8d552e

Added by Niels Hoffmann over 12 years ago

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
37 37
import eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator;
38 38
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
39 39
import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
40
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
40 41
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
41 42
import eu.etaxonomy.taxeditor.preference.Resources;
42 43

  
......
50 51
 */
51 52
public class SearchBar extends WorkbenchWindowControlContribution{
52 53
	private Text text_search;
53
	private String srv;
54
	private String secondaryId;
54 55

  
55 56
	private final String defaultText = "Use \"*\" for wildcard searching";
56 57

  
......
200 201
	 * @param searchResult
201 202
	 */
202 203
	private void openSearchResultsView(ITaxonServiceConfigurator configurator) {
203
		// This variable is needed to address new instances of the view.
204
		srv += "1";
204
		boolean openResultInSeparateWindows = PreferencesUtil.getPreferenceStore().getBoolean((IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS));
205
		if(openResultInSeparateWindows){
206
			//increment change secondary id so it is unique 
207
			secondaryId += "1";
208
		}
205 209

  
206 210
		try {
207 211
			IViewPart resultsView = TaxeditorNavigationPlugin.getDefault()
208 212
					.getWorkbench().getActiveWorkbenchWindow()
209
					.getActivePage().showView(SearchResultView.ID, srv,
213
					.getActivePage().showView(SearchResultView.ID, secondaryId,
210 214
							IWorkbenchPage.VIEW_ACTIVATE);
211 215
			((SearchResultView) resultsView).performSearch(configurator);
212 216
		} catch (PartInitException e) {

Also available in: Unified diff