[]
如果一个属性在设计器中是否显示,需要受到其他一个或几个属性影响,可以通过重写 getDesignerPropertyVisible方法实现。
public class MyPluginServerCommand extends Command implements ICommandExecutableInServerSide {
private boolean enableCache;
private int cacheTime;
@Override
public ExecuteResult execute(IServerCommandExecuteContext dataContext) {
return new ExecuteResult();
}
@Override
public boolean getDesignerPropertyVisible(String propertyName, CommandScope commandScope) {
if ("cacheTime".equals(propertyName))
{
return enableCache;
}
return super.getDesignerPropertyVisible(propertyName, commandScope);
}
@Override
public String toString() {
return "我的服务端命令插件";
}
}
设计器效果: