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