Package com.cosmo.data.lists

Examples of com.cosmo.data.lists.ListItem


    *
    * @param keyvalue Una instancia de {@link KeyValue} que contiene el par clave/valor a agregar.
    */
   public void addListOption(KeyValue keyvalue)
   {
      this.list.addListItem(new ListItem(keyvalue.getKey(),
                                         keyvalue.getValue().toString(),
                                         keyvalue.isDefaultOption()));
   }
View Full Code Here


      NodeList listDefs;
      Element listElement;
      Element attribElement;
      StaticList sList = null;
      DynamicList dList = null;
      ListItem item;

      // Inicializa el contenedor de listas
      HashMap<String, List> lists = new HashMap<String, List>();

      // Comprueba si existe la definici�n
      attribList = doc.getElementsByTagName(DataServiceProperties.XML_TAG_DATALISTS);
      if (attribList.getLength() < 1)
      {
         return lists;
      }

      // Carga las listas est�ticas
      listDefs = doc.getElementsByTagName(DataServiceProperties.XML_TAG_STATICLIST);
      for (int pidx = 0; pidx < listDefs.getLength(); pidx++)
      {
         listNode = listDefs.item(pidx);
         if (listNode.getNodeType() == Node.ELEMENT_NODE)
         {
            listElement = (Element) listNode;

            sList = new StaticList(listElement.getAttribute(DataServiceProperties.XML_ATT_ID));

            attribList = listElement.getElementsByTagName(DataServiceProperties.XML_TAG_STATICLISTITEM);
            for (int aidx = 0; aidx < attribList.getLength(); aidx++)
            {
               attribNode = attribList.item(aidx);
               if (attribNode.getNodeType() == Node.ELEMENT_NODE)
               {
                  attribElement = (Element) attribNode;
                  item = new ListItem(attribElement.getAttribute(DataServiceProperties.XML_ATT_VALUE),
                                      attribElement.getAttribute(DataServiceProperties.XML_ATT_TITLE));

                  if (!StringUtils.isNullOrEmptyTrim(attribElement.getAttribute(DataServiceProperties.XML_ATT_DEFAULTVALUE)))
                  {
                     item.setDefault(attribElement.getAttribute(DataServiceProperties.XML_ATT_DEFAULTVALUE).equals("true") ||
                                     attribElement.getAttribute(DataServiceProperties.XML_ATT_DEFAULTVALUE).equals("1"));
                  }

                  sList.addListItem(item);
               }
View Full Code Here

TOP

Related Classes of com.cosmo.data.lists.ListItem

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.