All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.systemtool.provider.FastBaseMenuProvider Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy