Package org.jallinone.items.java

Examples of org.jallinone.items.java.ItemVariantVO


         * @param attributeName attribute name that identifies the selected grid column
         * @return <code>true</code> if the selected cell is editable, <code>false</code> otherwise
         */
        public boolean isCellEditable(GridControl grid,int row,String attributeName) {
          String currentSelVarType = null;
          ItemVariantVO vo = null;
          for(int i=0;i<grid.getVOListTableModel().getRowCount();i++) {
            vo = (ItemVariantVO)grid.getVOListTableModel().getObjectForRow(i);
            if (Boolean.TRUE.equals(vo.getSelected()) && currentSelVarType==null)
              currentSelVarType = vo.getVariantType();
          }
          if (currentSelVarType!=null &&
              !((ItemVariantVO)grid.getVOListTableModel().getObjectForRow(row)).getVariantType().equals(currentSelVarType))
            return false;
          return grid.isFieldEditable(row,attributeName);
View Full Code Here


      GridParams gridParams = new GridParams();
      VariantNameVO varVO = null;
      ArrayList[] tmp = new ArrayList[managedVariants.size()-1];
      boolean[] tmpSameVarType = new boolean[managedVariants.size()-1];
      boolean sameVarType = true;
      ItemVariantVO variantVO = null;
      String currVarType = null;
      for(int i=0;i<managedVariants.size();i++) {
        varVO = (VariantNameVO)managedVariants.get(i);
        gridParams.getOtherGridParams().put(ApplicationConsts.ITEM_PK,matrixVO.getItemPK());
        gridParams.getOtherGridParams().put(ApplicationConsts.TABLE_NAME,varVO.getTableName());
        //gridParams.getOtherGridParams().put(ApplicationConsts.VARIANT_TYPE,null); //???
        answer = bean.loadItemVariants(gridParams,serverLanguageId,username);
        if (answer.isError())
          throw new Exception(answer.getErrorMessage());
        // list of all variant's elements (not only the ones associated to the current item
        // ("selected" attribute establishes which ones are associated to the current item...)
        ArrayList vos = new ArrayList(((VOListResponse)answer).getRows());

        sameVarType = true;
        currVarType = null;
        for(int k=0;k<vos.size();k++) {
          variantVO = (ItemVariantVO)vos.get(k);
          if (!Boolean.TRUE.equals(variantVO.getSelected()))
              continue;
          if (currVarType!=null && !currVarType.equals(variantVO.getVariantType())) {
            sameVarType = false;
            break;
          }
          else
            currVarType = variantVO.getVariantType();
        }

        if (i==0) {
          for(int k=0;k<vos.size();k++) {
            variantVO = (ItemVariantVO)vos.get(k);
            if (!Boolean.TRUE.equals(variantVO.getSelected()))
                continue;

            VariantsMatrixRowVO rowVO = new VariantsMatrixRowVO();
            setVariantDescription(variantVO,rowVO,sameVarType);
            setVariantTypeAndCode(variantVO,rowVO);
View Full Code Here

   * @param cols list of all columns of the matrix (created recursivelly by this method)
   * @param depth current dept
   * @param colVO parent column to "duplicate" for each current variant's elements
   */
   private void createCombinations(ArrayList managedVariants,ArrayList[] tmp,boolean[] tmpSameVarType,ArrayList cols,int depth,VariantsMatrixColumnVO colVO) throws Exception {
     ItemVariantVO vo = null;
     VariantsMatrixColumnVO col2VO = null;
     for(int i=0;i<tmp[depth].size();i++) {
       vo = (ItemVariantVO)tmp[depth].get(i); // colors: red, black, orange...
       if (!Boolean.TRUE.equals(vo.getSelected()))
         // skip variant's element, if not associated to the current item...
         continue;

       if (depth < tmp.length - 1) {
         if (colVO == null) {
View Full Code Here

TOP

Related Classes of org.jallinone.items.java.ItemVariantVO

Copyright © 2018 www.massapicom. 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.