Example usage for com.vaadin.v7.shared.ui.grid HeightMode ROW

List of usage examples for com.vaadin.v7.shared.ui.grid HeightMode ROW

Introduction

In this page you can find the example usage for com.vaadin.v7.shared.ui.grid HeightMode ROW.

Prototype

HeightMode ROW

To view the source code for com.vaadin.v7.shared.ui.grid HeightMode ROW.

Click Source Link

Document

The height of the Component or Widget in question is defined by a number of rows.

Usage

From source file:de.symeda.sormas.ui.dashboard.map.DashboardMapComponent.java

License:Open Source License

private void onMarkerClicked(String groupId, int markerIndex) {

    switch (groupId) {
    case CASES_GROUP_ID:

        if (markerIndex < markerCaseFacilities.size()) {
            FacilityReferenceDto facility = markerCaseFacilities.get(markerIndex);
            VerticalLayout layout = new VerticalLayout();
            Window window = VaadinUiUtil.showPopupWindow(layout);
            CasePopupGrid caseGrid = new CasePopupGrid(window, facility, DashboardMapComponent.this);
            caseGrid.setHeightMode(HeightMode.ROW);
            layout.addComponent(caseGrid);
            layout.setMargin(true);/*from  ww  w . j  a va  2  s.  com*/
            FacilityDto facilityDto = FacadeProvider.getFacilityFacade().getByUuid(facility.getUuid());
            window.setCaption(
                    I18nProperties.getCaption(Captions.dashboardCasesIn) + " " + facilityDto.toString());
        } else {
            markerIndex -= markerCaseFacilities.size();
            MapCaseDto caze = mapCaseDtos.get(markerIndex);
            ControllerProvider.getCaseController().navigateToCase(caze.getUuid(), true);
        }
        break;
    case CONTACTS_GROUP_ID: {
        MapContactDto contact = markerContacts.get(markerIndex);
        ControllerProvider.getContactController().navigateToData(contact.getUuid(), true);
    }
        break;
    case EVENTS_GROUP_ID: {
        DashboardEventDto event = markerEvents.get(markerIndex);
        ControllerProvider.getEventController().navigateToData(event.getUuid(), true);
    }
        break;
    }
}

From source file:de.symeda.sormas.ui.dashboard.surveillance.DiseaseBurdenComponent.java

License:Open Source License

public DiseaseBurdenComponent(DashboardDataProvider dashboardDataProvider) {
    this.dashboardDataProvider = dashboardDataProvider;

    Label title = new Label(I18nProperties.getCaption(Captions.dashboardDiseaseBurdenInfo));
    CssStyles.style(title, CssStyles.H2, CssStyles.VSPACE_4, CssStyles.VSPACE_TOP_NONE);

    grid = new DiseaseBurdenGrid();
    grid.setHeightMode(HeightMode.ROW);
    grid.setWidth(100, Unit.PERCENTAGE);

    // layout//from  w w  w .ja v a  2  s. com
    setWidth(100, Unit.PERCENTAGE);

    addComponent(title);
    addComponent(grid);
    setMargin(new MarginInfo(true, true, false, true));
    setSpacing(false);
    setExpandRatio(grid, 1);
}

From source file:de.symeda.sormas.ui.person.PersonGrid.java

License:Open Source License

private void buildGrid() {
    setSizeFull();/*www. j av a  2 s .  co  m*/
    setSelectionMode(SelectionMode.SINGLE);
    setHeightMode(HeightMode.ROW);

    BeanItemContainer<PersonIndexDto> container = new BeanItemContainer<PersonIndexDto>(PersonIndexDto.class);
    GeneratedPropertyContainer generatedContainer = new GeneratedPropertyContainer(container);
    setContainerDataSource(generatedContainer);

    generatedContainer.addGeneratedProperty(CASE_LOC, new PropertyValueGenerator<String>() {
        @Override
        public String getValue(Item item, Object itemId, Object propertyId) {
            PersonIndexDto person = (PersonIndexDto) itemId;
            if (person.getCaseDisease() != null) {
                return "<a href='" + Page.getCurrent().getLocation() + "/data/" + person.getCaseUuid()
                        + "' target='_blank'>" + person.getCaseDisease().toShortString() + " ("
                        + DateHelper.formatLocalShortDate(person.getCaseDiseaseStartDate()) + ")</a>";
            } else {
                return "";
            }
        }

        @Override
        public Class<String> getType() {
            return String.class;
        }
    });

    setColumns(PersonIndexDto.FIRST_NAME, PersonIndexDto.LAST_NAME, PersonIndexDto.NICKNAME,
            PersonIndexDto.APPROXIMATE_AGE, PersonIndexDto.SEX, PersonIndexDto.PRESENT_CONDITION,
            PersonIndexDto.DISTRICT_NAME, PersonIndexDto.COMMUNITY_NAME, PersonIndexDto.CITY, CASE_LOC);

    for (Column column : getColumns()) {
        column.setHeaderCaption(I18nProperties.getPrefixCaption(PersonIndexDto.I18N_PREFIX,
                column.getPropertyId().toString(), column.getHeaderCaption()));
    }

    getColumn(PersonIndexDto.FIRST_NAME).setMinimumWidth(150);
    getColumn(PersonIndexDto.LAST_NAME).setMinimumWidth(150);
    getColumn(CASE_LOC).setRenderer(new HtmlRenderer());
    getColumn(CASE_LOC).setHeaderCaption(I18nProperties.getPrefixCaption(PersonIndexDto.I18N_PREFIX,
            associatedCase == null ? PersonIndexDto.LAST_DISEASE : PersonIndexDto.MATCHING_CASE));
}

From source file:de.symeda.sormas.ui.reports.WeeklyReportOfficersGrid.java

License:Open Source License

@Override
public void itemClick(ItemClickEvent event) {
    if (event.getPropertyId().equals(VIEW_DETAILS_BTN_ID)) {
        WeeklyReportOfficerSummaryDto summaryDto = (WeeklyReportOfficerSummaryDto) event.getItemId();
        if (summaryDto.getInformants() > 0) {
            VerticalLayout layout = new VerticalLayout();
            layout.setSizeUndefined();/*from  ww w  . j  a  va2  s . c o  m*/
            layout.setMargin(true);
            Window window = VaadinUiUtil.showPopupWindow(layout);

            WeeklyReportInformantsGrid grid = new WeeklyReportInformantsGrid(summaryDto.getOfficer(),
                    new EpiWeek(year, week));
            grid.setWidth(960, Unit.PIXELS);
            grid.setHeightMode(HeightMode.ROW);
            grid.setHeightUndefined();
            layout.addComponent(grid);
            window.setCaption(String.format(I18nProperties.getCaption(Captions.weeklyReportsInDistrict),
                    summaryDto.getDistrict().toString()) + " - " + I18nProperties.getString(Strings.epiWeek)
                    + " " + week + "/" + year);
        }
    }
}

From source file:de.symeda.sormas.ui.reports.WeeklyReportRegionsGrid.java

License:Open Source License

@Override
public void itemClick(ItemClickEvent event) {
    if (event.getPropertyId().equals(VIEW_DETAILS_BTN_ID)) {
        WeeklyReportRegionSummaryDto summaryDto = (WeeklyReportRegionSummaryDto) event.getItemId();
        VerticalLayout layout = new VerticalLayout();
        layout.setSizeUndefined();/*from www  . ja  va 2 s.  c om*/
        layout.setMargin(true);
        Window window = VaadinUiUtil.showPopupWindow(layout);

        WeeklyReportOfficersGrid grid = new WeeklyReportOfficersGrid();
        grid.reload(summaryDto.getRegion(), year, week);
        grid.setWidth(1600, Unit.PIXELS);
        grid.setHeightMode(HeightMode.ROW);
        grid.setHeightUndefined();
        layout.addComponent(grid);
        window.setCaption(String.format(I18nProperties.getCaption(Captions.weeklyReportsInDistrict),
                summaryDto.getRegion().toString()) + " - " + I18nProperties.getString(Strings.epiWeek) + " "
                + week + "/" + year);
    }
}

From source file:de.symeda.sormas.ui.therapy.TherapyView.java

License:Open Source License

public TherapyView() {
    super(VIEW_NAME);

    prescriptionCriteria = ViewModelProviders.of(TherapyView.class).get(PrescriptionCriteria.class);
    treatmentCriteria = ViewModelProviders.of(TherapyView.class).get(TreatmentCriteria.class);

    VerticalLayout container = new VerticalLayout();
    container.setSpacing(false);//from  w  w w  . j a  v  a  2s. c  om
    container.setWidth(100, Unit.PERCENTAGE);
    container.setMargin(true);

    container.addComponent(createPrescriptionsHeader());

    prescriptionGrid = new PrescriptionGrid(this);
    prescriptionGrid.setCriteria(prescriptionCriteria);
    prescriptionGrid.setHeightMode(HeightMode.ROW);
    CssStyles.style(prescriptionGrid, CssStyles.VSPACE_2);
    container.addComponent(prescriptionGrid);

    container.addComponent(createTreatmentsHeader());

    treatmentGrid = new TreatmentGrid();
    treatmentGrid.setCriteria(treatmentCriteria);
    container.addComponent(treatmentGrid);
    container.setExpandRatio(treatmentGrid, 1);

    setSubComponent(container);
}