mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Fix for bug 235482
This commit is contained in:
parent
037111a067
commit
d7a8770a02
1 changed files with 37 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX - Initial API and implementation
|
* QNX - Initial API and implementation
|
||||||
|
* IBM Corporation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.search;
|
package org.eclipse.cdt.internal.ui.search;
|
||||||
|
@ -39,8 +40,10 @@ import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.ui.IEditorSite;
|
import org.eclipse.ui.IEditorSite;
|
||||||
import org.eclipse.ui.IViewSite;
|
import org.eclipse.ui.IViewSite;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
|
@ -378,11 +381,36 @@ public class PDOMSearchPage extends DialogPage implements ISearchPage {
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
result.setLayout( layout );
|
result.setLayout( layout );
|
||||||
|
|
||||||
|
Listener limitToListener = new Listener() {
|
||||||
|
public void handleEvent(Event event) {
|
||||||
|
Button me = (Button)event.widget;
|
||||||
|
if (me == limitToButtons[limitToAllButtonIndex]) {
|
||||||
|
if (me.getSelection()) {
|
||||||
|
for (int i = 0; i < limitToButtons.length; ++i) {
|
||||||
|
if (i != limitToAllButtonIndex) {
|
||||||
|
limitToButtons[i].setSelection(true);
|
||||||
|
limitToButtons[i].setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < limitToButtons.length; ++i) {
|
||||||
|
if (i != limitToAllButtonIndex) {
|
||||||
|
limitToButtons[i].setSelection(false);
|
||||||
|
limitToButtons[i].setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setPerformActionEnabled();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
limitToButtons = new Button[limitToText.length];
|
limitToButtons = new Button[limitToText.length];
|
||||||
for( int i = 0; i < limitToText.length; i++ ){
|
for( int i = 0; i < limitToText.length; i++ ){
|
||||||
Button button = new Button(result, SWT.RADIO);
|
Button button = new Button(result, SWT.CHECK);
|
||||||
button.setText( limitToText[i] );
|
button.setText( limitToText[i] );
|
||||||
button.setData( limitToData[i] );
|
button.setData( limitToData[i] );
|
||||||
|
button.addListener(SWT.Selection, limitToListener);
|
||||||
limitToButtons[i] = button;
|
limitToButtons[i] = button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,9 +596,15 @@ public class PDOMSearchPage extends DialogPage implements ISearchPage {
|
||||||
|
|
||||||
if ((searchFlags & PDOMSearchQuery.FIND_ALL_OCCURANCES) == PDOMSearchQuery.FIND_ALL_OCCURANCES) {
|
if ((searchFlags & PDOMSearchQuery.FIND_ALL_OCCURANCES) == PDOMSearchQuery.FIND_ALL_OCCURANCES) {
|
||||||
limitToButtons[limitToAllButtonIndex].setSelection(true);
|
limitToButtons[limitToAllButtonIndex].setSelection(true);
|
||||||
|
for (int i = 0; i < limitToButtons.length; ++i) {
|
||||||
|
if (i != limitToAllButtonIndex) {
|
||||||
|
limitToButtons[i].setSelection(true);
|
||||||
|
limitToButtons[i].setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
limitToButtons[limitToAllButtonIndex].setSelection(false);
|
limitToButtons[limitToAllButtonIndex].setSelection(false);
|
||||||
for (int i = 0; i < limitToButtons.length - 2; ++i) {
|
for (int i = 0; i < limitToButtons.length - 1; ++i) {
|
||||||
limitToButtons[i].setSelection(
|
limitToButtons[i].setSelection(
|
||||||
(searchFlags & ((Integer)limitToButtons[i].getData()).intValue()) != 0);
|
(searchFlags & ((Integer)limitToButtons[i].getData()).intValue()) != 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue