1 package org.simantics.modeling.ui.scl.expressions;
3 import org.eclipse.jface.viewers.Viewer;
4 import org.eclipse.jface.viewers.ViewerFilter;
6 public class SCLExpressionItemFilter extends ViewerFilter {
8 private String searchString;
10 public void setSearchText(String s) {
11 // ensure that the value can be used for matching
12 this.searchString = (".*" + s + ".*").toLowerCase();
16 public boolean select(Viewer viewer, Object parentElement, Object element) {
17 if (searchString == null || searchString.length() == 0)
19 SCLExpressionTableEntry entry = (SCLExpressionTableEntry) element;
20 if (entry.getContent().toLowerCase().matches(searchString))