Search in sources :

Example 1 with MaterialCockpitView

use of de.metas.ui.web.material.cockpit.MaterialCockpitView in project metasfresh-webui-api by metasfresh.

the class MD_Cockpit_DocumentDetail_Display method retrieveCockpitRecordIds.

private ImmutableSet<Integer> retrieveCockpitRecordIds() {
    final MaterialCockpitView materialCockpitView = (MaterialCockpitView) getView();
    final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
    final ImmutableSet<Integer> cockpitRowIds = selectedRowIds.stream().map(rowId -> {
        return materialCockpitView.getById(rowId);
    }).flatMap(row -> {
        return row.getAllIncludedCockpitRecordIds().stream();
    }).collect(ImmutableSet.toImmutableSet());
    return cockpitRowIds;
}
Also used : ViewBasedProcessTemplate(de.metas.ui.web.process.adprocess.ViewBasedProcessTemplate) ImmutableSet(com.google.common.collect.ImmutableSet) NonNull(lombok.NonNull) MaterialCockpitView(de.metas.ui.web.material.cockpit.MaterialCockpitView) IQueryBL(org.adempiere.ad.dao.IQueryBL) ProcessPreconditionsResolution(de.metas.process.ProcessPreconditionsResolution) Services(org.adempiere.util.Services) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) I_MD_Cockpit_DocumentDetail(de.metas.material.cockpit.model.I_MD_Cockpit_DocumentDetail) TableRecordReference(org.adempiere.util.lang.impl.TableRecordReference) IProcessPrecondition(de.metas.process.IProcessPrecondition) MaterialCockpitConstants(de.metas.ui.web.material.cockpit.MaterialCockpitConstants) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) MaterialCockpitView(de.metas.ui.web.material.cockpit.MaterialCockpitView)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 I_MD_Cockpit_DocumentDetail (de.metas.material.cockpit.model.I_MD_Cockpit_DocumentDetail)1 IProcessPrecondition (de.metas.process.IProcessPrecondition)1 ProcessPreconditionsResolution (de.metas.process.ProcessPreconditionsResolution)1 MaterialCockpitConstants (de.metas.ui.web.material.cockpit.MaterialCockpitConstants)1 MaterialCockpitView (de.metas.ui.web.material.cockpit.MaterialCockpitView)1 ViewBasedProcessTemplate (de.metas.ui.web.process.adprocess.ViewBasedProcessTemplate)1 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)1 List (java.util.List)1 NonNull (lombok.NonNull)1 IQueryBL (org.adempiere.ad.dao.IQueryBL)1 Services (org.adempiere.util.Services)1 TableRecordReference (org.adempiere.util.lang.impl.TableRecordReference)1