Package cn.com.elements.containstag.div

Examples of cn.com.elements.containstag.div.DivElementTag


     * @throws AppException
     */
    protected void parserFileElements(List<Element> fileElements, ContainHTMLElementTag boxDiv, String fileDivCss) throws AppException {
        // 文件导入元素节点
        if (!fileElements.isEmpty()) {
            DivElementTag fileDiv = new DivElementTag(super.getParser().getGroup().name() + _FILE_DIV_ID, fileDivCss);
            for (Element e : fileElements) {

                parserLinkElement(e, fileDiv, super.getParser().getValue(e));

                InputElementTag inputElement = new InputElementTag();
                inputElement.setId(e.id());
                inputElement.setType(e.type().name());
                fileDiv.addChildrenTag(inputElement);

                inputElement = new InputElementTag();
                inputElement.setId(_FILE_IMPORT_PREFIX + e.id());
                inputElement.setType(ElementEnum.BUTTON.name());
                inputElement.setValue(Element.LabelContent.getLabelContent(_IMPORT_BUTTOn_VALUE));
                fileDiv.addChildrenTag(inputElement);
            }
            boxDiv.addChildrenTag(fileDiv);
        }
    }
View Full Code Here


    @Override
    public void parser(ContainHTMLElementTag parentElement) throws AppException {

        // 生成单元素标签
        DivElementTag conditionsDiv = new DivElementTag(super.getParser().getGroup().name() + _CONDITIONS_DIV, _CONDITIONS_CSS);
        // 元素
        Element[] elements = super.getParser().getGroup().elements();
        List<Element> fileElements = new ArrayList<Element>(3);
        for (Element e : elements) {
            // 将文件元素设定到最后
            if (e.type() == ElementEnum.FILE) {
                fileElements.add(e);
                continue;
            }

            DivElementTag elementDiv = new DivElementTag(e.id() + _DIV_ID, _CONDITION_CSS);
            // 标签元素
            LabelElementTag labelElement = new LabelElementTag(e.id() + _LABEL_ID, _DISPLAY_LABEL_CSS);
            labelElement.setValue(Element.LabelContent.getLabelContent(StringUtil.isEmpty(e.label()) ? e.id().toUpperCase() : e.label()));
            elementDiv.addChildrenTag(labelElement);

            super.parserElement(null, e, elementDiv, null, _REQURIED_CSS, super.getParser().getValue(e));

            conditionsDiv.addChildrenTag(elementDiv);
        }
View Full Code Here

     * @param contentDiv
     * @param tableTdElement
     * @param tableTrElement
     */
    protected void parserCheckboxElement(Grid g, int idx, TableTrElementTag tableTrElement) {
        DivElementTag contentDiv = new DivElementTag(_CHECK_TD_ID, _CHECK_THEAD_CSS);
        TableTdElementTag tableTdElement = new TableTdElementTag(_CHECK_TD_ID);
        // check选项
        if (g.selectabled()) {
            InputElementTag checkboxElement = new InputElementTag();
            checkboxElement.setId(_SELECT_INPUT_ID);
            if (g.isMultiple()) {
                checkboxElement.setType(ElementEnum.CHECKBOX.name());
            } else {
                checkboxElement.setType(ElementEnum.RADIO.name());
            }
            checkboxElement.setValue(String.valueOf(idx - 1));
            contentDiv.addChildrenTag(checkboxElement);
            tableTdElement.addChildrenTag(contentDiv);
            tableTrElement.addChildrenTag(tableTdElement);
        }
    }
View Full Code Here

    @Override
    public void parser(ContainHTMLElementTag parentElement) throws AppException {
        Grid[] grids = super.getParser().getGroup().grids();
        // 追加容器标签
        DivElementTag containerDiv = new DivElementTag(_TABLE_CONTAINER_DIV_ID, _TABLE_CONTAINER_DIV_CSS);
        for (Grid g : grids) {

            TableElementTag tableContainer = new TableElementTag(_TABLE_CONTAINER_ID, _TABLE_CONTAINER_CSS);
            // 解析表格事件
            // TD跨列的数量
            int columnCount = parserTableEvents(g, tableContainer);
            // 解析表格内容
            parserTableTbody(columnCount, tableContainer, g);
            containerDiv.addChildrenTag(tableContainer);
        }
        parentElement.addChildrenTag(containerDiv);
    }
View Full Code Here

            tableTrElement.addChildrenTag(tableTdElement);
        }
    }

    protected int parserTableEvents(Grid g, TableElementTag tableContainer) {
        DivElementTag tableDiv = new DivElementTag(g.id() + _HEADER_TABLE_DIV_ID, _HEADER_TABLE_DIV_CSS);
        TableTdElementTag tdContainer = new TableTdElementTag();
        TableTrElementTag tableTrElement = new TableTrElementTag();
        // 添加对表格中行进行增加及删除操作的DIV
        // TODO 需要追加如果配置的删除追加就必须为可选择
        if (g.addabled() || g.deletabled()) {
            DivElementTag buttonDiv = new DivElementTag(g.id() + _TABLE_BUTTON_DIV_ID, _TABLE_BUTTON_DIV_CSS);
            if (g.addabled()) {
                InputElementTag buttonElement = new InputElementTag();
                buttonElement.setId(_ADD_ITEM_ID);
                buttonElement.setCssClass(_TABLE_BUTTON_CSS);
                buttonElement.setType(ElementEnum.BUTTON.name());
                buttonElement.setValue(Element.LabelContent.getLabelContent(_ADD_BUTTON_LABEL_ID));
                buttonElement.setOnclick(_ADDED_TABLETR_FONT + g.id() + _ADDED_TABLETR_FOOT);
                buttonDiv.addChildrenTag(buttonElement);
            }
            if (g.deletabled()) {
                InputElementTag buttonElement = new InputElementTag();
                buttonElement.setId(_DELETE_ITEM_ID);
                buttonElement.setCssClass(_TABLE_BUTTON_CSS);
                buttonElement.setType(ElementEnum.BUTTON.name());
                buttonElement.setOnclick(_DELETE_TABLE_TR_FONT + g.id() + _DELETE_TABLE_TR_FOOT);
                buttonElement.setValue(Element.LabelContent.getLabelContent(_DELETE_BUTTON_LABEL));
                buttonDiv.addChildrenTag(buttonElement);
            }
            if (g.copyabled()) {
                InputElementTag buttonElement = new InputElementTag();
                buttonElement.setId(_COPY_ITEM_ID);
                buttonElement.setCssClass(_TABLE_BUTTON_CSS);
                buttonElement.setType(ElementEnum.BUTTON.name());
                buttonElement.setValue(Element.LabelContent.getLabelContent(_COPY_BUTTON_LABEL));
                buttonElement.setOnclick(_ADDED_TABLETR_FONT + g.id() + _COPY_TABLE_TR_FOOT);
                buttonDiv.addChildrenTag(buttonElement);
            }
            tableDiv.addChildrenTag(buttonDiv);
        }
        int columnCount = parserTableThead(g, tableDiv);
        tdContainer.addChildrenTag(tableDiv);
View Full Code Here

     * @param g
     * @throws AppException
     */
    protected void parserTableTbody(int columnCount, TableElementTag tableContainer, Grid g) throws AppException {
        TableTrElementTag tableTrElement;
        DivElementTag contentDiv;
        TableTdElementTag tableTdElement;
        TableElementTag tableElement;
        DivElementTag tableDiv;
        // 表格内容
        tableTrElement = new TableTrElementTag();
        TableTdElementTag tdContainer = new TableTdElementTag();
        tdContainer.setColspan(String.valueOf(columnCount));
        tableTrElement.addChildrenTag(tdContainer);
        tableContainer.addChildrenTag(tableTrElement);
        tableDiv = new DivElementTag(g.id() + _CONTENT_TABLE_DIV_ID, _BODY_CONTAINER_CSS);
        // 填充实体bean中的数据
        // 表格元素
        tableElement = new TableElementTag(g.id() + _CONTENT_TABLE_ID, _INPUT_TABLE_CONTENT_CSS);
        List tableData = super.getParser().getGridValue(g.id());
        if (tableData != null) {
            int idx = 0;
            String cssClass = null;
            for (Object obj : tableData) {
                if (idx++ % 2 == 0) {
                    cssClass = _DOUBLE_TR_CSS;
                } else {
                    cssClass = _SINGLE_TR_CSS;
                }
                tableTrElement = new TableTrElementTag(g.id() + _CONTENT_TABLE_TR_ID + idx, cssClass);
                // 解析表格选择框
                parserCheckboxElement(g, idx, tableTrElement);
                for (Element e : g.columns()) {
                    tableTdElement = new TableTdElementTag(e.id() + _CONTENT_TABLE_TD_ID);
                    contentDiv = new DivElementTag(e.id() + _CONTENT_DIV_ID, _CONTENT_DIV_CSS);
                    // 解析单元素
                    parserElement(g.id(), e, contentDiv, null, null, super.getParser().invokeValue(obj, e));
                    tableTdElement.addChildrenTag(contentDiv);
                    tableTrElement.addChildrenTag(tableTdElement);
                }
                tableElement.addChildrenTag(tableTrElement);
            }
        }
        tableDiv.addChildrenTag(tableElement);
        tdContainer.addChildrenTag(tableDiv);
    }
View Full Code Here

     * @return
     */
    protected int parserTableThead(Grid g, DivElementTag tableDiv) {
        int columnCount = 0;

        DivElementTag contentDiv;
        TableElementTag tableElement;
        // 表格元素
        tableElement = new TableElementTag(g.id() + _HEADER_TABLE_ID, _INPUT_TABLE_HEADER_CSS);
        // 表格头元素
        TableTheadElementTag theadContainer = new TableTheadElementTag();
        TableThElementTag thContainer = new TableThElementTag();
        if (g.selectabled()) {
            contentDiv = new DivElementTag(_CHECK_TD_ID, _CHECK_THEAD_CSS);
            if (g.isMultiple()) {
                InputElementTag checkboxElement = new InputElementTag();
                checkboxElement.setId(_SELECT_ALL_ID);
                checkboxElement.setType(ElementEnum.CHECKBOX.name());
                checkboxElement.setOnclick(_SELECT_ALL_EVENT);
                contentDiv.addChildrenTag(checkboxElement);
            }
            thContainer.addChildrenTag(contentDiv);
            theadContainer.addChildrenTag(thContainer);
        }
        LabelElementTag labelElement = null;
        for (Element column : g.columns()) {
            thContainer = new TableThElementTag();
            contentDiv = new DivElementTag(column.id() + _CONTENT_TABLE_ELEMNTS_DIV_ID, _CONTENT_DIV_CSS);
            labelElement = new LabelElementTag();
            labelElement.setValue(Element.LabelContent.getLabelContent(StringUtil.isEmpty(column.label()) ? column.id().toUpperCase() : column.label()));
            contentDiv.addChildrenTag(labelElement);
            if (column.required()) {
                parserRequiredElement(column, contentDiv, _REQUIRED_CSS);
            }
            theadContainer.addChildrenTag(thContainer);
            thContainer.addChildrenTag(contentDiv);
View Full Code Here

    private static final String _BUTTON_DIV = "buttonDiv";

    protected void component(String divCss, String actionCss, String buttionCss, ContainHTMLElementTag parentElement) throws AppException {
        Action[] actions = super.getParser().getGroup().form().actions();
        if (actions != null && actions.length > 0) {
            DivElementTag actionDiv = new DivElementTag(super.getParser().getGroup().name() + _ACTION_DIV, divCss);

            for (Action a : actions) {
                DivElementTag inputDiv = new DivElementTag(a.id() + _BUTTON_DIV, actionCss);
                // 判断当前操作是否为当前人所具有的权限
                if (super.getPermission() != null && !super.getPermission().validate(super.getParser().getBundleClassName(), a.id())) {
                    continue;
                }

                InputElementTag buttonElement = new InputElementTag();
                buttonElement.setId(a.id());
                buttonElement.setCssClass(buttionCss);
                buttonElement.setType(a.submitType().name());
                buttonElement.setValue(Element.LabelContent.getLabelContent(StringUtil.isEmpty(a.label()) ? a.id().toUpperCase() : a.label()));
                buttonElement.setOnclick(a.onclick());
                buttonElement.setTabindex(String.valueOf(super.getTabIndex().next()));
                inputDiv.addChildrenTag(buttonElement);

                actionDiv.addChildrenTag(inputDiv);
            }
            parentElement.addChildrenTag(actionDiv);
View Full Code Here

    @Override
    public void parser(ContainHTMLElementTag parentElement) throws AppException {

        // 生成单元素标签
        DivElementTag conditionsDiv = new DivElementTag(super.getParser().getGroup().name() + _CONDITIONS_DIV_ID, _CONDITIONS_DIV_CSS);
        // 生成单元素标签
        DivElementTag boxsDiv = new DivElementTag(super.getParser().getGroup().name() + _BOXS_DIV_ID, _BOXS_DIV_CSS);
        conditionsDiv.addChildrenTag(boxsDiv);

        // 设定页面标题信息
        DivElementTag titleDiv = new DivElementTag(super.getParser().getGroup().name() + _TITLE_DIV_ID, _TITLE_CSS);
        SpanElementTag titleContent = new SpanElementTag();
        titleContent.setValue(Element.LabelContent.getLabelContent(super.getParser().getForm().label()));
        titleDiv.addChildrenTag(titleContent);
        boxsDiv.addChildrenTag(titleDiv);

        // 生成条件内容
        DivElementTag boxDiv = new DivElementTag(super.getParser().getGroup().name() + _BOX_DIV_ID, _BOX_DIV_CSS);
        boxsDiv.addChildrenTag(boxDiv);
        // 元素
        Element[] elements = super.getParser().getGroup().elements();
        List<Element> fileElements = new ArrayList<Element>(3);
        for (Element e : elements) {
            // 将文件元素设定到最后
            if (e.type() == ElementEnum.FILE) {
                fileElements.add(e);
                continue;
            }

            DivElementTag contentDiv = new DivElementTag(e.id() + _DIV_ID, _DIV_CSS);
            // 标签元素
            LabelElementTag labelElement = new LabelElementTag();
            labelElement.setValue(Element.LabelContent.getLabelContent(StringUtil.isEmpty(e.label()) ? e.id().toUpperCase() : e.label()));
            contentDiv.addChildrenTag(labelElement);


            // 元素内容
            DivElementTag elementDiv = new DivElementTag(e.id() + _INPUT_DIV_ID, _INPUT_DIV_CSS);
            super.parserElement(null, e, elementDiv, _ELEMENT_CSS, _REQUIRED_CSS, super.getParser().getValue(e));

            contentDiv.addChildrenTag(elementDiv);
            boxDiv.addChildrenTag(contentDiv);
        }
View Full Code Here

    private static final String _VMI_BTNMAIN_C = "vmi_btnmain_c";

    @Override
    public void parser(ContainHTMLElementTag parentElement) throws AppException {

        DivElementTag buttonsDiv = new DivElementTag(super.getParser().getGroup().name() + _BUTTONS_DIV, _VMIADDG_NEXT_BUTTON);
        super.component(_VMIADDG_B_BUTTON, _VMIADDG_B_BUT, _VMI_BTNMAIN_C, buttonsDiv);
        parentElement.addChildrenTag(buttonsDiv);

    }
View Full Code Here

TOP

Related Classes of cn.com.elements.containstag.div.DivElementTag

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.