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