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 / +30 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 52-55 Link Here
52
53
53
import org.eclipse.jface.action.LegacyActionTools;
54
import org.eclipse.jface.action.LegacyActionTools;
55
import org.eclipse.jface.dialogs.DialogSettings;
54
import org.eclipse.jface.dialogs.IDialogConstants;
56
import org.eclipse.jface.dialogs.IDialogConstants;
55
import org.eclipse.jface.dialogs.IDialogSettings;
57
import org.eclipse.jface.dialogs.IDialogSettings;
Lines 91-94 Link Here
91
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider {
93
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider {
92
94
95
	// Dialog store id constants
96
	private static final String DIALOG_NAME= "SearchDialog"; //$NON-NLS-1$
97
	private static final String STORE_PREVIOUS_PAGE= "PREVIOUS_PAGE"; //$NON-NLS-1$	
98
	private static final String STORE_IS_OPEN_PREVIOUS_PAGE= "IS_OPEN_PREVIOUS_PAGE"; //$NON-NLS-1$
99
	
93
	private class TabFolderLayout extends Layout {
100
	private class TabFolderLayout extends Layout {
94
		protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
101
		protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
Lines 146-149 Link Here
146
	private final String[] fCurrentEnclosingProject;
153
	private final String[] fCurrentEnclosingProject;
147
154
155
	private final IDialogSettings fDefaultDialogSettings= DialogSettings.getOrCreateSection(SearchPlugin.getDefault().getDialogSettings(), DIALOG_NAME);
148
156
149
	public SearchDialog(IWorkbenchWindow window, String pageId) {
157
	public SearchDialog(IWorkbenchWindow window, String pageId) {
Lines 155-158 Link Here
155
		fDescriptors= filterByActivities(SearchPlugin.getDefault().getEnabledSearchPageDescriptors(pageId));
163
		fDescriptors= filterByActivities(SearchPlugin.getDefault().getEnabledSearchPageDescriptors(pageId));
156
		fInitialPageId= pageId;
164
		fInitialPageId= pageId;
165
		
166
		if (fInitialPageId == null && fDefaultDialogSettings.getBoolean(STORE_IS_OPEN_PREVIOUS_PAGE)) {
167
				fInitialPageId= fDefaultDialogSettings.get(STORE_PREVIOUS_PAGE);
168
		}
169
		
157
		fPageChangeListeners= null;
170
		fPageChangeListeners= null;
158
		setUseEmbeddedProgressMonitorPart(false);
171
		setUseEmbeddedProgressMonitorPart(false);
Lines 329-332 Link Here
329
				this.getButton(IDialogConstants.SELECT_ALL_ID).addSelectionListener(listener);
342
				this.getButton(IDialogConstants.SELECT_ALL_ID).addSelectionListener(listener);
330
				this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener);
343
				this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener);
344
			}
345
			
346
			protected Control createDialogArea(Composite parent) {
347
			Composite ret= (Composite)super.createDialogArea(parent);
348
			
349
				final Button lastUsedPageButton= new Button(ret, SWT.CHECK);
350
				lastUsedPageButton.setText(SearchMessages.SearchPageSelectionDialog_rememberLastUsedPage_message);
351
				lastUsedPageButton.setSelection(fDefaultDialogSettings.getBoolean(STORE_IS_OPEN_PREVIOUS_PAGE));
352
				lastUsedPageButton.addSelectionListener(new SelectionAdapter() {
353
					public void widgetSelected(SelectionEvent e) {
354
						fDefaultDialogSettings.put(STORE_IS_OPEN_PREVIOUS_PAGE, lastUsedPageButton.getSelection());
355
					}
356
				});
357
				return ret;
331
			}
358
			}
332
		};
359
		};
Lines 523-526 Link Here
523
		SearchPageDescriptor descriptor= (SearchPageDescriptor) item.getData("descriptor"); //$NON-NLS-1$
550
		SearchPageDescriptor descriptor= (SearchPageDescriptor) item.getData("descriptor"); //$NON-NLS-1$
524
551
552
		fDefaultDialogSettings.put(STORE_PREVIOUS_PAGE, descriptor.getId());
553
		
525
		if (item.getControl() == null) {
554
		if (item.getControl() == null) {
526
			item.setControl(createPageControl(folder, descriptor));
555
			item.setControl(createPageControl(folder, descriptor));
(-)a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java (+2 lines)
Lines 9-12 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Christian Walther (Indel AG) - Bug 399094: Add whole word option to file search
10
 *     Christian Walther (Indel AG) - Bug 399094: Add whole word option to file search
11
 *     Marco Descher <marco@descher.at> - http://bugs.eclipse.org/33710
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.search.internal.ui;
13
package org.eclipse.search.internal.ui;
Lines 64-67 Link Here
64
	public static String SearchPageSelectionDialog_title;
65
	public static String SearchPageSelectionDialog_title;
65
	public static String SearchPageSelectionDialog_message;
66
	public static String SearchPageSelectionDialog_message;
67
	public static String SearchPageSelectionDialog_rememberLastUsedPage_message;
66
	public static String SearchManager_resourceChangedWarning;
68
	public static String SearchManager_resourceChangedWarning;
67
	public static String SearchManager_resourceChanged;
69
	public static String SearchManager_resourceChanged;
(-)a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties (+3 lines)
Lines 9-12 Link Here
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
#     Christian Walther (Indel AG) - Bug 399094: Add whole word option to file search
10
#     Christian Walther (Indel AG) - Bug 399094: Add whole word option to file search
11
#     Marco Descher <marco@descher.at> - http://bugs.eclipse.org/33710
11
###############################################################################
12
###############################################################################
12
13
Lines 194-197 Link Here
194
ExceptionDialog_seeErrorLogMessage= See error log for details
195
ExceptionDialog_seeErrorLogMessage= See error log for details
195
196
197
SearchPageSelectionDialog_rememberLastUsedPage_message=&Remember last used page
198
196
SearchPreferencePage_emphasizePotentialMatches= &Emphasize potential matches
199
SearchPreferencePage_emphasizePotentialMatches= &Emphasize potential matches
197
SearchPreferencePage_potentialMatchFgColor= &Foreground color for potential matches:
200
SearchPreferencePage_potentialMatchFgColor= &Foreground color for potential matches:

Return to bug 33710