Examples of ElementContainer


Examples of org.apache.ecs.ElementContainer

        Input createButton = new Input(Input.BUTTON, "cb", createButtonText);
        createButton.setOnClick("document.forms[0]." + CREATE_COMPONENT_OF_TYPE + ".value="
                + componentType + ";document.forms[0].action.value=" + ACTION_OK
                + ";document.forms[0].submit()");

        return new ElementContainer().addElement(implSelect).addElement(Entities.NBSP).addElement(
            createButton);
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

        // ----------------------------------------
        // Get the path to the desired menu
        Stack upItems = new Stack();
        Stack menus = getMenuPath(tabSetId, upItems, menuFile);
        if(menus == null && menus.size() == 0) {
            return new ElementContainer().addElement(content);
        }

        // -------------------------
        // Make the menu path string
        // -------------------------
        SimpleParser.Record menu = (SimpleParser.Record) menus.peek();
        String pathString = "";
        String helpId = null;

        // The title of the main menu
        String label = ((SimpleParser.Record) menus.get(0)).getString(TITLE, false);
        pathString = (label == null ? "" : labels.getLabel(label, lang));
        // The titles of the middle menus
        for(int i = 0; i < upItems.size(); i++) {
            SimpleParser.Record item = (SimpleParser.Record) upItems.get(i);
            String text = null;
            label = item.getString(TEXT, false);
            if(label == null) {
                text = item.getString(CTEXT, false);
            } else {
                text = labels.getLabel(label, lang);
            }
            if(text != null) {
                pathString += " - " + text;
            }
        }

        // ------------------------------------------------------------------------------------
        // The last title is not in the stack, we'll have to seek it out amongst the menu items
        // ------------------------------------------------------------------------------------
        // Find the tab that's up
        SimpleParser.Record[] items = menu.getRecords(ITEM);
        SimpleParser.Record upTab = null;
        for(int i = 0; i < items.length; i++) {
            SimpleParser.Entity e = items[i].getEntityByKeyword(CARD, false);
            if(e != null && e.getInt() == up) {
                upTab = items[i];
                break;
            }
        }
        // Get the title and help id of the selected card
        if(upTab != null) {
            String text = null;
            label = upTab.getString(TEXT, false);
            if(label == null) {
                text = upTab.getString(CTEXT, false);
            } else {
                text = labels.getLabel(label, lang);
            }

            if(text != null) {
                pathString += " - " + text + " ";
            }
            helpId = upTab.getString(HELP, false);
        }

        // ----------------------
        // Construct the table(s)
        // ----------------------
        ElementContainer tabSet = null;
        if(menus.size() == 1) {
            // Just one menu. Contains the content and the path & help
            tabSet = getTabSet(
                (SimpleParser.Record) menus.pop(),
                up,
View Full Code Here

Examples of org.apache.ecs.ElementContainer

                .addElement(new IMG().setSrc(imageRoot + "corner_bottomright.gif")
                //"b-br.gif")
                    //.setHeight(5)
                    .setWidth(5).setBorder(0))));

        ElementContainer tabSet = new ElementContainer().addElement(titleTable).addElement(
            headerTable).addElement(contentTable);

        return tabSet;
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

          new TD().addElement(formattedCreationTime)).addElement(
          new TD().addElement(formattedStartTime)));

    }

    ElementContainer content = new ElementContainer().addElement(new BR())
        .addElement(new P().setAlign(AlignType.CENTER))
        .addElement(tt.getOuterTable(queueTable))
        .addElement(new HR().addElement(form));

    return content.toString();
  }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

        Template generalFieldsTemplate = Template.createTemplate(GENERAL_FIELDS_LAYOUT);

        generalFieldsContext.writeEditors(generalFields, generalFieldsTemplate);

        generalFieldsTemplate.write();
        ElementContainer content = new ElementContainer().addElement(
                generalFieldsTemplate.toString()).addElement(new BR()).addElement(new BR());
        Form form = getForm("PipeSettings", content.toString(), labels, false, true).addElement(
                parameters.getInput(Input.HIDDEN, PIPE_ID));
        return form.toString();
  }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

        if( (errors == null || errors.size() == 0) && (notices == null || notices.size() == 0) ) {
            // Nothing to do...
            return content;
        }
        else {
            ElementContainer newContent = new ElementContainer().addElement(new BR());
           
            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);
            return newContent;
        }
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

        } catch(ComponentClassNotFoundException cnfe) {
            return "<br><b><font color=\"red\">"
                    + labels.getLabel("edited_component_class_not_found") + "</font></b><br>";
        }

        ElementContainer content = new ElementContainer().addElement(new BR()).addElement(
            new H1()
                .addElement(component.getName()));

        content.addElement(new HR());
       
        if( component instanceof GUIConfigurationIF) {
           
            GUIContext guiContext = ((GUIConfigurationIF) component).getGUIContext();

            if(guiContext != null) {

            // Component might have it's own labels...
               
            LabelResource customLabelResource = PipeComponentUtils.getCustomLabelResource(new Locale(
                environment.getLanguage(session)), labels, component.getClass());

            Map fields = guiContext.makeFields(component, customLabelResource, req);

            // -----------
            // Handle post
            // -----------
            if(requestType == POST_REQUEST && parameters.wasGiven(ACTION)) {
                int action = parameters.getInt(ACTION);
                if(action == 1) {
                    if(guiContext.hasBeenEdited(fields)) {
                        guiContext.commitFields(fields);
                        //System.out.println("Saving PipeComponentData, ID: " + componentData.getId());
                        pers.update(componentData);
                    }
                } else
                    guiContext.revertFields(fields);
            }

            // -----------------------
            // Print the field editors
            // -----------------------
            String guiHtml;

            // Use template if the component provides one
            String templateStr = ((GUIConfigurationIF) component).getGUITemplate();
            if(templateStr != null) {
                Template template = Template.createTemplate(templateStr);
                guiContext.writeEditors(fields, template)
                template.write();
                guiHtml = template.toString();
            }
            // Else just print them...
            else {
                guiHtml = new String();
                for(Iterator i = fields.values().iterator(); i.hasNext();) {
                    Field field = (Field) i.next();
                    guiHtml += field.getEditor();
                }
            }


            // Create a back button to the Pipe Editor
            Long pipeId = (Long) session.getAttribute(PIPE_ID_SESSION_KEY);
            Input backButton = new Input(Input.BUTTON,
                             "bb", labels.getLabel("back_to_pipe_editor"));
            backButton.setOnClick("document.location='EditPipe?pipeid=" + pipeId + "'");
           
            Form form = getFormWithCustomButton("EditComponent",
                                  guiHtml, backButton, labels, false, true);

            // Insert hidden fields carrying component and data IDs
           
            form.addElement(parameters.getInput(Input.HIDDEN, COMPONENT_ID));
            form.addElement(parameters.getInput(Input.HIDDEN, DATA_ID));

            content.addElement(form);
        }
           
        }
       
        else
            content.addElement(labels.getLabel("no_attributes_to_edit"));

        return content.toString();
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

        if(toHead != null)
            head.addElement(toHead);

        Document doc = new Document().setDoctype(new Doctype.Html40Transitional()).setHtml(
            new Html().addElement(head).addElement(
                body.addElement(tabGenerator.getTabSet(tabSetId, tabId, new ElementContainer()
                    .addElement(content), MENU_FILE, standaloneZones, lang))));
        doc.output(out);
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

            hourSelect.setOnChange(onChange);
            minuteSelect.setOnChange(onChange);
            ampmSelect.setOnChange(onChange);
        }

        ElementContainer ec = new ElementContainer();
        ec.addElement(new Comment(
                "== BEGIN org.apache.turbine.util.TimeSelector.ecsOutput() =="));
        ec.addElement(hourSelect);
        ec.addElement(":");
        ec.addElement(minuteSelect);
        if (this.showSeconds == true)
            ec.addElement(":");
        ec.addElement(secondSelect);
        if (this.timeFormat == TimeSelector.TWELVE_HOUR)
        {
            ec.addElement(ampmSelect);
        }
        ec.addElement(new Comment(
                "== END org.apache.turbine.util.TimeSelector.ecsOutput() =="));
        return (ec);
    }
View Full Code Here

Examples of org.apache.ecs.ElementContainer

     */
    public Email setMsg(String msg)
            throws MessagingException
    {
        setTextMsg(msg);
        setHtmlMsg(new ElementContainer(new Html(new Body()
                .addElement(new PRE(msg)))).toString());
        return this;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.