Package org.jeecgframework.core.annotation.config

Examples of org.jeecgframework.core.annotation.config.AutoMenuOperation


          //获取该类的所有方法
          Method[] methods = clazz.getDeclaredMethods();
          for(Method method : methods){
            //判断当前方法是否设置了菜单操作按钮注解
            if (method.isAnnotationPresent(AutoMenuOperation.class)) {
              AutoMenuOperation autoMenuOperation = method.getAnnotation(AutoMenuOperation.class);
              //操作码必须填写,否则不进行菜单操作按钮的匹配
              if (StringUtil.isNotEmpty(autoMenuOperation.code())) {
                StringBuffer menuOperationKey = new StringBuffer();
                menuOperationKey.append(function == null ? "" : function.getId());
                menuOperationKey.append(KEY_SPLIT);
               
                String code = "";
                //设置code前缀
                if (autoMenuOperation.codeType() == MenuCodeType.TAG) {
                  code = autoMenuOperation.code();
                } else if (autoMenuOperation.codeType() == MenuCodeType.ID) {
                  code = MENU_TYPE_ID + autoMenuOperation.code();
                } else if (autoMenuOperation.codeType() == MenuCodeType.CSS) {
                  code = MENU_TYPE_CSS + autoMenuOperation.code();
                }
                menuOperationKey.append(code);
               
                //判断菜单操作按钮map的key是否包含当前key,不包含则插入一条菜单操作按钮数据
                if (!operationMap.containsKey(menuOperationKey.toString())) {
                  TSOperation operation = new TSOperation();
                  operation.setOperationname(autoMenuOperation.name());
                  operation.setOperationcode(code);
                  operation.setOperationicon(null);
                  operation.setStatus(Short.parseShort(Integer.toString(autoMenuOperation.status())));
                  operation.setTSFunction(function);
                 
                  String iconId = autoMenuOperation.icon();
                  if (StringUtil.isNotEmpty(iconId)) {
                    TSIcon icon = new TSIcon();
                    icon.setId(iconId);
                    operation.setTSIcon(icon);
                  } else {
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.annotation.config.AutoMenuOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.