Exemplo n.º 1
0
        /**
         * Returns a hierarchical list of FormEntryCaption objects for the given
         * FormIndex
         *
         * @param index
         * @return list of FormEntryCaptions in hierarchical order
         */
        public FormEntryCaption[] getCaptionHierarchy(FormIndex index)
        {
            List <FormEntryCaption> captions = new List <FormEntryCaption>();
            FormIndex remaining = index;

            while (remaining != null)
            {
                remaining = remaining.getNextLevel();
                FormIndex    localIndex = index.diff(remaining);
                IFormElement element    = form.getChild(localIndex);
                if (element != null)
                {
                    FormEntryCaption caption = null;
                    if (element is GroupDef)
                    {
                        caption = new FormEntryCaption(getForm(), localIndex);
                    }
                    else if (element is QuestionDef)
                    {
                        caption = new FormEntryPrompt(getForm(), localIndex);
                    }

                    if (caption != null)
                    {
                        captions.Add(caption);
                    }
                }
            }
            FormEntryCaption[] captionArray = new FormEntryCaption[captions.Count];
            captions.CopyTo(captionArray);
            return(captionArray);
        }
Exemplo n.º 2
0
        /// <summary> Returns a hierarchical list of FormEntryCaption objects for the given
        /// FormIndex
        ///
        /// </summary>
        /// <param name="index">
        /// </param>
        /// <returns> list of FormEntryCaptions in hierarchical order
        /// </returns>
        public virtual FormEntryCaption[] getCaptionHierarchy(FormIndex index)
        {
            List <FormEntryCaption> captions = new List <FormEntryCaption>();
            FormIndex remaining = index;

            while (remaining != null)
            {
                remaining = remaining.NextLevel;
                FormIndex    localIndex = index.diff(remaining);
                IFormElement element    = form.getChild(localIndex);
                if (element != null)
                {
                    FormEntryCaption caption = null;
                    if (element is GroupDef)
                    {
                        caption = new FormEntryCaption(Form, localIndex);
                    }
                    else if (element is QuestionDef)
                    {
                        caption = new FormEntryPrompt(Form, localIndex);
                    }

                    if (caption != null)
                    {
                        captions.addElement(caption);
                    }
                }
            }
            FormEntryCaption[] captionArray = new FormEntryCaption[captions.size()];
            captions.copyInto(captionArray);
            return(captionArray);
        }
Exemplo n.º 3
0
 private void  InitBlock(FormEntryCaption enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Exemplo n.º 4
0
 public RepeatOptions(FormEntryCaption enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
Exemplo n.º 5
0
        public Boolean isIndexCompoundContainer(FormIndex index)
        {
            FormEntryCaption caption = getCaptionPrompt(index);

            return(getEvent(index) == FormEntryController.EVENT_GROUP && caption.getAppearanceHint() != null && caption.getAppearanceHint().ToLower().Equals("full"));
        }