Search in sources :

Example 1 with Install

use of io.jmix.ui.screen.Install in project jmix by jmix-framework.

the class DlcBaseScreen method ownersDlLoadDelegate.

@Install(to = "ownersDl", target = Target.DATA_LOADER)
private List<Owner> ownersDlLoadDelegate(LoadContext<Owner> loadContext) {
    events.add(new LoadEvent("ownersDl", loadContext));
    List<Owner> list = new ArrayList<>();
    Owner owner = metadata.create(Owner.class);
    owner.setName("Joe");
    list.add(owner);
    if (loadContext.getQuery().getParameters().isEmpty()) {
        owner = metadata.create(Owner.class);
        owner.setName("Jane");
        list.add(owner);
    }
    return list;
}
Also used : Owner(com.haulmont.cuba.core.model.Owner) ArrayList(java.util.ArrayList) Install(io.jmix.ui.screen.Install)

Example 2 with Install

use of io.jmix.ui.screen.Install in project jmix by jmix-framework.

the class DlcBaseScreen method petsDlLoadDelegate.

@Install(to = "petsDl", target = Target.DATA_LOADER)
private List<Pet> petsDlLoadDelegate(LoadContext<Pet> loadContext) {
    events.add(new LoadEvent("petsDl", loadContext));
    Pet pet = metadata.create(Pet.class);
    pet.setName("Misty");
    return Collections.singletonList(pet);
}
Also used : Pet(com.haulmont.cuba.core.model.Pet) Install(io.jmix.ui.screen.Install)

Example 3 with Install

use of io.jmix.ui.screen.Install in project jmix by jmix-framework.

the class DlcBaseTestScreen method petsDlLoadDelegate.

@Install(to = "petsDl", target = Target.DATA_LOADER)
private List<Pet> petsDlLoadDelegate(LoadContext<Pet> loadContext) {
    events.add(new LoadEvent("petsDl", loadContext));
    Pet pet = metadata.create(Pet.class);
    pet.setName("Misty");
    return Collections.singletonList(pet);
}
Also used : Pet(test_support.entity.petclinic.Pet) Install(io.jmix.ui.screen.Install)

Example 4 with Install

use of io.jmix.ui.screen.Install in project jmix by jmix-framework.

the class TableEditFragment method columnsTableRemoveAfterActionPerformedHandler.

@Install(to = "columnsTable.remove", subject = "afterActionPerformedHandler")
protected void columnsTableRemoveAfterActionPerformedHandler(RemoveOperation.AfterActionPerformedEvent<TemplateTableColumn> event) {
    TemplateTableColumn deletedColumn = event.getItems().iterator().next();
    int deletedPosition = deletedColumn.getPosition();
    for (TemplateTableColumn templateTableColumn : tableColumnsDc.getItems()) {
        if (templateTableColumn.getPosition() > deletedPosition) {
            int currentPosition = templateTableColumn.getPosition();
            templateTableColumn.setPosition(currentPosition - 1);
        }
    }
}
Also used : TemplateTableColumn(io.jmix.reports.entity.table.TemplateTableColumn) Install(io.jmix.ui.screen.Install)

Example 5 with Install

use of io.jmix.ui.screen.Install in project jmix by jmix-framework.

the class TableEditFragment method bandsTableRemoveAfterActionPerformedHandler.

@Install(to = "bandsTable.remove", subject = "afterActionPerformedHandler")
protected void bandsTableRemoveAfterActionPerformedHandler(RemoveOperation.AfterActionPerformedEvent<TemplateTableBand> event) {
    TemplateTableBand deletedColumn = event.getItems().iterator().next();
    int deletedPosition = deletedColumn.getPosition();
    for (TemplateTableBand templateTableBand : tableBandsDc.getItems()) {
        if (templateTableBand.getPosition() > deletedPosition) {
            int currentPosition = templateTableBand.getPosition();
            templateTableBand.setPosition(currentPosition - 1);
        }
    }
}
Also used : TemplateTableBand(io.jmix.reports.entity.table.TemplateTableBand) Install(io.jmix.ui.screen.Install)

Aggregations

Install (io.jmix.ui.screen.Install)10 ArrayList (java.util.ArrayList)3 Order (test_support.entity.sales.Order)2 Owner (com.haulmont.cuba.core.model.Owner)1 Pet (com.haulmont.cuba.core.model.Pet)1 TemplateTableBand (io.jmix.reports.entity.table.TemplateTableBand)1 TemplateTableColumn (io.jmix.reports.entity.table.TemplateTableColumn)1 Suggestion (io.jmix.ui.component.autocomplete.Suggestion)1 Owner (test_support.entity.petclinic.Owner)1 Pet (test_support.entity.petclinic.Pet)1