Examples of ConfigOption


Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        public void setupButton(XButton button){
            this.button = button;
            List options = question.getOptions();
            if(question.isSelected()){
                ConfigOption selectedOption = question.getSelected();
                showOption = options.indexOf(selectedOption);
            }
            ConfigOption configoption = (ConfigOption)options.get(showOption);        
            button.setText(configoption.getDescription());
            return;
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        } */

        public void buttonClicked(){
            //only two choices, if the button is clicked, toggle
            List options = question.getOptions();
            ConfigOption unselectedoption = (ConfigOption)options.get(showOption);        
            unselectedoption.setSelected(false);
            showOption = (showOption+1)%2;
            ConfigOption selectedoption = (ConfigOption)options.get(showOption);        
            selectedoption.setSelected(true);
            button.setText(selectedoption.getDescription());
            return;
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

              
        public void reset(){
            showOption = 0;
            List options = question.getOptions();
            if(question.isSelected()){
                ConfigOption selectedOption = question.getSelected();
                showOption = options.indexOf(selectedOption);
            }
            ConfigOption configoption = (ConfigOption)options.get(showOption);        
            button.setText(configoption.getDescription());
            return;          
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

            Iterator options = question.getOptions().iterator();
          
            DefaultListModel listModel = new DefaultListModel();
           
            while(options.hasNext()){
                ConfigOption configoption = (ConfigOption)options.next();
                listModel.addElement(configoption.getDescription());
                //Debug.logInfo("Found option " + configoption.getDescription(), module);
                //Debug.logInfo("IsAvailable: "+configoption.isAvailable()+
                //    ", IsSelected: "+configoption.isSelected(), module);
            }
           
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

                    List<ConfigOption> options = (List<ConfigOption>)question.getOptions();
                    for (ConfigOption option: options){
                        option.setSelected(false);
                    }
                    for(int i: selected){
                        ConfigOption option = options.get(i);
                        option.setSelected(true);
                    }
                    m_configureItem.listPressed();
                }
            }
            catch(Exception ex){
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

            while(iter.hasNext()){
                ConfigItem question = (ConfigItem)iter.next();
                List options = question.getOptions();
                Iterator itero = options.iterator();
                while(itero.hasNext()){
                    ConfigOption configoption = (ConfigOption)itero.next();
                    if (configoption.isSelected()){
                        listModel.addElement("  "+configoption.getDescription());
                    }
                }
            }
        }               
        m_configList.setModel(listModel);
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

                             
            List options = question.getOptions();
            Iterator itero = options.iterator();
           
            while(itero.hasNext()){
                ConfigOption configoption = (ConfigOption)itero.next();
                /*Debug.logInfo("Found option " + configoption.getDescription(), module);
                Debug.logInfo("IsAvailable: "+configoption.isAvailable()+
                    ", IsSelected: "+configoption.isSelected(), module);*/
                //configoption.getComponents()
            }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        result.put("productionRunId", productionRunId);

        Iterator options = config.getSelectedOptions().iterator();
        HashMap components = new HashMap();
        while (options.hasNext()) {
            ConfigOption co = (ConfigOption)options.next();
            //components.addAll(co.getComponents());
            Iterator selComponents = co.getComponents().iterator();
            while (selComponents.hasNext()) {
                Double componentQuantity = null;
                GenericValue selComponent = (GenericValue)selComponents.next();
                if (selComponent.get("quantity") != null) {
                    componentQuantity = selComponent.getDouble("quantity");
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        result.put("productionRunId", productionRunId);

        Iterator options = config.getSelectedOptions().iterator();
        HashMap components = new HashMap();
        while (options.hasNext()) {
            ConfigOption co = (ConfigOption)options.next();
            //components.addAll(co.getComponents());
            Iterator selComponents = co.getComponents().iterator();
            while (selComponents.hasNext()) {
                Double componentQuantity = null;
                GenericValue selComponent = (GenericValue)selComponents.next();
                if (selComponent.get("quantity") != null) {
                    componentQuantity = selComponent.getDouble("quantity");
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

    public static boolean isProductInventoryAvailableByFacility(ProductConfigWrapper productConfig, String inventoryFacilityId, double quantity, LocalDispatcher dispatcher) throws GenericServiceException {
        boolean available = true;
        List options = productConfig.getSelectedOptions();
        Iterator optionsIt = options.iterator();
        while (optionsIt.hasNext()) {
            ConfigOption ci = (ConfigOption)optionsIt.next();
            List products = ci.getComponents();
            Iterator productsIt = products.iterator();
            while (productsIt.hasNext()) {
                GenericValue product = (GenericValue)productsIt.next();
                String productId = product.getString("productId");
                Double cmpQuantity = product.getDouble("quantity");
                double neededQty = 1.0;
                if (cmpQuantity != null) {
                    neededQty = quantity * cmpQuantity.doubleValue();
                }
                if (!isProductInventoryAvailableByFacility(productId, inventoryFacilityId, neededQty, dispatcher)) {
                    ci.setAvailable(false);
                }
            }
            if (!ci.isAvailable()) {
                available = false;
            }
        }
        return available;
    }
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.