Lines 12-13
Link Here
|
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 |
*******************************************************************************/ |
Lines 53-54
Link Here
|
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; |
Lines 91-92
Link Here
|
91 |
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider { |
93 |
public class SearchDialog extends ExtendedDialogWindow implements ISearchPageContainer, IPageChangeProvider { |
|
|
94 |
|
95 |
/** |
96 |
* The id of the last search page that was opened in the search dialog, used as key in |
97 |
* {@link DialogSettings} |
98 |
*/ |
99 |
public static final String PREVIOUS_SEARCH_PAGE= "PreviousSearchPageId_SearchDialog"; //$NON-NLS-1$ |
100 |
|
101 |
public static final String SEARCH_TAB_SELECTION_MODE_KEY = "SearchTabSelectionMode_SearchDialog"; //$NON-NLS-1$ |
102 |
public static final int SEARCH_TAB_OPENS_BEST_TAB = 0; |
103 |
public static final int SEARCH_TAB_OPENS_LAST_TAB = 1; |
92 |
|
104 |
|
Lines 147-148
Link Here
|
147 |
|
159 |
|
|
|
160 |
private final IDialogSettings defaultDialogSettings= SearchPlugin.getDefault().getDialogSettings(); |
148 |
|
161 |
|
Lines 156-157
Link Here
|
156 |
fInitialPageId= pageId; |
169 |
fInitialPageId= pageId; |
|
|
170 |
|
171 |
if (fInitialPageId == null) { |
172 |
try { |
173 |
if (defaultDialogSettings.getInt(SEARCH_TAB_SELECTION_MODE_KEY) == SEARCH_TAB_OPENS_LAST_TAB) { |
174 |
fInitialPageId= defaultDialogSettings.get(PREVIOUS_SEARCH_PAGE); |
175 |
} |
176 |
} catch (NumberFormatException nfe) { |
177 |
// will only happen once, set default behavior |
178 |
defaultDialogSettings.put(SEARCH_TAB_SELECTION_MODE_KEY, SEARCH_TAB_OPENS_BEST_TAB); |
179 |
} |
180 |
} |
181 |
|
157 |
fPageChangeListeners= null; |
182 |
fPageChangeListeners= null; |
Lines 330-331
Link Here
|
330 |
this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener); |
355 |
this.getButton(IDialogConstants.DESELECT_ALL_ID).addSelectionListener(listener); |
|
|
356 |
} |
357 |
|
358 |
protected Control createDialogArea(Composite parent) { |
359 |
Composite ret= (Composite)super.createDialogArea(parent); |
360 |
|
361 |
Label l = new Label(ret, SWT.None); |
362 |
l.setText("'Search...' opens"); |
363 |
|
364 |
Button b= new Button(ret, SWT.RADIO); |
365 |
// b.setText(SearchMessages.RememberSelectedSearchTab_message); |
366 |
b.setText("Last used tab"); |
367 |
b.setSelection((defaultDialogSettings.getInt(SEARCH_TAB_SELECTION_MODE_KEY)==SEARCH_TAB_OPENS_LAST_TAB)); |
368 |
b.addSelectionListener(new SelectionAdapter() { |
369 |
public void widgetSelected(SelectionEvent e) { |
370 |
defaultDialogSettings.put(SEARCH_TAB_SELECTION_MODE_KEY, SEARCH_TAB_OPENS_LAST_TAB); |
371 |
} |
372 |
}); |
373 |
|
374 |
b= new Button(ret, SWT.RADIO); |
375 |
b.setSelection((defaultDialogSettings.getInt(SEARCH_TAB_SELECTION_MODE_KEY)==SEARCH_TAB_OPENS_BEST_TAB)); |
376 |
b.setText("Best tab for selection"); |
377 |
b.addSelectionListener(new SelectionAdapter() { |
378 |
public void widgetSelected(SelectionEvent e) { |
379 |
defaultDialogSettings.put(SEARCH_TAB_SELECTION_MODE_KEY, SEARCH_TAB_OPENS_BEST_TAB); |
380 |
} |
381 |
}); |
382 |
return ret; |
331 |
} |
383 |
} |
Lines 524-525
Link Here
|
524 |
|
576 |
|
|
|
577 |
defaultDialogSettings.put(PREVIOUS_SEARCH_PAGE, descriptor.getId()); |
578 |
|
525 |
if (item.getControl() == null) { |
579 |
if (item.getControl() == null) { |