package com.changhong.epc.rely.api.tool.power.function;
|
|
import com.googlecode.aviator.runtime.type.AviatorBoolean;
|
import com.googlecode.aviator.runtime.type.AviatorObject;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.Map;
|
|
public class HideButton extends ShowButtonAbstractFunction {
|
|
@Override
|
public AviatorObject call(Map<String, Object> env, AviatorObject arg1) {
|
addHideButton(env, arg1.stringValue(env));
|
return AviatorBoolean.TRUE;
|
}
|
|
protected void addHideButton(Map<String, Object> env, String buttonName){
|
List<String> hides = (List<String>) env.get("hide");
|
if(hides == null){
|
env.put("hide", hides = new ArrayList<>());
|
}
|
hides.add(buttonName);
|
}
|
|
@Override
|
public String getName() {
|
return "hide";
|
}
|
}
|