package com.brframework.commoncms.core.layout.column;

import com.brframework.commoncms.annatotion.column.TimeColumn;
import com.brframework.commoncms.annatotion.column.TreeColumn;
import com.brframework.commoncms.core.cms.TreeNode;
import com.brframework.commoncms.core.layout.AbstractPanelLayoutColumn;
import com.google.common.collect.Lists;
import lombok.Data;
import org.springframework.core.annotation.AnnotationUtils;

import java.lang.reflect.Field;
import java.time.LocalTime;
import java.util.List;

/**
 * 树
 * @author xu
 * @date 2018/9/26 15:03
 * @see com.brframework.commoncms.annatotion.column.TreeColumn
 */
@Data
public class LayoutTreeColumn extends AbstractPanelLayoutColumn {

    private static final String TYPE = "TREE";
    private String key;
    private String title;

    private String optionsMappingContext;

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public void create(Field columnField) throws Throwable {
        init(columnField);

        TreeColumn treeColumn = AnnotationUtils.findAnnotation(columnField, TreeColumn.class);
        assert treeColumn != null;
        optionsMappingContext = treeColumn.optionsMappingContext();
    }

    @Override
    public List<Class<?>> supportType() {
        return null;
    }

}
