Package org.libreplan.business.qualityforms.entities

Examples of org.libreplan.business.qualityforms.entities.TaskQualityFormItem


    private void appendDate(final Row row) {
        Datebox date = new Datebox();
        date.setParent(row);

        final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
        final TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();

        Util.bind(date, new Util.Getter<Date>() {
            @Override
            public Date get() {
                return item.getDate();
            }
        }, new Util.Setter<Date>() {

            @Override
            public void set(Date value) {
                item.setDate(value);
                updateAdvancesIfNeeded();
            }
        });

        date.setDisabled(assignedTaskQualityFormsToOrderElementModel
View Full Code Here


    private void appendCheckPassed(final Row row) {
        Checkbox checkbox = new Checkbox();
        checkbox.setParent(row);

        final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
        final TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();

        Util.bind(checkbox, new Util.Getter<Boolean>() {
            @Override
            public Boolean get() {
                return item.getPassed();
            }
        }, new Util.Setter<Boolean>() {

            @Override
            public void set(Boolean value) {
                item.setPassed(value);
                updateAdvancesIfNeeded();
            }
        });

        checkbox.setDisabled(assignedTaskQualityFormsToOrderElementModel
View Full Code Here

        return new Constraint() {
            @Override
            public void validate(Component comp, Object value)
                    throws WrongValueException {

                final TaskQualityFormItem item = (TaskQualityFormItem) row
                        .getValue();
                final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);

                if (taskQualityForm != null) {
                    item.setDate((Date) value);

                    if (((Date) value == null)
                            && (!item.isIfDateCanBeNullConstraint())) {
                        item.setDate(null);
                        throw new WrongValueException(comp,
                                _("date not specified"));
                    }
                    if (!assignedTaskQualityFormsToOrderElementModel
                            .isCorrectConsecutiveDate(taskQualityForm, item)) {
                        item.setDate(null);
                        throw new WrongValueException(
                                comp,
                                _("must be after the previous date"));
                    }
                }
View Full Code Here

            String itemName) {
        Grid gridItems = (Grid) rowTaskQualityForm.getFirstChild()
                .getFirstChild();
        List<Row> rows = (List<Row>) gridItems.getRows().getChildren();
        for (Row row : rows) {
            TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();
            if ((item != null) && (itemName.equals(item.getName()))) {
                return row;
            }
        }
        return null;
    }
View Full Code Here

    public class TaskQualityFormItemsRowRenderer implements RowRenderer {

        @Override
        public void render(Row row, Object data) {
            TaskQualityFormItem item = (TaskQualityFormItem) data;
            row.setValue(item);

            appendNewLabel(row, item.getName());
            appendNewLabel(row, item.getStringPosition());
            appendNewLabel(row, item.getPercentage().toString());
            appendCheckPassed(row);
            appendDate(row);
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.qualityforms.entities.TaskQualityFormItem

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.