Package cn.com.elements.singletag.link

Examples of cn.com.elements.singletag.link.LinkElementTag


     * @param elementDiv
     * @throws AppException
     */
    protected void parserLinkElement(Element e, ContainHTMLElementTag elementDiv, String value) throws AppException {
        if (e.link() != null) {
            LinkElementTag linkElement = new LinkElementTag();
            // 设定动态参数参数
            StringBuilder href = new StringBuilder(_HREF_VALUE);
            Link link = e.link();
            // 设定链接属性
            if (!StringUtil.isEmpty(link.url())) {
                href = new StringBuilder(link.url());
            }
            // 设定参数列表
            if (link.parameters() != null && link.parameters().length > 0) {
                if (href.indexOf(_PARAMETER_SIGN_CHAR) == -1) {
                    href.append(_PARAMETER_SIGN_CHAR);
                }
                int idx = 0;
                for (String parameter : link.parameters()) {
                    if (idx++ > 0) {
                        href.append(_PARAMETER_CONCATE_CHAR);
                    }
                    settingLinkHref(href, parameter, e);
                }
            }
            linkElement.setHref(href.toString());
            linkElement.setValue(value);
            linkElement.setOnclick(e.onclick());
            elementDiv.addChildrenTag(linkElement);
        }
    }
View Full Code Here


     * @return
     */
    private AbstractHtmlElementTag mainElement(AbstractHtmlElementTag childElement) {
        ULElementTag currentElement = new ULElementTag();
        LIElementTag liElement = null;
        LinkElementTag linkElement = null;
        String cssClass = _UL_HIDE_CSS;
        liElement = new LIElementTag();
        linkElement = new LinkElementTag();
        linkElement.setHref(_CURRENT_PAGE_HREF);

        linkElement.setValue(_MY_TASKS);
        linkElement.setCssClass(cssClass);
        liElement.addChildrenTag(linkElement);
        liElement.addChildrenTag(childElement);
        currentElement.addChildrenTag(liElement);
        return currentElement;
    }
View Full Code Here

     */
    private AbstractHtmlElementTag createTaskTag(List<Task> tasks) throws AppException {
        if (tasks != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            AbstractHtmlElementTag childElement = null;
            int nodeCount = 0;
            Task lastNode = null;
            List<Task> nodeTasks = new ArrayList<Task>(3);
            for (Task m : tasks) {
                if (lastNode == null) {
                    lastNode = m;
                }

                if (!lastNode.getNode().equals(m.getNode())) {

                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(StringUtil.isEmpty(lastNode.getUrl()) ? _CURRENT_PAGE_HREF : lastNode.getUrl());

                    linkElement.setValue(lastNode.getDisplay() + _CONTENT_HINT_FONT + nodeCount + _CONTENT_HINT_FOOT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    childElement = this.createTasksTag(nodeTasks);
                    if (childElement != null) {
                        liElement.addChildrenTag(childElement);
                    }

                    ulElement.addChildrenTag(liElement);
                    nodeCount = 0;
                    nodeTasks.clear();
                    lastNode = m;
                }
                nodeCount++;
                nodeTasks.add(m);

            }
            if (lastNode != null) {

                liElement = new LIElementTag();
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(lastNode.getUrl()) ? _CURRENT_PAGE_HREF : lastNode.getUrl());

                linkElement.setValue(lastNode.getDisplay() + _CONTENT_HINT_FONT + nodeCount + _CONTENT_HINT_FOOT);
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                childElement = this.createTasksTag(nodeTasks);
                if (childElement != null) {
                    liElement.addChildrenTag(childElement);
                }
View Full Code Here

     */
    private AbstractHtmlElementTag createTasksTag(List<Task> tasks) throws AppException {
        if (tasks != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            AbstractHtmlElementTag childElement = null;
            int idxCount = 0;
            for (Task m : tasks) {
                liElement = new LIElementTag();
                m.setDetails(ProcessFactory.getProcess(m.getNode()).getTaskDetails(m.getTaskid()));
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(m.getUrl()) ? _CURRENT_PAGE_HREF : m.getUrl());

                linkElement.setValue(m.getTaskid() + _CONTENT_HINT_FONT + m.getDetails().size() + _CONTENT_HINT_FOOT);
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                childElement = this.createTaskDetailsTag(m.getDetails());
                if (childElement != null) {
                    liElement.addChildrenTag(childElement);
                }
                if (idxCount++ == 10) {
                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(_CURRENT_PAGE_HREF);
                    linkElement.setValue(_MORE_THAN_10_TASK_HINIT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    ulElement.addChildrenTag(liElement);
                    break;
                }
                ulElement.addChildrenTag(liElement);
View Full Code Here

     * @return
     */
    private AbstractHtmlElementTag mainElement(AbstractHtmlElementTag childElement) {
        ULElementTag currentElement = new ULElementTag();
        LIElementTag liElement = null;
        LinkElementTag linkElement = null;
        String cssClass = _UL_HIDE_CSS;
        liElement = new LIElementTag();
        linkElement = new LinkElementTag();
        linkElement.setHref(_CURRENT_PAGE_HREF);

        linkElement.setValue(_MY_TASKS);
        linkElement.setCssClass(cssClass);
        liElement.addChildrenTag(linkElement);
        liElement.addChildrenTag(childElement);
        currentElement.addChildrenTag(liElement);
        return currentElement;
    }
View Full Code Here

    private AbstractHtmlElementTag createTaskDetailsTag(List<DataDetails> details) {
        if (details != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            int idxCount = 0;
            for (DataDetails m : details) {
                liElement = new LIElementTag();
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(m.getUrl()) ? _CURRENT_PAGE_HREF : getLinkHref(m.getUrl(), m.getParameter(), m.getContent()));

                linkElement.setValue(m.getContent());
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                if (idxCount++ == 10) {
                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(m.getUrl());
                    linkElement.setValue(_MORE_THAN_10_TASK_HINIT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    ulElement.addChildrenTag(liElement);
                    break;
                }
                ulElement.addChildrenTag(liElement);
View Full Code Here

     */
    private AbstractHtmlElementTag createTaskTag(List<Task> tasks) throws AppException {
        if (tasks != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            AbstractHtmlElementTag childElement = null;
            int nodeCount = 0;
            Task lastNode = null;
            List<Task> nodeTasks = new ArrayList<Task>(3);
            for (Task m : tasks) {
                if (lastNode == null) {
                    lastNode = m;
                }

                if (!lastNode.getNode().equals(m.getNode())) {

                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(StringUtil.isEmpty(lastNode.getUrl()) ? _CURRENT_PAGE_HREF : lastNode.getUrl());

                    linkElement.setValue(lastNode.getDisplay() + _CONTENT_HINT_FONT + nodeCount + _CONTENT_HINT_FOOT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    childElement = this.createTasksTag(nodeTasks);
                    if (childElement != null) {
                        liElement.addChildrenTag(childElement);
                    }

                    ulElement.addChildrenTag(liElement);
                    nodeCount = 0;
                    nodeTasks.clear();
                    lastNode = m;
                }
                nodeCount++;
                nodeTasks.add(m);

            }
            if (lastNode != null) {

                liElement = new LIElementTag();
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(lastNode.getUrl()) ? _CURRENT_PAGE_HREF : lastNode.getUrl());

                linkElement.setValue(lastNode.getDisplay() + _CONTENT_HINT_FONT + nodeCount + _CONTENT_HINT_FOOT);
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                childElement = this.createTasksTag(nodeTasks);
                if (childElement != null) {
                    liElement.addChildrenTag(childElement);
                }
View Full Code Here

     */
    private AbstractHtmlElementTag createTasksTag(List<Task> tasks) throws AppException {
        if (tasks != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            AbstractHtmlElementTag childElement = null;
            int idxCount = 0;
            for (Task m : tasks) {
                liElement = new LIElementTag();
                m.setDetails(ProcessFactory.getProcess(m.getNode()).getTaskDetails(m.getTaskid()));
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(m.getUrl()) ? _CURRENT_PAGE_HREF : m.getUrl());

                linkElement.setValue(m.getTaskid() + _CONTENT_HINT_FONT + m.getDetails().size() + _CONTENT_HINT_FOOT);
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                childElement = this.createTaskDetailsTag(m.getDetails());
                if (childElement != null) {
                    liElement.addChildrenTag(childElement);
                }
                if (idxCount++ == 10) {
                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(_CURRENT_PAGE_HREF);
                    linkElement.setValue(_MORE_THAN_10_TASK_HINIT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    ulElement.addChildrenTag(liElement);
                    break;
                }
                ulElement.addChildrenTag(liElement);
View Full Code Here

    private AbstractHtmlElementTag createTaskDetailsTag(List<DataDetails> details) {
        if (details != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = _BLANK_CSS;
            int idxCount = 0;
            for (DataDetails m : details) {
                liElement = new LIElementTag();
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(m.getUrl()) ? _CURRENT_PAGE_HREF : getLinkHref(m.getUrl(), m.getParameter(), m.getContent()));

                linkElement.setValue(m.getContent());
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                if (idxCount++ == 10) {
                    liElement = new LIElementTag();
                    linkElement = new LinkElementTag();
                    linkElement.setHref(m.getUrl());
                    linkElement.setValue(_MORE_THAN_10_TASK_HINIT);
                    linkElement.setCssClass(cssClass);
                    liElement.addChildrenTag(linkElement);
                    ulElement.addChildrenTag(liElement);
                    break;
                }
                ulElement.addChildrenTag(liElement);
View Full Code Here

     */
    private AbstractHtmlElementTag createMenus(List<Menu> menus, int levelCount) {
        if (menus != null) {
            ULElementTag ulElement = new ULElementTag();
            LIElementTag liElement = null;
            LinkElementTag linkElement = null;
            String cssClass = (levelCount == 0 ? _UL_HIDE_CSS : _BLANK_CSS);
            AbstractHtmlElementTag childElement = null;
            for (Menu m : menus) {
                liElement = new LIElementTag(m.getId());
                linkElement = new LinkElementTag();
                linkElement.setHref(StringUtil.isEmpty(m.getUrl()) ? _CURRENT_PAGE_HREF : m.getUrl());
                linkElement.setValue(m.getLabel());
                linkElement.setCssClass(cssClass);
                liElement.addChildrenTag(linkElement);
                childElement = this.createMenus(m.getSubmenus(), 1);
                if (childElement != null) {
                    liElement.addChildrenTag(childElement);
                }
View Full Code Here

TOP

Related Classes of cn.com.elements.singletag.link.LinkElementTag

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.