com.fastchar.systemtool.provider.FastBaseMenuProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastchar-systemtool Show documentation
Show all versions of fastchar-systemtool Show documentation
FastChar-SystemTool is a FastChar-ExtJs plugin.
package com.fastchar.systemtool.provider;
import com.fastchar.core.FastChar;
import com.fastchar.extjs.core.menus.FastMenuInfo;
import com.fastchar.extjs.interfaces.IFastMenuListener;
import com.fastchar.systemtool.FastSystemToolConfig;
import com.fastchar.utils.FastClassUtils;
/**
* @author 沈建(Janesen)
* @date 2021/6/3 15:57
*/
public class FastBaseMenuProvider implements IFastMenuListener {
@Override
public boolean onAddMenu(FastMenuInfo menuInfo) {
FastSystemToolConfig config = FastChar.getConfig(FastSystemToolConfig.class);
if (menuInfo.getText().equals("任务计划日志")) {
if (!config.isLogJob()) {
return false;
}
if (FastClassUtils.getClass("com.fastchar.job.FastJob", false) == null) {
return false;
}
}
if (menuInfo.getText().equals("系统HTTP日志")) {
if (!config.isLogHttp()) {
return false;
}
if (FastClassUtils.getClass("com.fastchar.http.core.FastHttpRequest", false) == null) {
return false;
}
}
if (menuInfo.getText().equals("系统WebDriver日志")) {
if (!config.isLogSelenium()) {
return false;
}
if (FastClassUtils.getClass("com.fastchar.selenium.FastSeleniumConfig", false) == null) {
return false;
}
}
if (menuInfo.getText().equals("系统请求日志")) {
return config.isLogActionRequest();
}
if (menuInfo.getText().equals("系统SQL日志")) {
return config.isLogSql();
}
return true;
}
}