Package org.apache.ecs.html

Examples of org.apache.ecs.html.Div


            width = "90%";

        // -----------
        // Title table
        // -----------
        Div titleDiv = new Div();
        titleDiv.addAttribute("align", AlignType.RIGHT);

        // Location path
        if(path != null)
            titleDiv.addElement(path);
        // Help link
        if(helpId != null && helpLinkResource != null) {
            try {
                A helpLink = helpLinkResource.getHelpLink(helpId, lang);
                if(helpLink != null)
                    titleDiv.addElement(helpLink);
            }
            //catch(java.sql.SQLException sqle) {
            //sqle.printStackTrace();
            //}
            catch(Exception e) {
                e.printStackTrace();
            }
        }

        Table titleTable = new Table()
            .setWidth(width)
            .setBorder(0)
            .setAlign(AlignType.CENTER)
            .setCellPadding(0)
            .setCellSpacing(0)
            .addElement(new TR().addElement(new TD().addElement(titleDiv)));

        // ------------
        // Header table
        // ------------

        UL headerList = new UL();
        for(int i = 0; i < texts.length; i++) {
            LI listItem = new LI();
            listItem.setNeedClosingTag(true);
            if(i == up)
                listItem.setID("current");

            Span headerSpan = new Span();

            String link = links != null && links[i] != null ? links[i] : null;
            String text = texts[i] != null ? texts[i] : "";
            text = text.trim();

            if(link == null){
                link = "#";               
            } else if(link.length() == 0){
              link = "#";
              listItem.setID("dummy");
            }
           
            if(parameters != null) {
                link += parameters;
            }
            A anchor = new A(link.trim(), text);
            anchor.setOnMouseOver("window.status='" + text + "'; return true");
            anchor.setOnMouseOut("window.status=''; return true");
            headerSpan.addElement(anchor);

            headerList.addElement(listItem.addElement(headerSpan));
        }

        Table headerTable = new Table()
            .setWidth(width)
            .setBorder(0)
            .setAlign(AlignType.CENTER)
            .setCellSpacing(0)
            .setCellPadding(0)
            .addElement(
                new TR().addElement(
                    new TD().setColSpan(2).setVAlign(AlignType.BOTTOM).addElement(
                        new Table().setWidth("100%").setBorder(0).setCellSpacing(0).setCellPadding(
                            0).addElement(
                            new TR().addElement(new TD().addElement(new Div()
                                .addElement(headerList)
                                .setID("header")))))

                    .setClass("tabtopbg")).addElement(
                    new TD().setWidth(2).setVAlign(AlignType.BOTTOM).addElement(
View Full Code Here


            if(errors != null && errors.size() > 0) {
                UL errorList = new UL();
                for(Iterator it=errors.iterator(); it.hasNext();) {
                    errorList.addElement(new LI( (String) it.next() ));
                }
                Div errorDiv = new Div().addElement(errorList);
                errorDiv.setID(errorCssId);
               
                newContent.addElement(errorDiv);
            }
            if(notices != null && notices.size() > 0) {
                UL noticeList = new UL();
                for(Iterator it=notices.iterator(); it.hasNext();) {
                    noticeList.addElement(new LI( (String) it.next() ));
                }
                Div noticeDiv = new Div().addElement(noticeList);
                noticeDiv.setID(noticeCssId);
               
                newContent.addElement(noticeDiv);
            }
           
            newContent.addElement(content);
View Full Code Here

TOP

Related Classes of org.apache.ecs.html.Div

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.