Package org.apache.struts.util

Examples of org.apache.struts.util.LabelValueBean


    */
    private static List initNames() {
       List lResults = new ArrayList();

       for (int i = 0; i < 3; i++) {
          lResults.add(new LabelValueBean(null, null));
       }

       return lResults;
    }
View Full Code Here


    public Collection getBeanCollection() {
        if (beanCollection == null) {
            Vector entries = new Vector(10);

            entries.add(new LabelValueBean("Label 0", "Value 0"));
            entries.add(new LabelValueBean("Label 1", "Value 1"));
            entries.add(new LabelValueBean("Label 2", "Value 2"));
            entries.add(new LabelValueBean("Label 3", "Value 3"));
            entries.add(new LabelValueBean("Label 4", "Value 4"));
            entries.add(new LabelValueBean("Label 5", "Value 5"));
            entries.add(new LabelValueBean("Label 6", "Value 6"));
            entries.add(new LabelValueBean("Label 7", "Value 7"));
            entries.add(new LabelValueBean("Label 8", "Value 8"));
            entries.add(new LabelValueBean("Label 9", "Value 9"));

            beanCollection = entries;
        }

        return (beanCollection);
View Full Code Here

    public Collection getBeanCollection() {
        if (beanCollection == null) {
            Vector entries = new Vector(10);

            entries.add(new LabelValueBean("Label 0", "Value 0"));
            entries.add(new LabelValueBean("Label 1", "Value 1"));
            entries.add(new LabelValueBean("Label 2", "Value 2"));
            entries.add(new LabelValueBean("Label 3", "Value 3"));
            entries.add(new LabelValueBean("Label 4", "Value 4"));
            entries.add(new LabelValueBean("Label 5", "Value 5"));
            entries.add(new LabelValueBean("Label 6", "Value 6"));
            entries.add(new LabelValueBean("Label 7", "Value 7"));
            entries.add(new LabelValueBean("Label 8", "Value 8"));
            entries.add(new LabelValueBean("Label 9", "Value 9"));

            beanCollection = entries;
        }

        return (beanCollection);
View Full Code Here

        log.debug("initFromBeans");

        // Initialize
        ArrayList satisfactionList = new ArrayList();
        satisfactionList.add(new LabelValueBean("Very Satisfied", "4"));
        satisfactionList.add(new LabelValueBean("Satisfied", "3"));
        satisfactionList.add(new LabelValueBean("Not Very Satisfied", "2"));
        satisfactionList.add(new LabelValueBean("Not Satisfied", "1"));
        request.setAttribute("satisfactionList", satisfactionList);

        ArrayList osTypes = new ArrayList();
        osTypes.add(new LabelValueBean("Mac OsX", "OsX"));
        osTypes.add(new LabelValueBean("Windows 95/98/Me", "Win32"));
        osTypes.add(new LabelValueBean("Windows NT/2000/XP/2003", "WinNT"));
        osTypes.add(new LabelValueBean("Linux", "Linux"));
        osTypes.add(new LabelValueBean("BSD NetBSD/FreeBSD/OpenBSD", "BSD"));
        request.setAttribute("osTypes", osTypes);

        ArrayList languageTypes = new ArrayList();
        languageTypes.add(new LabelValueBean("C++", "C++"));
        languageTypes.add(new LabelValueBean("C#", "C#"));
        languageTypes.add(new LabelValueBean("Java", "java"));
        languageTypes.add(new LabelValueBean("Smalltalk", "Smalltalk"));
        request.setAttribute("languageTypes", languageTypes);
    }
View Full Code Here

    */
    private static List initNames() {
       List lResults = new ArrayList();

       for (int i = 0; i < 3; i++) {
          lResults.add(new LabelValueBean(null, null));
       }

       return lResults;
    }
View Full Code Here

    public Collection getBeanCollection() {
        if (beanCollection == null) {
            Vector entries = new Vector(10);

            entries.add(new LabelValueBean("Label 0", "Value 0"));
            entries.add(new LabelValueBean("Label 1", "Value 1"));
            entries.add(new LabelValueBean("Label 2", "Value 2"));
            entries.add(new LabelValueBean("Label 3", "Value 3"));
            entries.add(new LabelValueBean("Label 4", "Value 4"));
            entries.add(new LabelValueBean("Label 5", "Value 5"));
            entries.add(new LabelValueBean("Label 6", "Value 6"));
            entries.add(new LabelValueBean("Label 7", "Value 7"));
            entries.add(new LabelValueBean("Label 8", "Value 8"));
            entries.add(new LabelValueBean("Label 9", "Value 9"));

            beanCollection = entries;
        }

        return (beanCollection);
View Full Code Here

        colorList.add("Violet");
        request.setAttribute("colorCollection", colorList);

        /* A Collection of LabelValue beans */
        ArrayList days = new ArrayList();
        days.add(new LabelValueBean("Monday", "1"));
        days.add(new LabelValueBean("Tuesday", "2"));
        days.add(new LabelValueBean("Wednesday", "3"));
        days.add(new LabelValueBean("Thursday", "4"));
        days.add(new LabelValueBean("Friday", "5"));
        days.add(new LabelValueBean("Saturday", "6"));
        days.add(new LabelValueBean("Sunday", "7"));
        request.setAttribute("days", days);

        /* Collection of custom beans */
        ArrayList books = new ArrayList();
        books.add(new BookBean("0596003285", "Programming Jakarta Struts"));
View Full Code Here

     */
    protected void setupCache(ActionServlet servlet, ModuleConfig config) {

        // Set up list of server types under "serverTypes"
        ArrayList serverTypes = new ArrayList();
        serverTypes.add(new LabelValueBean("IMAP Protocol", "imap"));
        serverTypes.add(new LabelValueBean("POP3 Protocol", "pop3"));
        servlet.getServletContext().setAttribute("serverTypes", serverTypes);

    }
View Full Code Here

    */
    private static List initNames() {
       List lResults = new ArrayList();

       for (int i = 0; i < 3; i++) {
          lResults.add(new LabelValueBean(null, null));
       }

       return lResults;
    }
View Full Code Here

    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> shippingTypeList = new Vector<LabelValueBean>();
    while (iterator.hasNext()) {
      ShippingType shippingType = (ShippingType) iterator.next();
      LabelValueBean bean = new LabelValueBean(shippingType.getShippingTypeName(), shippingType.getShippingTypeId().toString());
      shippingTypeList.add(bean);
    }
    LabelValueBean shippingTypes[] = new LabelValueBean[shippingTypeList.size()];
    shippingTypeList.copyInto(shippingTypes);
    form.setShippingTypes(shippingTypes);
   
    String sql = "select   productClass " +
           "from     ProductClass productClass " +
           "left     join productClass.site site " +
           "where    site.siteId = :siteId " +
           "order    by productClass.productClassName ";  
    query = em.createQuery(sql);
    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> productClassList = new Vector<LabelValueBean>();
    while (iterator.hasNext()) {
      ProductClass productClass = (ProductClass) iterator.next();
      LabelValueBean bean = new LabelValueBean(productClass.getProductClassName(), productClass.getProductClassId().toString());;
      productClassList.add(bean);
    }
    LabelValueBean productClasses[] = new LabelValueBean[productClassList.size()];
    productClassList.copyInto(productClasses);
    form.setProductClasses(productClasses);
   
    sql = "select   customAttributeGroup " +
        "from     CustomAttributeGroup customAttributeGroup " +
          "left     join customAttributeGroup.site site " +
          "where    site.siteId = :siteId " +
          "order    by customAttributeGroup.customAttribGroupName";
    query = em.createQuery(sql);
    query.setParameter("siteId", adminBean.getSite().getSiteId());
    iterator = query.getResultList().iterator();
    Vector<LabelValueBean> customAttributesList = new Vector<LabelValueBean>();
    customAttributesList.add(new LabelValueBean("", ""));
    while (iterator.hasNext()) {
      CustomAttributeGroup customAttributeGroup = (CustomAttributeGroup) iterator.next();
      LabelValueBean bean = new LabelValueBean(customAttributeGroup.getCustomAttribGroupName(),
                           customAttributeGroup.getCustomAttribGroupId().toString());
      customAttributesList.add(bean);
    }
    LabelValueBean customAttributeGroups[] = new LabelValueBean[customAttributesList.size()];
    customAttributesList.copyInto(customAttributeGroups);
    form.setCustomAttributeGroups(customAttributeGroups);
   
    ItemAttributeDetailDisplayForm itemAttributeDetails[] = form.getItemAttributeDetails();
    if (itemAttributeDetails != null) {
      for (int i = 0; i < itemAttributeDetails.length; i++) {
        ItemAttributeDetailDisplayForm displayForm = itemAttributeDetails[i];
        CustomAttribute customAttribute = CustomAttributeDAO.load(site.getSiteId(), Format.getLong(displayForm.getCustomAttribId()));
        if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_INPUT) {
          continue;
        }
        if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_SELECT_DROPDOWN) {
          continue;
        }
        Vector<LabelValueBean> options = new Vector<LabelValueBean>();
        for (CustomAttributeOption customAttributeOption : customAttribute.getCustomAttributeOptions()) {
          String value = "";
          if (customAttribute.getCustomAttribDataTypeCode() == Constants.CUSTOM_ATTRIBUTE_DATA_TYPE_CURRENCY) {
            value = customAttributeOption.getCustomAttributeOptionCurrency().getCustomAttribValue();
            if (!form.isSiteCurrencyClassDefault()) {
              for (CustomAttributeOptionCurrency optionCurrency : customAttributeOption.getCustomAttributeOptionCurrencies()) {
                if (optionCurrency.getSiteCurrencyClass().getSiteCurrencyClassId().equals(siteCurrencyClassId)) {
                  if (optionCurrency.getCustomAttribValue() != null) {
                    value = optionCurrency.getCustomAttribValue();
                  }
                  break;
                }
              }
            }
          }
          else {
            value = customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue();
            if (!form.isSiteProfileClassDefault()) {
              for (CustomAttributeOptionLanguage optionLanguage : customAttributeOption.getCustomAttributeOptionLanguages()) {
                if (optionLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                  if (optionLanguage.getCustomAttribValue() != null) {
                    value = optionLanguage.getCustomAttribValue();
                  }
                  break;
                }
              }
            }
          }
          LabelValueBean option = new LabelValueBean(value, customAttributeOption.getCustomAttribOptionId().toString());
          options.add(option);
        }
        LabelValueBean customAttribOptions[] = new LabelValueBean[options.size()];
        options.copyInto(customAttribOptions);
        displayForm.setCustomAttribOptions(customAttribOptions);
      }
    }
   
    if (!form.getMode().equals(Constants.MODE_CREATE)) {
      sql = "select   itemTierPrice " +
          "from     ItemTierPrice itemTierPrice " +
          "left     join itemTierPrice.item item " +
          "left     join itemTierPrice.customerClass customerClass " +
          "where    item.itemId = :itemId " +
          "order    by customerClass.custClassName, itemTierPrice.itemTierQty";
      query = em.createQuery(sql);
      query.setParameter("itemId", item.getItemId());
      iterator = query.getResultList().iterator();
      Vector<ItemTierPriceDisplayForm> vector = new Vector<ItemTierPriceDisplayForm>();
      while (iterator.hasNext()) {
        ItemTierPrice itemTierPrice = (ItemTierPrice) iterator.next();
        ItemTierPriceDisplayForm priceForm = new ItemTierPriceDisplayForm();
        priceForm.setItemTierPriceId(itemTierPrice.getItemTierPriceId().toString());
        priceForm.setCustClassId("");
        if (itemTierPrice.getCustomerClass() != null) {
          priceForm.setCustClassId(itemTierPrice.getCustomerClass().getCustClassId().toString());
        }
        priceForm.setItemTierQty(itemTierPrice.getItemTierQty().toString());
        priceForm.setItemTierPrice(Format.getFloat(itemTierPrice.getItemTierPriceCurrency().getItemPrice()));
        priceForm.setItemTierPricePublishOn(Format.getDate(itemTierPrice.getItemTierPricePublishOn()));
        priceForm.setItemTierPriceExpireOn(Format.getDate(itemTierPrice.getItemTierPriceExpireOn()));
        vector.add(priceForm);
      }
      ItemTierPriceDisplayForm itemTierPrices[] = new ItemTierPriceDisplayForm[vector.size()];
      vector.copyInto(itemTierPrices);
      form.setItemTierPrices(itemTierPrices);
    }
   
    Vector<LabelValueBean> siteDomainList = new Vector<LabelValueBean>();
    for (SiteDomain siteDomain : site.getSiteDomains()) {
      siteDomainList.add(new LabelValueBean(siteDomain.getSiteDomainLanguage().getSiteName(), siteDomain.getSiteDomainId().toString()));
    }
    LabelValueBean siteDomains[] = new LabelValueBean[siteDomainList.size()];
    siteDomainList.copyInto(siteDomains);
    form.setSiteDomains(siteDomains);
   
    form.setShareInventory(false);
    if (site.getShareInventory() == Constants.VALUE_YES) {
View Full Code Here

TOP

Related Classes of org.apache.struts.util.LabelValueBean

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.