Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.ResourceEnum


    Set<CriterionRequirement> getRequirementWithSameResourType(
            Set<CriterionRequirement> requirements, ResourceEnum resourceType) {
        Set<CriterionRequirement> result = new HashSet<CriterionRequirement>();
        for (CriterionRequirement requirement : requirements) {
            ResourceEnum resourceTypeParent = requirement.getCriterion()
                    .getType().getResource();
            if (resourceTypeParent.equals(resourceType)) {
                result.add(requirement);
            }
        }
        return result;
    }
View Full Code Here


        return result;
    }

    private List<LimitingResourceQueue> findQueuesMatchingCriteria(GenericResourceAllocation generic) {
        List<LimitingResourceQueue> result = new ArrayList<LimitingResourceQueue>();
        ResourceEnum resourceType = generic.getResourceType();
        Set<Criterion> criteria = generic.getCriterions();

        for (LimitingResourceQueue each : queues) {
            Resource resource = each.getResource();
            if (resource.getType().equals(resourceType)
View Full Code Here

                            _("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) {
View Full Code Here

    protected abstract List<HoursGroup> getHoursGroups(T orderElement);

    private Map<ResourceEnum, Set<Criterion>> getKeyFor(HoursGroup hoursGroup) {
        Map<ResourceEnum, Set<Criterion>> keys = new HashMap<ResourceEnum, Set<Criterion>>();
        ResourceEnum resourceType = hoursGroup.getResourceType();
        Set<Criterion> criterions = getKeyCriterionsFor(hoursGroup);
        keys.put(resourceType, criterions);
        return keys;
    }
View Full Code Here

        }
        return list;
    }

    public boolean isValidResourceType(CriterionRequirement newRequirement) {
        ResourceEnum resourceTypeRequirement = newRequirement.getCriterion()
                .getType().getResource();
        if (resourceType != null) {
            return (resourceType.equals(resourceTypeRequirement) || (resourceTypeRequirement
                    .equals(ResourceEnum.getDefault())));
        }
        return true;
    }
View Full Code Here

        if (resource == null) {
            return null;
        }

        ResourceEnum value = resourceEnumFromDTO.get(resource);

        if (value == null) {
            throw new RuntimeException(MessageFormat.format(
                    "Unable to convert value to {0} type",
                    ResourceEnum.class.getName()));
View Full Code Here

    public void addTo(INewAllocationsAdder allocationsAdder) {
        if (!getSelectedItems().isEmpty()) {
            if (isGeneric()) {
                List<Criterion> criteria = getSelectedCriterions();
                List<? extends Resource> resources = searchResources(criteria);
                ResourceEnum type = inferType(criteria);
                allocationsAdder.addGeneric(type, criteria, resources);
            } else {
                allocationsAdder.addSpecific(getSelectedResources());
            }
        }
View Full Code Here

        return materialAssignment;
    }

    public final static HoursGroup toEntity(HoursGroupDTO hoursGroupDTO,
            ConfigurationOrderElementConverter configuration) {
        ResourceEnum resourceType = ResourceEnumConverter
                .fromDTO(hoursGroupDTO.resourceType);
        HoursGroup hoursGroup = HoursGroup.createUnvalidated(
                hoursGroupDTO.code, resourceType, hoursGroupDTO.workingHours);
        return hoursGroup;
    }
View Full Code Here

            allocationRow.setEffortToInput(effortCalculated);
        }
    }

    private EffortDuration calculateEffort(AllocationRow allocationRow) {
        ResourceEnum type = allocationRow.getType();
        if (notStillExistAnotherAllocation(type)) {
            return calculateEffortByCalculatedValue(type);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.ResourceEnum

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.