001package com.hfg.xml.msofficexml.docx.wordprocessingml;
002
003
004import com.hfg.xml.XMLTag;
005import com.hfg.xml.msofficexml.docx.DocxException;
006
007public class WmlListProperties extends XMLTag
008{
009   private XMLTag mLevelTag;
010
011   //---------------------------------------------------------------------------
012   public WmlListProperties()
013   {
014      super(WmlXML.PARAGRAPH_PROPS);
015   }
016
017   //---------------------------------------------------------------------------
018
019   /**
020    * Specifies the list level of the items to follow.
021    * @param inValue (0 to 8)
022    */
023   public WmlListProperties setLevel(int inValue)
024   {
025      if (inValue < 0 || inValue > 8)
026      {
027         throw new DocxException("Invalid list level [" + inValue + "]! Vaild values: 0 - 8.");
028      }
029
030      if (null == mLevelTag)
031      {
032         mLevelTag = new XMLTag(WmlXML.ITEM_LEVEL);
033         addSubtag(mLevelTag);
034      }
035
036      mLevelTag.setAttribute(WmlXML.VALUE, inValue);
037
038      return this;
039   }
040}