Package org.apache.ecs.html

Examples of org.apache.ecs.html.Input


        Select monthSelect = getMonthSelector(selName + MONTH_SUFFIX, useDate);
        ConcreteElement daySelect = null;
        if (!showDays)
        {
            daySelect = new Input(Input.hidden, selName + DAY_SUFFIX, setDay);
        }
        else
        {
            Select tmp = getDaySelector(selName + DAY_SUFFIX, useDate);
            if (onChangeSet)
View Full Code Here


        form = new Form(
            new TurbineURI(data,
                           TurbineConstants.SCREEN_DEFAULT_DEFAULT,
                           TurbineConstants.ACTION_LOGOUT_DEFAULT,
                           true).getRelativeLink(),
            Form.POST).addElement(new Input("SUBMIT", "Logout", "Logout"));

        ElementContainer body = new ElementContainer()
                .addElement(new HR().setSize(1).setNoShade(true))
                .addElement(
                    new B().addElement(
View Full Code Here

                tmp.setOnChange(onChange);
            secondSelect = tmp;
        }
        else
        {
            secondSelect = new Input(Input.hidden,
                    selName + SECOND_SUFFIX,
                    setSeconds);
        }

        if (onChangeSet)
View Full Code Here

    {
        Form form;
        form = new Form(
            new DynamicURI(data,"DefaultScreen","LogoutUser",true).toString(),
            Form.POST)
                .addElement(new Input("SUBMIT", "Logout", "Logout"));
        ElementContainer body = new ElementContainer()
            .addElement(new HR().setSize(1).setNoShade(true))
            .addElement(new B().addElement(
               new Font().setColor(HtmlColor.green).setSize(2).addElement(txt)))
            .addElement(form);
View Full Code Here

            page = 0;
            setPage(Integer.valueOf(page), session);
            // TODO: Display info text about log being cleared?
        }

        Input clearLogButton = new Input(Input.BUTTON, "clear_transferlog_button", labels
            .getLabel("clear_transferlog"));

        clearLogButton.setOnClick("if(!confirm('"
                + Utils.escapeJavaScriptString(labels.getLabel("confirm_cleartransferlog"))
                + "')) return false; document.forms[0]." + ACTION
                + ".value=1;document.forms[0].submit();");

        Form form = getForm("TransferLog", clearLogButton.toString(), labels, false, false);
        form.addElement(new Input(Input.HIDDEN, ACTION, "0"));

        List entries = pers
              .getAllLogMessageEntries(page * LOG_ENTRIES_PER_PAGE, LOG_ENTRIES_PER_PAGE);
       
        int numberOfLogEntries = pers.getNumberOfLogMessageEntries(pipeId);
View Full Code Here

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

      
        ElementContainer content = new ElementContainer().addElement(
            tt.getOuterTable(componentTable).setWidth("100%")).addElement(new HR()).
            addElement(reloadComponentsButton);

       
        Form form = getForm("Components", content.toString(), labels, false, false).addElement(
            new Input(Input.HIDDEN, ACTION, "0"));

        String result = form.toString();

        return result;
    }
View Full Code Here

        }
        // Special treatment for checkboxes
        if(inputType.equals(Input.CHECKBOX)) {
            // If it's an boolean value, this is easy
            if(p.type == BOOLEAN) {
                return new Input(Input.CHECKBOX, name, "true").setChecked(((Boolean) p.getValue())
                    .booleanValue());
            } else {
                // If it's not this gets bit complicated. Why would anyone make a checkbox of a
                // non-boolean parameter anyway?
                // Let's give him something, but I don't know if this makes any sense. Not
                // recommended to use the method this way...
                String value = p.getValue().toString();
                if(value.equals("")) {
                    // Now we don't even know what the value should be...
                    return new Input(Input.CHECKBOX, name, "true").setChecked(false);
                } else {
                    return new Input(Input.CHECKBOX, name, Utils.htmlentities(value))
                        .setChecked(true);
                }
            }
        }

        String value = "";
        switch(p.type) {
        case STRING_ARRAY:
            value = ((String[]) p.getValue())[index];
            break;
        case INT_ARRAY:
            value = String.valueOf(((int[]) p.getValue())[index]);
            break;
        case DOUBLE_ARRAY:
            value = String.valueOf(((double[]) p.getValue())[index]);
            break;
        case LONG_ARRAY:
            value = String.valueOf(((long[]) p.getValue())[index]);
            break;
        default:
            value = p.getValue().toString();
        }
        return new Input(inputType, name, Utils.htmlentities(value));
    }
View Full Code Here

                    .addElement(destinationCell.setBgColor("FFFFFF")));

        // --------------------------
        // A button to start the pipe
        // --------------------------
        Input startButton = new Input(Input.BUTTON, "strt", labels.getLabel("start"));
        startButton.setOnClick("document.forms[0]." + ACTION + ".value=" + ACTION_START
                + ";document.forms[0].submit()");

        Table infoTable = new Table()
        .setBorder(0)
        .setCellSpacing(0)
        .setCellPadding(5)
        .addElement(
            new TR()
                .addElement(
                    new TD().addElement(startButton)));
                   
        //Add pipe execution information after pipe execution             
        if(parameters.getInt(ACTION) == ACTION_START) {       
                infoTable.addElement(
                    new TD().setRowSpan(1).setVAlign(AlignType.MIDDLE).addElement(new B(labels.getLabel("starttimeeditor")+":")))
                .addElement(
                    new TD().setRowSpan(2).setVAlign(AlignType.MIDDLE).addElement(dateFormat.format(pipe.getStartTime())))
                .addElement(
                    new TD().setRowSpan(1).setVAlign(AlignType.MIDDLE).addElement(new B(labels.getLabel("endtimeeditor")+":")))
                .addElement(
                    new TD().setRowSpan(2).setVAlign(AlignType.MIDDLE).addElement(dateFormat.format(pipe.getEndTime())))
                .addElement(
                    new TD().setRowSpan(1).setVAlign(AlignType.MIDDLE).addElement(new B(labels.getLabel("editorduration")+":")))
                .addElement(
                    new TD().setRowSpan(2).setVAlign(AlignType.MIDDLE).addElement(DurationFormatUtils.formatDuration(pipe.getDuration(),DURATION_FORMAT)))
                .addElement(
                    new TD().setRowSpan(1).setVAlign(AlignType.MIDDLE).addElement(new B(labels.getLabel("editorstatus")+":")))
                .addElement(
                    new TD().setRowSpan(2).setVAlign(AlignType.MIDDLE).addElement(pipe.getLastStatus()));
        }
       
        Template generalFieldsTemplate = Template.createTemplate(GENERAL_FIELDS_LAYOUT);

        generalFieldsContext.writeEditors(generalFields, generalFieldsTemplate);

        generalFieldsTemplate.write();

        ElementContainer content = new ElementContainer().addElement(new H1(pipe.getName())).addElement(
            generalFieldsTemplate.toString()).addElement(new BR()).addElement(new BR()).addElement(
            componentTable).addElement(new BR()).addElement(infoTable);

       
        Form form = getForm("EditPipe", content.toString(), labels, false, true).addElement(
            parameters.getInput(Input.HIDDEN, PIPE_ID)).addElement(
            new Input(Input.HIDDEN, CREATE_COMPONENT_OF_TYPE, "-1")).addElement(
            new Input(Input.HIDDEN, DELETE_COMPONENT_OF_TYPE, "-1"));

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

                     * case PipeComponentIF.TYPE_CONVERTER: break;
                     */
                    }

                    // Add component edit button
                    Input editButton = new Input(Input.BUTTON, ("eb" + componentType),
                                     labels.getLabel("edit"));
                    editButton.setOnClick("document.location='" +
                                  "EditComponent?" + compIdParameter + "&" +
                                  dataIdParameter + "'");
                    cell.addElement(Entities.NBSP).addElement(editButton);
                } catch(UnsupportedEncodingException e) {
                    throw new RuntimeException(
View Full Code Here

    }

    private Input getComponentDeleteButton(int componentType, LabelResource labels) {
        String confirmMessage = Utils.escapeJavaScriptString(labels
            .getLabel("confirm_delete_component" + componentType));
        Input deleteButton = new Input(Input.BUTTON, "db" + componentType, labels
            .getLabel("delete"));
        deleteButton.setOnClick("if(!confirm('" + confirmMessage + "')) return false;"
                + "document.forms[0]." + DELETE_COMPONENT_OF_TYPE + ".value=" + componentType
                + ";" + "document.forms[0]." + ACTION + ".value=" + ACTION_OK + ";"
                + "document.forms[0].submit()");
        return deleteButton;
    }
View Full Code Here

TOP

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

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.