Index: Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java,v
retrieving revision 1.1
diff -u -r1.1 AbstractElementListSelectionDialog.java
--- Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java 24 Sep 2002 16:41:54 -0000 1.1
+++ Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java 17 Nov 2002 04:01:22 -0000
@@ -11,6 +11,7 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
@@ -42,6 +43,8 @@
private Label fMessage;
+ private Button fCaseSensitiveCheckbox;
+
protected FilteredList fFilteredList;
private Text fFilterText;
@@ -85,6 +88,12 @@
*/
public void setIgnoreCase(boolean ignoreCase) {
fIgnoreCase= ignoreCase;
+
+ if ((null != fCaseSensitiveCheckbox)
+ && (fCaseSensitiveCheckbox.getSelection() != ignoreCase)) {
+
+ fCaseSensitiveCheckbox.setSelection(!ignoreCase);
+ }
}
/**
@@ -254,6 +263,45 @@
}
/**
+ * Creates a checkbox if name is not null
.
+ *
+ * @param parent the parent composite.
+ * @param name the name of the checkbox.
+ * @return returns a checkbox if a name was given, null
+ * otherwise.
+ */
+ protected Button createCaseSensitiveCheckbox(Composite composite, String name) {
+ if (name == null)
+ return null;
+
+ Button button= new Button(composite, SWT.CHECK);
+
+ GridData data= new GridData();
+ data.grabExcessVerticalSpace= false;
+ data.grabExcessHorizontalSpace= true;
+ data.horizontalAlignment= GridData.END;
+ data.verticalAlignment= GridData.BEGINNING;
+ button.setLayoutData(data);
+
+ button.setText(name);
+ button.setSelection(!isCaseIgnored());
+
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ setIgnoreCase(fCaseSensitiveCheckbox.getSelection());
+ fFilteredList.setIgnoreCase(!isCaseIgnored());
+ }
+ });
+
+ fCaseSensitiveCheckbox= button;
+
+ return button;
+ }
+
+ /**
* Handles a selection changed event.
* By default, the current selection is validated.
*/
@@ -275,7 +323,7 @@
if (fValidator != null) {
status= fValidator.validate(elements);
} else {
- status= new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, "", null);
+ status= new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
}
} else {
if (fFilteredList.isEmpty()) {
Index: Eclipse UI/org/eclipse/ui/dialogs/FilteredList.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredList.java,v
retrieving revision 1.2
diff -u -r1.2 FilteredList.java
--- Eclipse UI/org/eclipse/ui/dialogs/FilteredList.java 24 Oct 2002 16:37:29 -0000 1.2
+++ Eclipse UI/org/eclipse/ui/dialogs/FilteredList.java 17 Nov 2002 04:01:22 -0000
@@ -360,6 +360,28 @@
updateList();
}
+ /**
+ * Sets the case sensitivity of the filter.
+ * @param ignore whether the filter should be case insensitive
+ * (true
) or case sensitive (false
).
+ * @since 2.1
+ */
+ public void setIgnoreCase(boolean ignore) {
+ fIgnoreCase= ignore;
+
+ updateList();
+ }
+
+ /**
+ * Tests if the filter ignores case.
+ * @return returns true
if the filter is not case senstive,
+ * false
otherwise.
+ * @since 2.1
+ */
+ public boolean isIgnoreCase() {
+ return fIgnoreCase;
+ }
+
private void updateList() {
fFilteredCount= filter();
fFoldedCount= fold();
Index: Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java,v
retrieving revision 1.1
diff -u -r1.1 TwoPaneElementSelector.java
--- Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java 24 Sep 2002 16:41:54 -0000 1.1
+++ Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java 17 Nov 2002 04:01:22 -0000
@@ -32,6 +32,7 @@
*/
public class TwoPaneElementSelector extends AbstractElementListSelectionDialog {
+ private String fCaseSensitiveLabel;
private String fUpperListLabel;
private String fLowerListLabel;
private ILabelProvider fQualifierRenderer;
@@ -74,6 +75,16 @@
}
/**
+ * Sets the case sensitive checkbox label. If the label is null
+ * (default), no checkbox is created.
+ *
+ * @since 2.1
+ */
+ public void setCaseSensitiveLabel(String label) {
+ fCaseSensitiveLabel= label;
+ }
+
+ /**
* Sets the elements to be displayed.
* @param elements the elements to be displayed.
*/
@@ -89,6 +100,7 @@
createMessageArea(contents);
createFilterText(contents);
+ createCaseSensitiveCheckbox(contents, fCaseSensitiveLabel);
createLabel(contents, fUpperListLabel);
createFilteredList(contents);
createLabel(contents, fLowerListLabel);