Package org.apache.commons.collections.set

Examples of org.apache.commons.collections.set.ListOrderedSet


  private Map<Object, Object> attributes;

  public TobagoFacesContext(FacesContext context) {
    super(context);
    scriptFiles = SetUniqueList.decorate(new ArrayList());
    scriptBlocks = new ListOrderedSet();
    styleFiles = new ListOrderedSet();
    styleBlocks = new ListOrderedSet();
    onloadScripts = SetUniqueList.decorate(new ArrayList());
    onunloadScripts = new ListOrderedSet();
    onexitScripts = new ListOrderedSet();
    onsubmitScripts = new ListOrderedSet();
    popups = new ListOrderedSet();
  }
View Full Code Here


        // * String productId      -- Product ID to look up feature types
        GenericDelegator delegator = dctx.getDelegator();
        String productId = (String) context.get("productId");
        Locale locale = (Locale) context.get("locale");
        String errMsg=null;
        Set featureSet = new ListOrderedSet();

        try {
            Map fields = UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "SELECTABLE_FEATURE");
            List order = UtilMisc.toList("sequenceNum", "productFeatureTypeId");
            List features = delegator.findByAndCache("ProductFeatureAndAppl", fields, order);
            Iterator i = features.iterator();
            while (i.hasNext()) {
                featureSet.add(((GenericValue) i.next()).getString("productFeatureTypeId"));
            }
            //if (Debug.infoOn()) Debug.logInfo("" + featureSet, module);
        } catch (GenericEntityException e) {
            Map messageMap = UtilMisc.toMap("errProductFeatures", e.toString());
            errMsg = UtilProperties.getMessage(resource,"productservices.problem_reading_product_features_errors", messageMap, locale);
            Debug.logError(e, errMsg, module);
            return ServiceUtil.returnError(errMsg);
        }

        if (featureSet.size() == 0) {
            errMsg = UtilProperties.getMessage(resource,"productservices.problem_reading_product_features", locale);
            // ToDo DO 2004-02-23 Where should the errMsg go?
            Debug.logWarning(errMsg + " for product " + productId, module);
            //return ServiceUtil.returnError(errMsg);
        }
View Full Code Here

    public double getTaxTotal() {
        return getTaxTotalBd().doubleValue();
    }

    public Set getItemFeatureSet(GenericValue item) {
        Set featureSet = new ListOrderedSet();
        List featureAppls = null;
        if (item.get("productId") != null) {
            try {
                featureAppls = item.getDelegator().findByAndCache("ProductFeatureAppl", UtilMisc.toMap("productId", item.getString("productId")));
                List filterExprs = UtilMisc.toList(new EntityExpr("productFeatureApplTypeId", EntityOperator.EQUALS, "STANDARD_FEATURE"));
                filterExprs.add(new EntityExpr("productFeatureApplTypeId", EntityOperator.EQUALS, "REQUIRED_FEATURE"));
                featureAppls = EntityUtil.filterByOr(featureAppls, filterExprs);
            } catch (GenericEntityException e) {
                Debug.logError(e, "Unable to get ProductFeatureAppl for item : " + item, module);
            }
            if (featureAppls != null) {
                Iterator fai = featureAppls.iterator();
                while (fai.hasNext()) {
                    GenericValue appl = (GenericValue) fai.next();
                    featureSet.add(appl.getString("productFeatureId"));
                }
            }
        }

        // get the ADDITIONAL_FEATURE adjustments
        List additionalFeatures = null;
        try {
            additionalFeatures = item.getRelatedByAnd("OrderAdjustment", UtilMisc.toMap("orderAdjustmentTypeId", "ADDITIONAL_FEATURE"));
        } catch (GenericEntityException e) {
            Debug.logError(e, "Unable to get OrderAdjustment from item : " + item, module);
        }
        if (additionalFeatures != null) {
            Iterator afi = additionalFeatures.iterator();
            while (afi.hasNext()) {
                GenericValue adj = (GenericValue) afi.next();
                String featureId = adj.getString("productFeatureId");
                if (featureId != null) {
                    featureSet.add(featureId);
                }
            }
        }

        return featureSet;
View Full Code Here

        }
    }

    /** Returns a Set of the item's features */
    public Set getFeatureSet() {
        Set featureSet = new ListOrderedSet();
        GenericValue product = this.getProduct();
        if (product != null) {
            List featureAppls = null;
            try {
                featureAppls = product.getRelated("ProductFeatureAppl");
                List filterExprs = UtilMisc.toList(new EntityExpr("productFeatureApplTypeId", EntityOperator.EQUALS, "STANDARD_FEATURE"));
                filterExprs.add(new EntityExpr("productFeatureApplTypeId", EntityOperator.EQUALS, "REQUIRED_FEATURE"));
                featureAppls = EntityUtil.filterByOr(featureAppls, filterExprs);
            } catch (GenericEntityException e) {
                Debug.logError(e, "Unable to get features from product : " + product.get("productId"), module);
            }
            if (featureAppls != null) {
                Iterator fai = featureAppls.iterator();
                while (fai.hasNext()) {
                    GenericValue appl = (GenericValue) fai.next();
                    featureSet.add(appl.getString("productFeatureId"));
                }
            }
        }
        if (this.additionalProductFeatureAndAppls != null) {
            Iterator aapi = this.additionalProductFeatureAndAppls.values().iterator();
            while (aapi.hasNext()) {
                GenericValue appl = (GenericValue) aapi.next();
                featureSet.add(appl.getString("productFeatureId"));
            }
        }
        return featureSet;
    }
View Full Code Here

        logger.debug("objectsToSet(objects={}) - start", objects);

        if ( objects == null ) {
            return null;
        }
        Set set = new ListOrderedSet();
        for (int i = 0; i < objects.length; i++) {
            set.add(objects[i]);
        }
        return set;
    }
View Full Code Here

        ImportedKeysSearchCallbackFilteredByPKs callback = new ImportedKeysSearchCallbackFilteredByPKs(connection, rootTables);
        ITableFilter filter = callback.getFilter();
        DepthFirstSearch search = new DepthFirstSearch();
        String[] tableNames = rootTables.getTableNames();
        ListOrderedSet tmpTables = search.search( tableNames, callback );
        String[] dependentTables  = CollectionsHelper.setToStrings( tmpTables );
        IDataSet tmpDataset = connection.createDataSet( dependentTables );
        FilteredDataSet dataset = new FilteredDataSet(filter, tmpDataset);
        return dataset;
    }
View Full Code Here

      this.searching = true;
    }

    // set of tables that will be returned (i.e, the declared tables and its
    // dependencies)
    this.result = new ListOrderedSet();

    // callback used to help the search
    this.callback = callback;
       
    this.nodesFrom = new ListOrderedSet();
   
    int sizeNodesFromBefore = 0;
    int sizeResultBefore = 0;
    boolean keepSearching = true;
    this.scannedNodes = new HashSet();
View Full Code Here

   * @param matcher the matcher that can match menus and menu items.
   * @param recursive if set to true, will find sub-menus as well.
   * @return all menus in the specified shells that match the matcher.
   */
  public List findMenus(Shell[] shells, IMatcher matcher, boolean recursive) {
    ListOrderedSet result = new ListOrderedSet();
    for (int i = 0; i < shells.length; i++)
      result.addAll(findMenus(shells[i], matcher, recursive));
    return new ArrayList(result);
  }
View Full Code Here

   * @param matcher the matcher that can match menus and menu items.
   * @param recursive if set to true, will find sub-menus as well.
   * @return all menus in the specified shell that match the matcher.
   */
  public List findMenus(final Shell shell, IMatcher matcher, boolean recursive) {
    ListOrderedSet result = new ListOrderedSet();
    result.addAll(findMenus(menuBar(shell), matcher, recursive));
    return new ArrayList(result);
  }
View Full Code Here

   * @param matcher
   * @param recursive
   * @return
   */
  private List findMenusInternal(final Menu bar, final IMatcher matcher, final boolean recursive) {
    ListOrderedSet result = new ListOrderedSet();
    if (bar != null) {
      bar.notifyListeners(SWT.Show, new Event());
      MenuItem[] items = bar.getItems();
      for (int i = 0; i < items.length; i++) {
        MenuItem menuItem = items[i];
        if (isSeparator(menuItem)) {
          if (log.isTraceEnabled())
            log.trace(menuItem + " is a separator, skipping.");
          continue;
        }
        if (matcher.match(menuItem))
          result.add(menuItem);
        if (recursive)
          result.addAll(findMenusInternal(menuItem.getMenu(), matcher, recursive));
      }
      bar.notifyListeners(SWT.Hide, new Event());
    }
    return new ArrayList(result);
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.set.ListOrderedSet

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.