Examples of GridParams


Examples of org.openswing.swing.message.send.java.GridParams

public class GridParamsAdapter extends XmlAdapter<String, GridParams> {

    @Override
    public GridParams unmarshal(String v) throws Exception {
      v = v.substring(12,v.length()-13);
      GridParams gp = new GridParams();
        String[] vv = v.split("\t");
        gp.setAction(Integer.parseInt(vv[0]));
        gp.setStartPos(Integer.parseInt(vv[1]));
       
//        String[] sortedCols = vv[2].split(",");
//        String[] sortedVersus = vv[3].split(",");
//       
//        for(int i=0;i<sortedCols.length;i++) {
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

          attribute2dbField,
          ItemSheetVO.class,
          "Y",
          "N",
          null,
          new GridParams(),
          50,
          true
      );

      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOListResponse)answer;
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

          attribute2dbField,
          ItemSheetLevelVO.class,
          "Y",
          "N",
          null,
          new GridParams(),
          true
      );

      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOListResponse)answer;
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

  /**
   * Retrieve item types and fill in the item types combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes", new GridParams());
    if (!res.isError()) {
      ItemTypeVO vo = null;
      itemTypes = ((VOListResponse) res).getRows();
      for (int i = 0; i < itemTypes.size(); i++) {
        vo = (ItemTypeVO) itemTypes.get(i);
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

      Response res = discountBean.getDiscountsList(
          vo.getCompanyCodeSys01DOC01(),
          discountCodes,
          serverLanguageId,
          new GridParams(),
          username,
          DiscountVO.class
      );

      if (!res.isError()) {
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

      public void forceValidate() {}

    });

    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
    controlItemType.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED && detailPanel.getMode()!=Consts.READONLY) {
          DetailSaleDocRowVO vo = (DetailSaleDocRowVO)detailPanel.getVOModel().getValueObject();
          vo.setItemCodeItm01DOC02(null);
          vo.setDescriptionSYS10(null);
          vo.setMinSellingQtyUmCodeReg02DOC02(null);
          vo.setVatCodeItm01DOC02(null);
          vo.setVatDescriptionDOC02(null);
          vo.setDeductibleReg01DOC02(null);
          vo.setValueReg01DOC02(null);
          vo.setValueSal02DOC02(null);
          vo.setQtyDOC02(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC02());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
        }
      }
    });

    // set buttons disabilitation...
    HashSet buttonsToDisable = new HashSet();
    buttonsToDisable.add(insertButton1);
    buttonsToDisable.add(editButton1);
    buttonsToDisable.add(deleteButton1);
    buttonsToDisable.add(copyButton1);
    detailPanel.addButtonsNotEnabled(buttonsToDisable,frame);
    grid.addButtonsNotEnabled(buttonsToDisable,frame);



    variantsPanel.setVariantsPanelController(new ProductVariantsPanelController() {

      public boolean validateCell(int rowNumber,int colNumber,String attributeName,Number oldValue,Number newValue) {

        if (newValue==null)
          return true;

        if (pricesMatrix!=null) {
          CustomValueObject vo = (CustomValueObject)pricesMatrix.get(rowNumber);
          Object lastPrice = null;
          Object currentPrice = null;
          try {
            lastPrice = CustomValueObject.class.getMethod("getAttributeNameN"+(colNumber-1),new Class[0]).invoke(vo,new Object[0]);
          }
          catch (Exception ex) {
          }
          Object[][] cells = variantsPanel.getCells();
          for(int i=0;i<cells.length;i++) {
            vo = (CustomValueObject)pricesMatrix.get(i);
            for(int j=0;j<cells[i].length;j++) {

              if (i==rowNumber && colNumber-1==j)
                continue;
              if (cells[i][j]==null)
                continue;

              try {
                currentPrice = CustomValueObject.class.getMethod("getAttributeNameN"+j,new Class[0]).invoke(vo,new Object[0]);
              }
              catch (Exception ex) {
              }
              if (currentPrice!=null && lastPrice==null ||
                  currentPrice==null && lastPrice!=null ||
                  currentPrice!=null && !currentPrice.equals(lastPrice)) {
                JOptionPane.showMessageDialog(
                    ClientUtils.getParentFrame(variantsPanel),
                    ClientSettings.getInstance().getResources().getResource("it is not allowed to insert variants having different unit prices"),
                    ClientSettings.getInstance().getResources().getResource("Attention"),
                    JOptionPane.WARNING_MESSAGE
                );
                return false;
              }
            } // end innner for
          } // end outer for

          if(lastPrice!=null) {
            controlPriceUnit.setValue(lastPrice);
            variantsPanel.getForm().getVOModel().setValue(controlPriceUnit.getAttributeName(),lastPrice);
          }
          else {
            lastPrice = ((PriceItemVO)variantsPanel.getLookupController().getLookupVO()).getValueSAL02();
            controlPriceUnit.setValue(lastPrice);
            variantsPanel.getForm().getVOModel().setValue(controlPriceUnit.getAttributeName(),lastPrice);
          }
        }

        return true;
      }

      public void loadDataCompleted(boolean error) {
        if (!error) {
          // load also variants prices, if available...
          GridParams gridParams = new GridParams();
          gridParams.getOtherGridParams().put(ApplicationConsts.VARIANTS_MATRIX_VO,variantsPanel.getVariantsMatrixVO());
          gridParams.getOtherGridParams().put(ApplicationConsts.PRICELIST,parentVO.getPricelistCodeSal01DOC01());
          Response res = ClientUtils.getData("loadVariantsPrices",gridParams);
          if (!res.isError()) {
            pricesMatrix = ((VOListResponse)res).getRows();
          }
          else
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

    try {
      jbInit();

      mainPanel.setFormController(controller);

      Response res = ClientUtils.getData("loadWarehouseMotives",new GridParams());
      Domain d = new Domain("WAR_MOTIVES");
      if (!res.isError()) {
        MotiveVO vo = null;
        java.util.List rows = null;
        rows = ((VOListResponse)res).getRows();
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

  /**
   * Retrieve comapnies list and fill in the companies combo box.
   */
  private void init() {
    Response res = ClientUtils.getData("loadCompanies",new GridParams());
    final Domain d = new Domain("COMPANIES");
    if (!res.isError()) {
      CompanyVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

          customerVatDescription = vatVO.getDescriptionSYS10();
        }
      }

      // retrieve all item rows...
      GridParams pars = new GridParams();
      pars.getOtherGridParams().put(ApplicationConsts.SALE_DOC_PK,pk);
      Response rowsResponse = rowsBean.loadSaleDocRows(variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,pars,serverLanguageId,username);
      if (rowsResponse.isError())
        throw new Exception(rowsResponse.getErrorMessage());
      java.util.List itemRows = ((VOListResponse)rowsResponse).getRows();
View Full Code Here

Examples of org.openswing.swing.message.send.java.GridParams

      public void forceValidate() {}

    });

    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
    controlItemType.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED && detailPanel.getMode()!=Consts.READONLY) {
          DetailSaleDocRowVO vo = (DetailSaleDocRowVO)detailPanel.getVOModel().getValueObject();
          vo.setItemCodeItm01DOC02(null);
          vo.setDescriptionSYS10(null);
          vo.setMinSellingQtyUmCodeReg02DOC02(null);
          vo.setVatCodeItm01DOC02(null);
          vo.setVatDescriptionDOC02(null);
          vo.setDeductibleReg01DOC02(null);
          vo.setValueReg01DOC02(null);
          vo.setValueSal02DOC02(null);
          vo.setQtyDOC02(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC02());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);

          detailPanel.pull(controlItemCode.getAttributeName());
          try {
            controlItemCode.validateCode(null);
          }
          catch (Exception ex) {
          }

        }
      }
    });

    // set buttons disabilitation...
    HashSet buttonsToDisable = new HashSet();
    buttonsToDisable.add(insertButton1);
    buttonsToDisable.add(editButton1);
    buttonsToDisable.add(deleteButton1);
    buttonsToDisable.add(copyButton1);
    detailPanel.addButtonsNotEnabled(buttonsToDisable,frame);
    grid.addButtonsNotEnabled(buttonsToDisable,frame);


    variantsPanel.setVariantsPanelController(new ProductVariantsPanelController() {

      public boolean validateCell(int rowNumber,int colNumber,String attributeName,Number oldValue,Number newValue) {

        if (newValue==null)
          return true;

        if (pricesMatrix!=null) {
          CustomValueObject vo = (CustomValueObject)pricesMatrix.get(rowNumber);
          Object lastPrice = null;
          Object currentPrice = null;
          try {
            lastPrice = CustomValueObject.class.getMethod("getAttributeNameN"+(colNumber-1),new Class[0]).invoke(vo,new Object[0]);
          }
          catch (Exception ex) {
          }
          Object[][] cells = variantsPanel.getCells();
          for(int i=0;i<cells.length;i++) {
            vo = (CustomValueObject)pricesMatrix.get(i);
            for(int j=0;j<cells[i].length;j++) {

              if (i==rowNumber && colNumber-1==j)
                continue;
              if (cells[i][j]==null)
                continue;

              try {
                currentPrice = CustomValueObject.class.getMethod("getAttributeNameN"+j,new Class[0]).invoke(vo,new Object[0]);
              }
              catch (Exception ex) {
              }
              if (currentPrice!=null && lastPrice==null ||
                  currentPrice==null && lastPrice!=null ||
                  currentPrice!=null && !currentPrice.equals(lastPrice)) {
                JOptionPane.showMessageDialog(
                    ClientUtils.getParentFrame(variantsPanel),
                    ClientSettings.getInstance().getResources().getResource("it is not allowed to insert variants having different unit prices"),
                    ClientSettings.getInstance().getResources().getResource("Attention"),
                    JOptionPane.WARNING_MESSAGE
                );
                return false;
              }
            } // end innner for
          } // end outer for

          if(lastPrice!=null) {
            controlPriceUnit.setValue(lastPrice);
            variantsPanel.getForm().getVOModel().setValue(controlPriceUnit.getAttributeName(),lastPrice);
          }
          else {
            lastPrice = ((PriceItemVO)variantsPanel.getLookupController().getLookupVO()).getValueSAL02();
            controlPriceUnit.setValue(lastPrice);
            variantsPanel.getForm().getVOModel().setValue(controlPriceUnit.getAttributeName(),lastPrice);
          }
        }

        return true;
      }

      public void loadDataCompleted(boolean error) {
        if (!error) {
          // load also variants prices, if available...
          GridParams gridParams = new GridParams();
          gridParams.getOtherGridParams().put(ApplicationConsts.VARIANTS_MATRIX_VO,variantsPanel.getVariantsMatrixVO());
          gridParams.getOtherGridParams().put(ApplicationConsts.PRICELIST,parentVO.getPricelistCodeSal01DOC01());
          Response res = ClientUtils.getData("loadVariantsPrices",gridParams);
          if (!res.isError()) {
            pricesMatrix = ((VOListResponse)res).getRows();
          }
          else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.