Exemplo n.º 1
0
        public virtual void testRefContentData()
        {
            for (int i = 0; i < 10; i++)
            {
                Assert.AreEqual(i, cl.appendContentData().getIndex());
            }
            JDFContentData cd = cl.appendContentData();
            JDFPageData    pd = pl.appendPageData();

            pd.refContentData(cd);
            Assert.AreEqual(10, pd.getPageElement(0).getContentListIndex());
        }
Exemplo n.º 2
0
        ///
        ///	 * <returns> the index of this in the parent contentList, -1 if this is not in
        ///	 *         a cl </returns>
        ///
        public virtual int getIndex()
        {
            KElement parent = getParentNode_KElement();

            if (parent == null || !(parent is JDFContentList))
            {
                return(-1);
            }
            JDFContentList cl = (JDFContentList)parent;
            int            n  = 0;
            JDFContentData cd = cl.getContentData(0);

            while (cd != null)
            {
                if (cd == this)
                {
                    return(n);
                }
                n++;
                cd = (JDFContentData)cd.getNextSiblingElement(ElementName.CONTENTDATA, null);
            }
            return(-1);
        }
Exemplo n.º 3
0
        /// <summary>
        /// refContentData
        /// </summary>
        /// <param name="letter"></param>
        public virtual void refContentData(JDFContentData letter)
        {
            JDFPageElement pe = appendPageElement();

            pe.setContentListIndex(letter.getIndex());
        }