public ProcessDialogBuilder setFromGridTab(GridTab gridTab) { final int windowNo = gridTab.getWindowNo(); final int tabNo = gridTab.getTabNo(); setWindowAndTabNo(windowNo, tabNo); setIsSOTrx(Env.isSOTrx(gridTab.getCtx(), windowNo)); setTableAndRecord(gridTab.getAD_Table_ID(), gridTab.getRecord_ID()); setWhereClause(gridTab.getTableModel().getSelectWhereClauseFinal()); skipResultsPanel(); return this; }
public int getTabNo() { final int tabNo; if (gridTab != null) { tabNo = gridTab.getTabNo(); } else if (gridTable != null) { tabNo = gridTable.getTabNo(); } else { tabNo = Env.TAB_None; } return tabNo; }
/** Show list tab can export for user selection */ protected void displayExportTabSelection() { initTabInfo(); exporter = getExporter(); if (exporter == null) { Events.echoEvent("onExporterException", winExportFile, null); } // clear list checkbox selection to recreate with new reporter selectionTabRow.getChildren().clear(); Vlayout vlayout = new Vlayout(); selectionTabRow.appendChild(new Space()); selectionTabRow.appendChild(vlayout); vlayout.appendChild(new Label(Msg.getMsg(Env.getCtx(), "SelectTabToExport"))); chkSelectionTabForExport = new ArrayList<Checkbox>(); boolean isHasSelectionTab = false; boolean isSelectTabDefault = false; // with 2Pack, default is export all child tab if (exporter.getClass().getName().equals("org.adempiere.pipo2.GridTab2PackExporter")) { isSelectTabDefault = true; } // for to make each export tab with one checkbox for (GridTab child : childs) { Checkbox chkSelectionTab = new Checkbox(); chkSelectionTab.setLabel(child.getName()); // just allow selection tab can export if (!exporter.isExportableTab(child)) { continue; } if (child.getTabNo() == indxDetailSelected || isSelectTabDefault) { chkSelectionTab.setSelected(true); } chkSelectionTab.setAttribute("tabBinding", child); vlayout.appendChild(chkSelectionTab); chkSelectionTabForExport.add(chkSelectionTab); isHasSelectionTab = true; } // in case no child tab can export. clear selection area if (isHasSelectionTab == false) { selectionTabRow.getChildren().clear(); } }