Package org.apache.ecs.html

Examples of org.apache.ecs.html.Table


                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();

            for (Iterator it = data.getParameters().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                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);
            Map varDebug = data.getDebugVariables();

            boolean hasValues2 = false;

            for (Iterator i = varDebug.keySet().iterator(); i.hasNext();)
            {
                String key = (String) i.next();
                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


     */
    public ConcreteElement doBuild(RunData data) throws Exception
    {
        data.setTitle("There has been an error!");

        Table table = new Table().setBorder(0);
        boolean hasValues = false;
        for (Iterator it = data.getParameters().keySet().iterator();
             it.hasNext();)
        {
            String key = (String) it.next();
            String value = data.getParameters().getString(key);
            TR tr =
                new TR().addElement(
                    new TD().addElement(new B(key))).addElement(
                    new TD().addElement(" = " + value));
            table.addElement(tr);
            hasValues = true;
        }

        Table table2 = new Table().setBorder(0);
        Map varDebug = data.getDebugVariables();

        boolean hasValues2 = false;
        for (Iterator i = varDebug.keySet().iterator(); i.hasNext();)
        {
            String key = (String) i.next();
            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;
        }

        data.getPage().getBody().addElement(
            new H3(
View Full Code Here

    public ConcreteElement doBuild( RunData data )
        throws Exception
    {
        data.setTitle("There has been an error!");

        Table table = new Table().setBorder(0);
        boolean hasValues = false;
        Enumeration keys = data.getParameters().keys();
        while ( keys.hasMoreElements() )
        {
            String key = (String) keys.nextElement();
            String value = data.getParameters().getString(key);
            TR tr = new TR()
                .addElement( new TD().addElement(new B(key)) )
                .addElement( new TD().addElement(" = " + value ) );
            table.addElement(tr);
            hasValues = true;
        }

        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;
        }

        data.getPage().getBody().addElement(new H3(data.getTitle() +
          " Please review the exception below for more information."));
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

                / ((double) LOG_ENTRIES_PER_PAGE)) : 1;
        String pager = getPager(page, numberOfPages, labels);

        TableTool tt = new TableTool();
        tt.setZebra(true);
        Table logTable = tt.getInnerTable().addElement(
            tt.getHeaderRow(new String[] {
                    labels.getLabel("time"),
                    labels.getLabel("pipe"),
                    labels.getLabel("status"),
                    labels.getLabel("lastuser"),
View Full Code Here

            }
        });
       
        TableTool tt = new TableTool();
        tt.setZebra(true);
        Table componentTable = tt.getInnerTable().setWidth("100%");
        componentTable.addElement(tt.getHeaderRow(new String[] {
                labels.getLabel(NAME),
                labels.getLabel(TYPE),
                labels.getLabel(COMPONENT_ID),
                labels.getLabel(DESCRIPTION),
                Entities.NBSP}));
        Locale locale = labels.getLocale();
        for(Iterator iter = components.iterator(); iter.hasNext();) {
            PipeComponentIF impl = (PipeComponentIF) iter.next();
            TR row = tt.getRow();
            row.addElement(new TD().addElement(impl.getName()))
                .addElement(
                    new TD().addElement(labels.getLabel("component_type"
                        + impl.getType())))
                        .addElement(new TD().addElement(impl.getID()))
                        .addElement(new TD().addElement(impl.getDescription(locale)));
            if(pers.isDynamicComponent(impl)) {
                row.setClass("dynamicComponent");
            }
            componentTable.addElement(row);
        }

        Input reloadComponentsButton = new Input(Input.BUTTON, "reload_components", labels
            .getLabel("reload_components"));
        reloadComponentsButton.setOnClick("document.forms[0]." + ACTION + ".value=1;document.forms[0].submit();");
View Full Code Here

        }

        // --------------------------
        // Table with the menu titles
        // --------------------------
        Table menuTable = new Table().setBorder(0).setCellSpacing(0).setCellPadding(0);
        menuTable.addAttribute("BACKGROUND", bgImage);

        if(widthVector.size() > 0) {
            // We'll count the total width of the table as we go
            int tableWidth = ((Integer) widthVector.get(0)).intValue();
            TR menuRow = new TR().setVAlign(AlignType.TOP)
            // An empty cell for padding
                .addElement(
                    new TD().setWidth(tableWidth).addElement(Entities.NBSP).addElement(
                        new IMG().setSrc(spacerImage).setWidth(tableWidth).setHeight(18)));
            // This is the width of the last cell...
            widthVector.addElement(new Integer(200));
            // Add the title cells
            for(int i = 0; i < textVector.size(); i++) {
                TD menuCell = new TD();
                int width = ((Integer) widthVector.get(i + 1)).intValue();
                int tab = ((Integer) tabVector.get(i)).intValue();
                String text = (String) textVector.get(i);
                tableWidth += width;
                menuCell.setWidth(width);

                Font menuTitle = new Font().setSize(2).setFace("Arial, Helvetica, sans-serif");

                if(tab != 0) {
                    A linkElement = new A("EmptyPage" /*
                                                       * + "?" + EmptyPage.MODULE + "=" + module +
                                                       * "&" + EmptyPage.MENU + "=" + tab + "&" +
                                                       * EmptyPage.TITLE + "=" +
                                                       * URLEncoder.encode(text,
                                                       * environment.getCharsetWWW())
                                                       */)
                        .setTarget("main")
                        .addElement(text);
                    String menuScriptName = MENU_NAME_BASE + tab;
                    linkElement.setOnClick("return openMenu(" + menuScriptName + ")");
                    menuCell.addElement(menuTitle.addElement(linkElement));
                } else
                    menuCell.addElement(menuTitle.addElement(text).setColor(DISABLED_COLOR));

                menuRow.addElement(menuCell);
            }
            menuTable.addElement(menuRow).setWidth(tableWidth + 2); // Don't ask me where the '+2'
                                                                    // comes from, but the last
                                                                    // menus don't work in netscape
                                                                    // without it...
        } else
            menuTable.addElement(new TR().addElement(new TD().addElement(Entities.NBSP)));
        return menuTable;
    }
View Full Code Here

     */
    public Table getDescriptionTable() {
        // -----
        // Title
        // -----
        Table descTable = new Table().setBorder(1).addElement(
            new TR().addElement(new TD().setColSpan(4).addElement(new B("Parameter description"))));
        // ------------------------------
        // Overall description (if given)
        // ------------------------------
        if(this.description != null) {
            descTable.addElement(new TR().addElement(new TD().setColSpan(4).addElement(
                this.description)));
        }
        // ------------------------------------
        // Parameter description column headers
        // ------------------------------------
        descTable.addElement(new TR()
            .addElement(new TD().addElement(new B("Name")))
            .addElement(new TD().addElement(new B("Type")))
            .addElement(new TD().addElement(new B("Default")))
            .addElement(new TD().addElement(new B("Description"))));
        // ----------------------------
        // Print parameter descriptions
        // ----------------------------
        Enumeration e = parameters.keys();
        while(e.hasMoreElements()) {
            String name = (String) e.nextElement();
            Parameter p = (Parameter) parameters.get(name);
            descTable.addElement(new TR()
                .addElement(new TD().addElement(name))
                .addElement(new TD().addElement(TYPE_NAMES[p.type]))
                .addElement(
                    new TD().addElement(p.defaultValue != null ? p.defaultValue.toString() : "-"))
                .addElement(new TD().addElement(p.parameterDescription != null ? p.parameterDescription : "-")));
View Full Code Here

        String lang = environment.getLanguage(session);

        res.setContentType(environment.getContentType());
        PrintWriter out = res.getWriter();
        try {
            Table menuBar = menuGenerator.getMenuBar(
                MENU_NAME,
                null,
                MENU_BG_IMAGE,
                MENU_SPACER_IMAGE,
                lang);
            Head head = new Head().addElement(new Link()
                .setRel("stylesheet")
                .setType("text/css")
                .setHref("smilemenu.css"));
            menuGenerator.createMenu(MENU_NAME, head, StandaloneEnvironment.standaloneZones, lang);

            TD logoCell = new TD()
                .setVAlign(AlignType.TOP)
                .setBackground(TOPBAR_BG_IMAGE)
                .addElement(new IMG("pics/logo_smilehouse.gif"));

            TR topRow = new TR().addElement(logoCell).addElement(
                new TD().setBackground(TOPBAR_BG_IMAGE)).addElement(
                new TD().setBackground(TOPBAR_BG_IMAGE).setAlign(AlignType.RIGHT).addElement(
                    new Span().addElement("OpenSyncro " + OPENSYNCRO_VERSION).setClass("syncroTitle")));

            TR menuRow = new TR().setVAlign(AlignType.TOP).addElement(
                new TD().setBackground(MENU_BG_IMAGE).setVAlign(AlignType.BOTTOM).addElement(
                    menuBar)).addElement(
                new TD()
                    .setBackground(MENU_BG_IMAGE)
                    .setAlign(AlignType.RIGHT)
                    .setColSpan(2)
                    .addElement(
                        new Span().addElement(
                            new A("Login?logout=yes", "[" + labels.getLabel("logout") + "]")
                            .setTarget("_top")).setClass("syncroText")));

            Body body = new Body().addElement(new Table()
                .setWidth("100%")
                .setBorder(0)
                .setCellPadding(0)
                .setCellSpacing(0)
                .addElement(topRow)
View Full Code Here

    List entries = pers.getPipeExecutionRequests(null);

    TableTool tt = new TableTool();
    tt.setZebra(true);
    Table queueTable = tt.getInnerTable().addElement(
        tt.getHeaderRow(new String[] { labels.getLabel("pipe"),
            labels.getLabel("createtime"),
            labels.getLabel("starttime") }));

    int colorIndex = 0;
    for (Iterator i = entries.iterator(); i.hasNext(); colorIndex = 1 - colorIndex) {
      PipeExecutionRequest entry = (PipeExecutionRequest) i.next();

      TR row = tt.getRow();

      Date creationTime = entry.getCreatedDate();
      String formattedCreationTime;
      if (creationTime != null) {
        formattedCreationTime = dFormat.format(creationTime);
      } else {
        formattedCreationTime = "";
      }
      Date startTime = entry.getStartedDate();
      String formattedStartTime;
      if (startTime != null) {
        formattedStartTime = dFormat.format(startTime);
      } else {
        formattedStartTime = "Queued";
      }
      queueTable.addElement(row.addElement(
          new TD().addElement(new A("EditPipe?pipeid="
              + entry.getPipe().getId(), entry.getPipe()
              .getName()))).addElement(
          new TD().addElement(formattedCreationTime)).addElement(
          new TD().addElement(formattedStartTime)));
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.