Package org.apache.ecs.html

Examples of org.apache.ecs.html.Table


        int cols = getColumn();

        if (0 == rows || 0 == cols)
            return base; // empty container

        Table t = new Table()
                       .setWidth( this.getWidth() )
                       .setCellPadding( this.getPadding() )
                       .setAlign("center");

        base.addElement( t );

        ElementContainer[][] elements = new ElementContainer[rows][cols];

        for( int i = 0; i < rows; i++ )  {
            for ( int j = 0 ; j < cols; j++ ) {
                elements[i][j]=new ElementContainer();
            }
        }

        // populate the elements array
        en = portlets.getPortlets();
        while (en.hasMoreElements() ) {

            Portlet p = (Portlet)en.nextElement();
            PortletConfig pConf = p.getPortletConfig();

            Integer colObj = pConf.getConstraints().getColumn();
            Integer rowObj = pConf.getConstraints().getRow();
            int colnum = (colObj!=null)?colObj.intValue():0;
            int rownum = (rowObj!=null)?rowObj.intValue():0;

            elements[rownum % rows][colnum % cols]
                .addElement( p.getContent( rundata ) );

        }

        // build the table

        for (int i = 0; i < rows; ++i) {

            TR row = new TR();
            TD td = null;

            for(int j=0; j < cols ; ++j) {
                row.addElement( td= new TD().setVAlign("top")
                                       .addElement( elements[i][j] ) );
                if (getRowHeight(i)!=null) td.setHeight(getRowHeight(i));
                if (getColumnWidth(j)!=null) td.setWidth(getColumnWidth(j));
            }

            t.addElement(row);
        }

        }
        catch (Exception e)
        {
View Full Code Here


            {
                v.add(token);
            }
        }

        Table t = new Table();

        for ( Enumeration e = v.elements(); e.hasMoreElements(); )
        {
            String item = ((String)e.nextElement()).trim();
            Input cb = new Input(Input.CHECKBOX, prefix + item, item);
            cb.setChecked(value.indexOf(item) >= 0);
            cb.setOnClick(getJavascript(name, v, prefix));
            ElementContainer temp = new ElementContainer();
            temp.addElement(cb).addElement("&nbsp;").addElement(item);
            if ( layout.equalsIgnoreCase(LAYOUT_NS) )
            {
                t.addElement(new TR().addElement(new TD(temp)));
            } else
            {
                result.addElement(temp);
            }
        }
View Full Code Here

                String value = data.getUser().getTemp(key).toString();
                temp.addElement( key + "=" + value )
                    .addElement( new BR() );
            }
            body.addElement(new BR()).addElement(new BR())
                .addElement(new Table().setBorder(2).setCellPadding(10)
                .addElement(new TR()
                    .addElement(perm).addElement(temp) ));
        }
        if (DEBUG)
        {
            // If there are GET/POST/PATH_INFO variables put them into
            // a <PRE></PRE> tag so that they can be displayed on the
            // page. This is of course only for example purposes.
            PRE pre = new PRE();
            Enumeration keys = data.getParameters().keys();
            while ( keys.hasMoreElements() )
            {
                String key = (String) keys.nextElement();
                String[] values = data.getParameters().getStrings(key);
                if (values.length == 1)
                    pre.addElement(key + " = " + values[0] + "\n");
                else
                {
                    pre.addElement(key + " = ");
                    for (int i=0; i<values.length; i++)
                        pre.addElement(values[i] + " ");
                    pre.addElement("\n");
                }
            }
            body.addElement( new B("Query/PathInfo Parameters") )
                .addElement( new BR() )
                .addElement(pre);

            Table table2 = new Table().setBorder(0);
            Hashtable varDebug = data.getVarDebug();
            keys = varDebug.keys();
            boolean hasValues2 = false;
            while ( keys.hasMoreElements() )
            {
                String key = (String) keys.nextElement();
                String value = varDebug.get(key).toString();
                TR tr = new TR()
                    .addElement ( new TD().addElement(new B(key)) )
                    .addElement ( new TD().addElement(" = " + value ) );
                table2.addElement(tr);
                hasValues2 = true;
            }
            if ( hasValues2 )
            {
                body.addElement (new H4().addElement("Debugging Data:"));
View Full Code Here

TOP

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

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.