Package org.libreplan.web.orders

Examples of org.libreplan.web.orders.HoursGroupWrapper


    protected abstract void updateCriterionsWithDiferentResourceType(
            HoursGroupWrapper hoursGroupWrapper);

    public void selectResourceType(Combobox combobox)
            throws InterruptedException {
        HoursGroupWrapper hoursGroupWrapper = (HoursGroupWrapper) ((Row) combobox
                .getParent()).getValue();

        if (combobox.getSelectedItem() != null) {
            try {
                int status = Messagebox
                    .show(
                            _("Are you sure of changing the resource type? You will lose the criteria with different resource type."),
                            "Question", Messagebox.OK | Messagebox.CANCEL,
                            Messagebox.QUESTION);

                if (Messagebox.OK == status) {
                    ResourceEnum resource = (ResourceEnum) combobox
                        .getSelectedItem().getValue();
                    hoursGroupWrapper.assignResourceType(resource);
                    updateCriterionsWithDiferentResourceType(hoursGroupWrapper);
                }
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
View Full Code Here


            Messagebox.show(_("At least one HoursGroup is needed"), _("Error"),
                    Messagebox.OK, Messagebox.ERROR);
            return;
        }

        final HoursGroupWrapper hoursGroupWrapper = getHoursGroupWrapper(self);
        if (hoursGroupWrapper != null) {
            deleteHoursGroupWrapper(hoursGroupWrapper);
            Util.reloadBindings(listHoursGroups);
        }
    }
View Full Code Here

        return ((HoursGroupWrapper) (((Row) (self.getParent().getParent()))
                .getValue()));
    }

    public void addCriterionToHoursGroup(Component self) {
        final HoursGroupWrapper hoursGroupWrapper = getHoursGroupWrapper(self);
        if (hoursGroupWrapper != null) {
            addCriterionToHoursGroupWrapper(hoursGroupWrapper);
            repaint(self, hoursGroupWrapper);
        }
    }
View Full Code Here

    protected abstract void addCriterionToHoursGroupWrapper(
            HoursGroupWrapper hoursGroupWrapper);

    public void addExceptionToHoursGroups(Component self) {
        final HoursGroupWrapper hoursGroupWrapper = getHoursGroupWrapper(self);
        if (hoursGroupWrapper != null) {
            addExceptionToHoursGroupWrapper(hoursGroupWrapper);
            repaint(self, hoursGroupWrapper);
        }
    }
View Full Code Here

    public void removeCriterionToHoursGroup(Component self) {
        try {
            Row row = (Row) self.getParent().getParent();
            CriterionRequirementWrapper requirementWrapper = (CriterionRequirementWrapper) row
                    .getValue();
            HoursGroupWrapper hoursGroupWrapper = getHoursGroupOfRequirementWrapper(row);
            deleteCriterionToHoursGroup(hoursGroupWrapper, requirementWrapper);
            repaint(self, hoursGroupWrapper);
        } catch (Exception e) {

        }
View Full Code Here

        if (item != null) {

            Row row = (Row) bandbox.getParent().getParent();
            CriterionWithItsType criterionAndType = (CriterionWithItsType) item
                    .getValue();
            HoursGroupWrapper hoursGroupWrapper = getHoursGroupOfRequirementWrapper(row);
            bandbox.setValue(criterionAndType.getNameAndType());

            try {
                selectCriterionToHoursGroup(hoursGroupWrapper,
                        requirementWrapper, criterionAndType);
View Full Code Here

    public Constraint validatePercentage() {
        return new Constraint() {
            @Override
            public void validate(Component comp, Object value)
                    throws WrongValueException {
                HoursGroupWrapper hoursGroupWrapper = (HoursGroupWrapper) ((Row) comp
                        .getParent()).getValue();
                try {
                    hoursGroupWrapper.setPercentage((BigDecimal) value);
                } catch (IllegalArgumentException e) {
                    throw new WrongValueException(comp, _(e.getMessage()));
                }
            }
        };
View Full Code Here

    }

    @Override
    protected void addNewHoursGroupWrapper(HoursGroup newHoursGroup,
            boolean newObject) {
        HoursGroupWrapper newHoursGroupWrapper = new HoursGroupWrapper(
                newHoursGroup, getElement(), newObject);
        hoursGroupsWrappers.add(newHoursGroupWrapper);
    }
View Full Code Here

    }

    @Override
    protected void addNewHoursGroupWrapper(HoursGroup newHoursGroup,
            boolean newObject) {
        HoursGroupWrapper newHoursGroupWrapper = new HoursGroupWrapper(
                newHoursGroup, getElement(), newObject);
        hoursGroupsWrappers.add(newHoursGroupWrapper);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.web.orders.HoursGroupWrapper

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.