Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 33710 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java (-1 / +33 lines)
Lines 1-4 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
Lines 11-14 Link Here
11
 *       o Search dialog not respecting activity enablement
11
 *       o Search dialog not respecting activity enablement
12
 *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=45729)
12
 *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=45729)
13
 *     Marco Descher <marco@descher.at> - http://bugs.eclipse.org/33710
13
 *******************************************************************************/
14
 *******************************************************************************/
14
package org.eclipse.search.internal.ui;
15
package org.eclipse.search.internal.ui;
Lines 91-94 Link Here
91
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider {
92
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider {
92
93
94
	/**
95
	* The id of the last search page that was opened in the search dialog, used as key in
96
	* {@link IDialogSettings}
97
	*/
98
	public static final String PREVIOUS_SEARCH_PAGE= "PreviousSearchPageId_SearchDialog"; //$NON-NLS-1$
99
	
100
	public static final String SEARCH_TAB_OPENS_LAST_USED_PAGE= "SearchTabSelectionMode_LastUsedPage"; //$NON-NLS-1$
101
	
93
	private class TabFolderLayout extends Layout {
102
	private class TabFolderLayout extends Layout {
94
		protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
103
		protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
Lines 146-149 Link Here
146
	private final String[] fCurrentEnclosingProject;
155
	private final String[] fCurrentEnclosingProject;
147
156
157
	private final IDialogSettings defaultDialogSettings= SearchPlugin.getDefault().getDialogSettings();
148
158
149
	public SearchDialog(IWorkbenchWindow window, String pageId) {
159
	public SearchDialog(IWorkbenchWindow window, String pageId) {
Lines 155-158 Link Here
155
		fDescriptors= filterByActivities(SearchPlugin.getDefault().getEnabledSearchPageDescriptors(pageId));
165
		fDescriptors= filterByActivities(SearchPlugin.getDefault().getEnabledSearchPageDescriptors(pageId));
156
		fInitialPageId= pageId;
166
		fInitialPageId= pageId;
167
		
168
		if (fInitialPageId == null) {
169
			if (defaultDialogSettings.getBoolean(SEARCH_TAB_OPENS_LAST_USED_PAGE)) 
170
				fInitialPageId= defaultDialogSettings.get(PREVIOUS_SEARCH_PAGE);
171
		}
172
		
157
		fPageChangeListeners= null;
173
		fPageChangeListeners= null;
158
		setUseEmbeddedProgressMonitorPart(false);
174
		setUseEmbeddedProgressMonitorPart(false);
Lines 329-332 Link Here
329
				this.getButton(IDialogConstants.SELECT_ALL_ID).addSelectionListener(listener);
345
				this.getButton(IDialogConstants.SELECT_ALL_ID).addSelectionListener(listener);
330
				this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener);
346
				this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener);
347
			}
348
			
349
			protected Control createDialogArea(Composite parent) {
350
			Composite ret= (Composite)super.createDialogArea(parent);
351
			
352
				final Button b= new Button(ret, SWT.CHECK);
353
				b.setText(SearchMessages.RememberLastUsedPage_message);
354
				b.setSelection(defaultDialogSettings.getBoolean(SEARCH_TAB_OPENS_LAST_USED_PAGE));
355
				b.addSelectionListener(new SelectionAdapter() {
356
					public void widgetSelected(SelectionEvent e) {
357
						defaultDialogSettings.put(SEARCH_TAB_OPENS_LAST_USED_PAGE, b.getSelection());
358
					}
359
				});
360
				return ret;
331
			}
361
			}
332
		};
362
		};
Lines 523-526 Link Here
523
		SearchPageDescriptor descriptor= (SearchPageDescriptor) item.getData("descriptor"); //$NON-NLS-1$
553
		SearchPageDescriptor descriptor= (SearchPageDescriptor) item.getData("descriptor"); //$NON-NLS-1$
524
554
555
		defaultDialogSettings.put(PREVIOUS_SEARCH_PAGE, descriptor.getId());
556
		
525
		if (item.getControl() == null) {
557
		if (item.getControl() == null) {
526
			item.setControl(createPageControl(folder, descriptor));
558
			item.setControl(createPageControl(folder, descriptor));
(-)a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java (-1 / +3 lines)
Lines 1-4 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
Lines 8-11 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Marco Descher <marco@descher.at> - http://bugs.eclipse.org/33710
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.search.internal.ui;
12
package org.eclipse.search.internal.ui;
Lines 186-189 Link Here
186
	public static String SearchPreferencePage_defaultPerspective_none;
187
	public static String SearchPreferencePage_defaultPerspective_none;
187
	public static String SearchPreferencePage_ignorePotentialMatches;
188
	public static String SearchPreferencePage_ignorePotentialMatches;
189
	public static String RememberLastUsedPage_message;
188
	public static String ReplaceAction_label_all;
190
	public static String ReplaceAction_label_all;
189
	public static String ReplaceAction_label_selected;
191
	public static String ReplaceAction_label_selected;
(-)a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties (-1 / +4 lines)
Lines 1-4 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2000, 2012 IBM Corporation and others.
2
# Copyright (c) 2000, 2013 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
Lines 8-11 Link Here
8
# Contributors:
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
#     Marco Descher <marco@descher.at> - http://bugs.eclipse.org/33710
10
###############################################################################
11
###############################################################################
11
12
Lines 192-195 Link Here
192
ExceptionDialog_seeErrorLogMessage= See error log for details
193
ExceptionDialog_seeErrorLogMessage= See error log for details
193
194
195
RememberLastUsedPage_message=&Remember last used page
196
194
SearchPreferencePage_emphasizePotentialMatches= &Emphasize potential matches
197
SearchPreferencePage_emphasizePotentialMatches= &Emphasize potential matches
195
SearchPreferencePage_potentialMatchFgColor= &Foreground color for potential matches:
198
SearchPreferencePage_potentialMatchFgColor= &Foreground color for potential matches:

Return to bug 33710