Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.Resource$DayAssignmentsState


     */
    public class ResourceListRenderer implements ListitemRenderer {

        @Override
        public void render(Listitem item, Object data) {
            final Resource resource = (Resource) data;
            item.setValue(resource);

            appendType(item);
            appendLimiting(item);
            appendName(item);
View Full Code Here


    private Listitem findListItemFor(Resource resource) {
        @SuppressWarnings("unchecked")
        Collection<Listitem> items = listBoxResources.getItems();
        for (Listitem item : items) {
            Resource itemResource = ((ResourceWithItsLoadRatios) item
                    .getValue()).getResource();
            if (itemResource != null
                    && itemResource.getId().equals(resource.getId())) {
                return item;
            }
        }
        return null;
    }
View Full Code Here

                    .byResource(allocations);

            List<LoadTimeLine> secondLevel = new ArrayList<LoadTimeLine>();
            for (Entry<Resource, List<ResourceAllocation<?>>> entry : byResource
                    .entrySet()) {
                Resource resource = entry.getKey();
                List<ResourceAllocation<?>> resourceAllocations = entry
                        .getValue();
                String descriptionTimeLine = resource.getShortDescription();

                LoadTimeLine timeLine = buildTimeLine(resource,
                        descriptionTimeLine, resourceAllocations, "generic",
                        role);
                if (!timeLine.isEmpty()) {
View Full Code Here

        }
        return false;
    }

    private boolean acceptResource(FilterPair filter, TaskElement taskElement) {
        Resource filterResource = (Resource) filter.getValue();
        return existResourceInTaskElementResourceAllocations(filterResource,
                taskElement);
    }
View Full Code Here

    }

    private boolean acceptsResourceInResourceAllocation(
            Resource filterResource, ResourceAllocation<?> resourceAllocation) {
        if (resourceAllocation instanceof SpecificResourceAllocation) {
            Resource resource = ((SpecificResourceAllocation) resourceAllocation)
                    .getResource();
            if (resource.getId().equals(filterResource.getId())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

            return false;
        }

        SortedSet<ExpenseSheetLine> expenseSheetLines = getFromDB(expenseSheet)
                .getExpenseSheetLines();
        Resource resource = expenseSheetLines.iterator().next().getResource();

        User user = UserUtil.getUserFromSession();
        return user.getWorker().getId().equals(resource.getId());
    }
View Full Code Here

        expenseSheetModel.initCreate(personal);
        loadComponentsEditWindow();
    }

    public String getResource() {
        Resource resource = expenseSheetModel.getResource();
        return resource == null ? "" : resource.getShortDescription();
    }
View Full Code Here

            line.setOrderElement(orderElement);
        }

        private void setResourceInESL(Listitem selectedItem,
                ExpenseSheetLine expenseSheetLine) {
            Resource resource = (selectedItem == null ? null : (Resource) selectedItem.getValue());
            expenseSheetLine.setResource(resource);
        }
View Full Code Here

        line.setCode(code);

        if(lineDTO.resource != null){
            String resourceCode = lineDTO.resource;
            try{
                Resource resource = Registry.getResourceDAO().findByCode(resourceCode);
                line.setResource(resource);
            }catch (InstanceNotFoundException e) {
                throw new ValidationException(
                        "There is no resource with this code");
            }
View Full Code Here

        }

        /* Step 3.4: Update the resource. */
        if (lineDTO.resource != null) {
            try {
                Resource resource = Registry.getResourceDAO().findByCode(
                        lineDTO.resource);
                line.setResource(resource);
            } catch (InstanceNotFoundException e) {
                throw new ValidationException(
                        "There is no resource with this code");
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.Resource$DayAssignmentsState

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.