* IBM Corporation - initial API and implementation
* Sebastian Davids <sdavids@gmx.de> - Fix for bug 19346 - Dialog font should be activated and used by other components.
*******************************************************************************/
+/*
+ * 2016-09-21 Gun Kim gune.kim@samsung.com
+ * Modification by S-Core Co., Ltd.
+ * 1. fix a bug of processing wildcard
+ */
package org.eclipse.ui.dialogs;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
-
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@Override
public void setFilter(String pattern, boolean ignoreCase,
boolean ignoreWildCards) {
- fMatcher = new StringMatcher(pattern + '*', ignoreCase,
+ /* Tizen */
+ fMatcher = new StringMatcher(getPattern(pattern), ignoreCase,
ignoreWildCards);
+ // fMatcher = new StringMatcher(pattern + '*', ignoreCase,
+ // ignoreWildCards);
+ /* ===== */
}
@Override
public boolean match(Object element) {
return fMatcher.match(fLabelProvider.getText(element));
}
+
+ /* Tizen */
+ private String getPattern(String originPattern) {
+ int length = originPattern.length();
+ int backSlashCount = 0;
+ while (length > 1) {
+ if (originPattern.charAt(length - 1) == '\\') {
+ length--;
+ backSlashCount++;
+ } else {
+ break;
+ }
+ }
+
+ if (backSlashCount % 2 == 0) {
+ return originPattern + "*"; //$NON-NLS-1$
+ } else {
+ // In this case, "*" isn't wildcard, it is just "*" literally
+ // So, add "\\*" instead of "*" to use "*" as wildcard
+ return originPattern + "\\*"; //$NON-NLS-1$
+ }
+ }
+ /* ===== */
}
private Table fList;
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
+/*
+ * 2016-09-21 Gun Kim gune.kim@samsung.com
+ * Modification by S-Core Co., Ltd.
+ * 1. fix a bug of processing wildcard
+ */
package org.eclipse.ui.internal.misc;
import java.util.Vector;
}
if (fPattern.endsWith("*")) {//$NON-NLS-1$
/* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar = true;
- }
+ /* Tizen */
+ int length = fLength;
+ int backSlashCount = 0;
+ while (length > 1) {
+ if (fPattern.charAt(length - 2) == '\\') {
+ length--;
+ backSlashCount++;
+ } else {
+ break;
+ }
+ }
+ if (backSlashCount % 2 == 0) {
+ fHasTrailingStar = true;
+ }
+ // if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
+ // fHasTrailingStar = true;
+ // }
+ /* ===== */
}
Vector temp = new Vector();