/** Retrieve item types and fill in the item types combo box. */ private void init() { Response res = ClientUtils.getData("loadItemTypes", new GridParams()); Domain d = new Domain("ITEM_TYPES"); if (!res.isError()) { ItemTypeVO vo = null; list = ((VOListResponse) res).getRows(); for (int i = 0; i < list.size(); i++) { vo = (ItemTypeVO) list.get(i); d.addDomainPair(vo.getProgressiveHie02ITM02(), vo.getDescriptionSYS10()); } } controlHierarchy.setDomain(d); controlHierarchy .getComboBox() .addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == e.SELECTED) { ItemTypeVO typeVO = (ItemTypeVO) list.get(controlHierarchy.getSelectedIndex()); treePanel.setCompanyCode(typeVO.getCompanyCodeSys01ITM02()); treePanel.setProgressiveHIE02((BigDecimal) controlHierarchy.getValue()); DetailSupplierVO vo = (DetailSupplierVO) supplierPanel.getVOModel().getValueObject(); treePanel.setCompanyCode(vo.getCompanyCodeSys01REG04()); treePanel.reloadTree(); itemsGrid.clearData(); } } }); if (d.getDomainPairList().length == 1) controlHierarchy.getComboBox().setSelectedIndex(0); else controlHierarchy.getComboBox().setSelectedIndex(-1); }
/** * Method invoked when pressing import all items button: it add all items to the supplier items * collection. */ void impAllItemsButton_actionPerformed(ActionEvent e) { DetailSupplierVO vo = (DetailSupplierVO) supplierPanel.getVOModel().getValueObject(); SupplierItemVO itemVO = new SupplierItemVO(); itemVO.setCompanyCodeSys01PUR02(vo.getCompanyCodeSys01REG04()); itemVO.setProgressiveReg04PUR02(vo.getProgressiveREG04()); itemVO.setProgressiveHie02PUR02((BigDecimal) controlHierarchy.getValue()); Response res = ClientUtils.getData("importAllItemsToSupplier", itemVO); if (!res.isError()) itemsGrid.reloadData(); }
private void jbInit() throws Exception { hierarTreePanel.setEnabled(false); warehousePanel.setLayout(borderLayout1); warehouseForm.setVOClassName("org.jallinone.warehouse.java.WarehouseVO"); this.setTitle(ClientSettings.getInstance().getResources().getResource("warehouse detail")); buttonsPanel.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); insertButton.setText("insertButton1"); reloadButton.setText("reloadButton1"); deleteButton.setText("deleteButton1"); warehouseForm.setInsertButton(insertButton); warehouseForm.setCopyButton(copyButton); warehouseForm.setEditButton(editButton); warehouseForm.setReloadButton(reloadButton); warehouseForm.setDeleteButton(deleteButton); warehouseForm.setSaveButton(saveButton); warehouseForm.setFunctionId("WAR01"); warehouseForm.setLayout(gridBagLayout1); controlZip.setAttributeName("zipWAR01"); controlZip.setCanCopy(true); controlZip.setLinkLabel(labelZip); controlZip.setMaxCharacters(20); controlProv.setAttributeName("provinceWAR01"); controlProv.setCanCopy(true); controlProv.setLinkLabel(labelProv); controlProv.setMaxCharacters(20); controlProv.setTrimText(true); controlProv.setUpperCase(true); controlCity.setAttributeName("cityWAR01"); controlCity.setCanCopy(true); controlCity.setLinkLabel(labelCity); controlAddress.setAttributeName("addressWAR01"); controlAddress.setCanCopy(true); controlAddress.setLinkLabel(labelAddress); labelAddress.setText("address"); controlCountry.setAttributeName("countryWAR01"); controlCountry.setCanCopy(true); controlCountry.setLinkLabel(labelCountry); controlCountry.setMaxCharacters(20); controlCountry.setTrimText(true); controlCountry.setUpperCase(true); labelZip.setText("zip"); labelCity.setText("city"); labelCountry.setText("country"); labelProv.setText("prov"); controlWarCode.setAttributeName("warehouseCodeWAR01"); controlWarCode.setLinkLabel(labelWarCode); controlWarCode.setMaxCharacters(20); controlWarCode.setRequired(true); controlWarCode.setRpadding(false); controlWarCode.setTrimText(true); controlWarCode.setUpperCase(true); controlWarCode.setEnabledOnEdit(false); labelWarCode.setText("warehouseCodeWAR01"); labelDescr.setText("descriptionWAR01"); controlDescr.setAttributeName("descriptionWAR01"); controlDescr.setLinkLabel(labelDescr); controlDescr.setRequired(true); labelCompanyCode.setText("companyCodeSys01WAR01"); controlCompaniesCombo.setAttributeName("companyCodeSys01WAR01"); controlCompaniesCombo.setCanCopy(true); controlCompaniesCombo.setLinkLabel(labelCompanyCode); controlCompaniesCombo.setRequired(true); controlCompaniesCombo.setEnabledOnEdit(false); labelRoles.setText("edit/delete warehouse role"); controlRoles.setAttributeName("progressiveSys04WAR01"); controlRoles.setDomainId("USERROLES"); controlRoles.setLinkLabel(labelRoles); locationsPanel.setLayout(borderLayout2); tabbedPane.add(warehousePanel, "warehousePanel"); this.getContentPane().add(buttonsPanel, BorderLayout.NORTH); this.getContentPane().add(tabbedPane, BorderLayout.CENTER); warehouseForm.add( labelZip, new GridBagConstraints( 3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCity, new GridBagConstraints( 0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelAddress, new GridBagConstraints( 0, 3, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlAddress, new GridBagConstraints( 2, 3, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlCity, new GridBagConstraints( 2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 100, 0)); warehouseForm.add( controlZip, new GridBagConstraints( 4, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlWarCode, new GridBagConstraints( 2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 100, 0)); warehousePanel.add(warehouseForm, BorderLayout.CENTER); buttonsPanel.add(insertButton, null); buttonsPanel.add(copyButton, null); buttonsPanel.add(editButton, null); buttonsPanel.add(saveButton, null); buttonsPanel.add(reloadButton, null); buttonsPanel.add(deleteButton, null); buttonsPanel.add(navigatorBar, null); warehouseForm.add( labelWarCode, new GridBagConstraints( 0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); warehouseForm.add( labelDescr, new GridBagConstraints( 0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlDescr, new GridBagConstraints( 2, 2, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlCountry, new GridBagConstraints( 4, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCountry, new GridBagConstraints( 3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelProv, new GridBagConstraints( 0, 5, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); warehouseForm.add( controlProv, new GridBagConstraints( 2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelCompanyCode, new GridBagConstraints( 0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); tabbedPane.add(locationsPanel, "locationsPanel"); locationsPanel.add(split, BorderLayout.CENTER); split.setDividerLocation(150); split.add(hierarTreePanel, JSplitPane.LEFT); split.add(availPanel, JSplitPane.RIGHT); tabbedPane.add(bookedItemsPanel, "bookedItemsPanel"); tabbedPane.add(orderedItemsPanel, "orderedItemsPanel"); hierarTreePanel.setFunctionId("WAR01"); tabbedPane.setTitleAt( 0, ClientSettings.getInstance().getResources().getResource("warehouse detail")); tabbedPane.setTitleAt(1, ClientSettings.getInstance().getResources().getResource("positions")); tabbedPane.setTitleAt( 2, ClientSettings.getInstance().getResources().getResource("bookedItemsPanel")); tabbedPane.setTitleAt( 3, ClientSettings.getInstance().getResources().getResource("orderedItemsPanel")); warehouseForm.add( controlCompaniesCombo, new GridBagConstraints( 2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( controlRoles, new GridBagConstraints( 2, 6, 1, 2, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); warehouseForm.add( labelRoles, new GridBagConstraints( 0, 7, 2, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); }