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)); |