Package com.gwtplatform.carstore.shared.dto

Examples of com.gwtplatform.carstore.shared.dto.ManufacturerDto


    public static ManufacturerDto createDto(Manufacturer manufacturer) {
        if (manufacturer == null) {
            return null;
        }

        ManufacturerDto manufacturerDto = new ManufacturerDto();
        manufacturerDto.setCars(Car.createDto(manufacturer.getCars()));
        manufacturerDto.setId(manufacturer.getId());
        manufacturerDto.setName(manufacturer.getName());

        return manufacturerDto;
    }
View Full Code Here


    private void createMockData() {
        long manufacturerCount = manufacturerDao.countAll();

        if (manufacturerCount == 0) {
            ManufacturerDto honda = new ManufacturerDto("Honda");
            ManufacturerDto mitsubishi = new ManufacturerDto("Mitsubishi");

            honda = Manufacturer.createDto(manufacturerDao.put(Manufacturer.create(honda)));
            mitsubishi = Manufacturer.createDto(manufacturerDao.put(Manufacturer.create(mitsubishi)));

            CarPropertiesDto carPropertiesCivic = new CarPropertiesDto("Cat", 0, new Date());
View Full Code Here

    public List<ManufacturerRatingDto> getAverageCarRatings(List<RatingDto> ratingDtos) {
        HashMap<String, AveragingCounter> averages = new HashMap<>();

        for (RatingDto ratingDto : ratingDtos) {
            CarDto carDto = ratingDto.getCar();
            ManufacturerDto manufacturer = carDto.getManufacturer();
            String manufacturerName = manufacturer.getName();
            Double rating = Double.valueOf(ratingDto.getRating());

            if (averages.containsKey(manufacturerName)) {
                averages.get(manufacturerName).add(rating);
            } else {
View Full Code Here

                            getView().edit(currentManufacturer);
                        }
                    })
                    .get(id);
        } else {
            currentManufacturer = new ManufacturerDto();
            getView().edit(currentManufacturer);
        }
    }
View Full Code Here

        };

        Column<CarDto, String> manufacturerColumn = new Column<CarDto, String>(new TextCell()) {
            @Override
            public String getValue(CarDto carDto) {
                ManufacturerDto manufacturer = carDto.getManufacturer();
                return manufacturer == null ? "" : manufacturer.getName();
            }
        };

        Column<CarDto, String> modelColumn = new Column<CarDto, String>(new TextCell()) {
            @Override
View Full Code Here

        getView().setUiHandlers(this);
    }

    @Override
    public void createNew() {
        manufacturerDto = new ManufacturerDto();

        reveal();
    }
View Full Code Here

TOP

Related Classes of com.gwtplatform.carstore.shared.dto.ManufacturerDto

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.