增强公式编辑器,能让公式支持脚本和实时计算。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 lines
1.0 KiB

package com.fr.solution.plugin.design.formula.compat;
import com.fanruan.api.util.StringKit;
import com.fr.design.formula.NameAndDescription;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-09-03
*/
public abstract class AbstractNameAndDescription implements NameAndDescription {
@Override
public String searchResult(String keyWord, boolean findDescription) {
String functionName = getName();
if (StringKit.isBlank(functionName)) {
return null;
}
int sign = 1;
int length = keyWord.length();
String temp = functionName.toUpperCase();
for (int j = 0; j < length; j++) {
String check = keyWord.substring(j, j + 1);
int index = temp.indexOf(check.toUpperCase());
if (index == -1) {
sign = 0;
break;
} else {
temp = temp.substring(index + 1);
}
}
if (sign == 1) {
return functionName;
}
return null;
}
}