当前位置: 首页>>代码示例>>Java>>正文


Java FormIndex.isEndOfFormIndex方法代码示例

本文整理汇总了Java中org.javarosa.core.model.FormIndex.isEndOfFormIndex方法的典型用法代码示例。如果您正苦于以下问题:Java FormIndex.isEndOfFormIndex方法的具体用法?Java FormIndex.isEndOfFormIndex怎么用?Java FormIndex.isEndOfFormIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javarosa.core.model.FormIndex的用法示例。


在下文中一共展示了FormIndex.isEndOfFormIndex方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isIndexReadonly

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
/**
 * @param index
 * @return true if the element at the specified index is read only
 */
public boolean isIndexReadonly(FormIndex index) {
    if (index.isBeginningOfFormIndex() || index.isEndOfFormIndex())
        return true;

    TreeReference ref = form.getChildInstanceRef(index);
    boolean isAskNewRepeat = (getEvent(index) == FormEntryController.EVENT_PROMPT_NEW_REPEAT ||
    						  getEvent(index) == FormEntryController.EVENT_REPEAT_JUNCTURE);

    if (isAskNewRepeat) {
        return false;
    } else {
        TreeElement node = form.getMainInstance().resolveReference(ref);
        return !node.isEnabled();
    }
}
 
开发者ID:medic,项目名称:javarosa,代码行数:20,代码来源:FormEntryModel.java

示例2: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
     List<Integer> indexes = new ArrayList<Integer>();
     List<Integer> multiplicities = new ArrayList<Integer>();
     List<IFormElement> elements = new ArrayList<IFormElement>();

	if (index.isEndOfFormIndex()) {
		return index;
	} else if (index.isBeginningOfFormIndex()) {
		if (form.getChildren() == null || form.getChildren().size() == 0) {
			return FormIndex.createEndOfFormIndex();
		}
	} else {
		form.collapseIndex(index, indexes, multiplicities, elements);
	}

	incrementHelper(indexes, multiplicities, elements, descend);

	if (indexes.size() == 0) {
		return FormIndex.createEndOfFormIndex();
	} else {
		return form.buildIndex(indexes, multiplicities, elements);
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:24,代码来源:FormEntryModel.java

示例3: decrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex decrementIndex(FormIndex index) {
     List<Integer> indexes = new ArrayList<Integer>();
     List<Integer> multiplicities = new ArrayList<Integer>();
     List<IFormElement> elements = new ArrayList<IFormElement>();

	if (index.isBeginningOfFormIndex()) {
		return index;
	} else if (index.isEndOfFormIndex()) {
		if (form.getChildren() == null || form.getChildren().size() == 0) {
			return FormIndex.createBeginningOfFormIndex();
		}
	} else {
		form.collapseIndex(index, indexes, multiplicities, elements);
	}

	decrementHelper(indexes, multiplicities, elements);

	if (indexes.size() == 0) {
		return FormIndex.createBeginningOfFormIndex();
	} else {
		return form.buildIndex(indexes, multiplicities, elements);
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:24,代码来源:FormEntryModel.java

示例4: isIndexReadonly

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
/**
 * @return true if the element at the specified index is read only
 */
public boolean isIndexReadonly(FormIndex index) {
    if (index.isBeginningOfFormIndex() || index.isEndOfFormIndex())
        return true;

    TreeReference ref = form.getChildInstanceRef(index);
    boolean isAskNewRepeat = (getEvent(index) == FormEntryController.EVENT_PROMPT_NEW_REPEAT ||
            getEvent(index) == FormEntryController.EVENT_REPEAT_JUNCTURE);

    if (isAskNewRepeat) {
        return false;
    } else {
        TreeElement node = form.getMainInstance().resolveReference(ref);
        return !node.isEnabled();
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:19,代码来源:FormEntryModel.java

示例5: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
    Vector indexes = new Vector();
    Vector multiplicities = new Vector();
    Vector elements = new Vector();

    if (index.isEndOfFormIndex()) {
        return index;
    } else if (index.isBeginningOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createEndOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    incrementHelper(indexes, multiplicities, elements, descend);

    if (indexes.size() == 0) {
        return FormIndex.createEndOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:24,代码来源:FormEntryModel.java

示例6: decrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex decrementIndex(FormIndex index) {
    Vector indexes = new Vector();
    Vector multiplicities = new Vector();
    Vector elements = new Vector();

    if (index.isBeginningOfFormIndex()) {
        return index;
    } else if (index.isEndOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createBeginningOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    decrementHelper(indexes, multiplicities, elements);

    if (indexes.size() == 0) {
        return FormIndex.createBeginningOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:24,代码来源:FormEntryModel.java

示例7: getEvent

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
/**
 * Given a FormIndex, returns the event this FormIndex represents.
 *
 * @see FormEntryController
 */
public int getEvent(FormIndex index) {
    if (index.isBeginningOfFormIndex()) {
        return FormEntryController.EVENT_BEGINNING_OF_FORM;
    } else if (index.isEndOfFormIndex()) {
        return FormEntryController.EVENT_END_OF_FORM;
    }

    IFormElement element = form.getChild(index);
    if (element instanceof GroupDef) {
        if (((GroupDef)element).isRepeat()) {
            if (repeatStructure != REPEAT_STRUCTURE_NON_LINEAR && form.getMainInstance().resolveReference(form.getChildInstanceRef(index)) == null) {
                return FormEntryController.EVENT_PROMPT_NEW_REPEAT;
            } else if (repeatStructure == REPEAT_STRUCTURE_NON_LINEAR && index.getElementMultiplicity() == TreeReference.INDEX_REPEAT_JUNCTURE) {
                return FormEntryController.EVENT_REPEAT_JUNCTURE;
            } else {
                return FormEntryController.EVENT_REPEAT;
            }
        } else {
            return FormEntryController.EVENT_GROUP;
        }
    } else {
        return FormEntryController.EVENT_QUESTION;
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:30,代码来源:FormEntryModel.java

示例8: incrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex incrementIndex(FormIndex index, boolean descend) {
    Vector<Integer> indexes = new Vector<>();
    Vector<Integer> multiplicities = new Vector<>();
    Vector<IFormElement> elements = new Vector<>();

    if (index.isEndOfFormIndex()) {
        return index;
    } else if (index.isBeginningOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createEndOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    incrementHelper(indexes, multiplicities, elements, descend);

    if (indexes.size() == 0) {
        return FormIndex.createEndOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:24,代码来源:FormEntryModel.java

示例9: decrementIndex

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
public FormIndex decrementIndex(FormIndex index) {
    Vector<Integer> indexes = new Vector<>();
    Vector<Integer> multiplicities = new Vector<>();
    Vector<IFormElement> elements = new Vector<>();

    if (index.isBeginningOfFormIndex()) {
        return index;
    } else if (index.isEndOfFormIndex()) {
        if (form.getChildren() == null || form.getChildren().size() == 0) {
            return FormIndex.createBeginningOfFormIndex();
        }
    } else {
        form.collapseIndex(index, indexes, multiplicities, elements);
    }

    decrementHelper(indexes, multiplicities, elements);

    if (indexes.size() == 0) {
        return FormIndex.createBeginningOfFormIndex();
    } else {
        return form.buildIndex(indexes, multiplicities, elements);
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:24,代码来源:FormEntryModel.java

示例10: getEvent

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
/**
 * Given a FormIndex, returns the event this FormIndex represents.
 *
 * @see FormEntryController
 */
public int getEvent(FormIndex index) {
    if (index.isBeginningOfFormIndex()) {
        return FormEntryController.EVENT_BEGINNING_OF_FORM;
    } else if (index.isEndOfFormIndex()) {
        return FormEntryController.EVENT_END_OF_FORM;
    }

    // This came from chatterbox, and is unclear how correct it is,
    // commented out for now.
    // DELETEME: If things work fine
    // List defs = form.explodeIndex(index);
    // IFormElement last = (defs.size() == 0 ? null : (IFormElement)
    // defs.lastElement());
    IFormElement element = form.getChild(index);
    if (element instanceof GroupDef) {
        if (((GroupDef) element).getRepeat()) {
            if (repeatStructure != REPEAT_STRUCTURE_NON_LINEAR && form.getMainInstance().resolveReference(form.getChildInstanceRef(index)) == null) {
                return FormEntryController.EVENT_PROMPT_NEW_REPEAT;
            } else if (repeatStructure == REPEAT_STRUCTURE_NON_LINEAR && index.getElementMultiplicity() == TreeReference.INDEX_REPEAT_JUNCTURE) {
            	return FormEntryController.EVENT_REPEAT_JUNCTURE;
            } else {
                return FormEntryController.EVENT_REPEAT;
            }
        } else {
            return FormEntryController.EVENT_GROUP;
        }
    } else {
        return FormEntryController.EVENT_QUESTION;
    }
}
 
开发者ID:medic,项目名称:javarosa,代码行数:36,代码来源:FormEntryModel.java

示例11: getEvent

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
/**
 * Given a FormIndex, returns the event this FormIndex represents.
 *
 * @see FormEntryController
 */
public int getEvent(FormIndex index) {
    if (index.isBeginningOfFormIndex()) {
        return FormEntryController.EVENT_BEGINNING_OF_FORM;
    } else if (index.isEndOfFormIndex()) {
        return FormEntryController.EVENT_END_OF_FORM;
    }

    // This came from chatterbox, and is unclear how correct it is,
    // commented out for now.
    // DELETEME: If things work fine
    // Vector defs = form.explodeIndex(index);
    // IFormElement last = (defs.size() == 0 ? null : (IFormElement)
    // defs.lastElement());
    IFormElement element = form.getChild(index);
    if (element instanceof GroupDef) {
        if (((GroupDef)element).getRepeat()) {
            if (repeatStructure != REPEAT_STRUCTURE_NON_LINEAR && form.getMainInstance().resolveReference(form.getChildInstanceRef(index)) == null) {
                return FormEntryController.EVENT_PROMPT_NEW_REPEAT;
            } else if (repeatStructure == REPEAT_STRUCTURE_NON_LINEAR && index.getElementMultiplicity() == TreeReference.INDEX_REPEAT_JUNCTURE) {
                return FormEntryController.EVENT_REPEAT_JUNCTURE;
            } else {
                return FormEntryController.EVENT_REPEAT;
            }
        } else {
            return FormEntryController.EVENT_GROUP;
        }
    } else {
        return FormEntryController.EVENT_QUESTION;
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:36,代码来源:FormEntryModel.java

示例12: checkModel

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
private void checkModel(FormEntryModel model, StringBuilder fieldErrors)
{
	FormIndex index = model.getFormIndex();
	while(!index.isEndOfFormIndex())
	{
		int event = model.getEvent(index);
		if(event != FormEntryController.EVENT_QUESTION)
		{
			index = model.incrementIndex(index);
			continue;
		}
		FormEntryPrompt prompt = model.getQuestionPrompt(index);
		final int dataType = prompt.getDataType();
		switch(dataType)
		{
			case org.javarosa.core.model.Constants.DATATYPE_TEXT:
				case org.javarosa.core.model.Constants.DATATYPE_DATE:
				case org.javarosa.core.model.Constants.DATATYPE_CHOICE:
				case org.javarosa.core.model.Constants.DATATYPE_INTEGER:
				case org.javarosa.core.model.Constants.DATATYPE_DECIMAL:
			case org.javarosa.core.model.Constants.DATATYPE_LONG:
				case org.javarosa.core.model.Constants.DATATYPE_TIME:
				case org.javarosa.core.model.Constants.DATATYPE_BOOLEAN:
					break;

				//Unsupported DataType's below
				case org.javarosa.core.model.Constants.DATATYPE_BARCODE:
					addFieldTypeNotSupported("BARCODE", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_BINARY:
					addFieldTypeNotSupported("BINARY", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_CHOICE_LIST:
					addFieldTypeNotSupported("CHOICE_LIST", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_DATE_TIME:
					addFieldTypeNotSupported("DATE_TIME", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_GEOPOINT:
					addFieldTypeNotSupported("GEOPOINT", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_GEOSHAPE:
					addFieldTypeNotSupported("GEOSHAPE", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_GEOTRACE:
					addFieldTypeNotSupported("GEOTRACE", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_NULL:
					addFieldTypeNotSupported("NULL", fieldErrors, prompt);
					break;
				case org.javarosa.core.model.Constants.DATATYPE_UNSUPPORTED:
					addFieldTypeNotSupported("UNSUPPORTED", fieldErrors, prompt);
					break;
				default:
					addFieldTypeNotSupported("UNKNOWN", fieldErrors, prompt);
					break;
           	
		}
		index = model.incrementIndex(index);
	}
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:62,代码来源:ObtainXFormController.java

示例13: populateEntries

import org.javarosa.core.model.FormIndex; //导入方法依赖的package包/类
private void populateEntries() {
    Vector<Entry> entriesVec = new Vector<Entry>();
    FormIndex index = FormIndex.createBeginningOfFormIndex();
    FormDef form = model.getForm();

    int prevDepth = 0;

    while (!index.isEndOfFormIndex()) {
        if (index.isInForm() && model.isIndexRelevant(index)) {
            String text = "";
            boolean isHeader = false;
            Image img = null;
            if (model.getEvent(index) == FormEntryController.EVENT_QUESTION) {
                FormEntryPrompt prompt = model.getQuestionPrompt(index);
                text = getText(prompt);
            } else if (model.getEvent(index) == FormEntryController.EVENT_PROMPT_NEW_REPEAT) {
                FormEntryCaption[] hierachy = model.getCaptionHierarchy(index);
                text = "Add "
                        + (index.getElementMultiplicity() == 0 ? "a "
                                : "another ")
                        + hierachy[hierachy.length - 1].getLongText() + "?";
                try {
                    img = Image.createImage(Localization.get("plussign"));
                } catch (IOException ioe) {
                    img = null;
                    Logger.exception(ioe);
                }
            } else if ((model.getEvent(index) == FormEntryController.EVENT_GROUP)
                    || (model.getEvent(index) == FormEntryController.EVENT_REPEAT)) {
                text = getHeaderText(model.getCaptionHierarchy(index));
                isHeader = true;
            }
            if (!text.equals("")) {
                Style style = isHeader ? StyleSheet
                        .getStyle(Constants.STYLE_HEADER) : StyleSheet
                        .getStyle(Constants.STYLE_PROMPT);
                String spacer="";
                int i = isHeader?-1:0;
                while (i < index.getDepth() - 2) {
                    //ctsims : Huh?
                    //spacer = "――" + spacer;
                    spacer = "> > " + spacer;
                    i++;
                }
                text=img==null?spacer+text:text;
                entriesVec.addElement(new Entry(text, img, style, index));
            }
        }
        prevDepth = index.getDepth();
        index = model.incrementIndex(index);
    }
    entries = new Entry[entriesVec.size()];
    entriesVec.copyInto(entries);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:55,代码来源:FormSummaryView.java


注:本文中的org.javarosa.core.model.FormIndex.isEndOfFormIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。