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


Java Entry.isView方法代码示例

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


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

示例1: getForm

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
public String getForm() {
    if (this.currentXmlns != null) {
        return this.currentXmlns;
    }
    String command = getCommand();
    if (command == null) {
        return null;
    }

    Entry e = platform.getMenuMap().get(command);
    if (e.isView() || e.isSync()) {
        return null;
    } else {
        return ((FormEntry)e).getXFormNamespace();
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:17,代码来源:CommCareSession.java

示例2: IncompleteFormListAdapter

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
public IncompleteFormListAdapter(Context context,
                                 AndroidCommCarePlatform platform,
                                 FormRecordLoaderTask loader) {
    this.context = context;
    this.filter = null;
    this.loader = loader;

    loader.addListener(this);

    // create a mapping from form definition IDs to their entry point text
    for (Suite s : platform.getInstalledSuites()) {
        for (Enumeration en = s.getEntries().elements(); en.hasMoreElements(); ) {
            Entry entry = (Entry) en.nextElement();
            if (!(entry.isView() || entry.isRemoteRequest())) {
                String namespace = ((FormEntry)entry).getXFormNamespace();
                //Some of our old definitions for views still come in as entries with dead
                //namespaces for now, so check. Can clean up when FormEntry's enforce a
                //namespace invariant
                if(namespace != null) {
                    names.put(namespace, entry.getText());
                }
            }
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:26,代码来源:IncompleteFormListAdapter.java

示例3: getForm

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
public String getForm() {
    if (this.currentXmlns != null) {
        return this.currentXmlns;
    }
    String command = getCommand();
    if (command == null) {
        return null;
    }

    Entry e = platform.getMenuMap().get(command);
    if (e.isView() || e.isRemoteRequest()) {
        return null;
    } else {
        return ((FormEntry)e).getXFormNamespace();
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:17,代码来源:CommCareSession.java

示例4: RecentFormEntity

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
public RecentFormEntity(Vector<Suite> suites) {
    names = new Hashtable<String,Text>();
    for(Suite s : suites) {
        for(Enumeration en = s.getEntries().elements(); en.hasMoreElements() ;) {
            Entry entry = (Entry)en.nextElement();
            if(!entry.isView()) {
                names.put(((FormEntry)entry).getXFormNamespace(),entry.getText());
            }
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:12,代码来源:RecentFormEntity.java

示例5: print

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
private void print(Suite s, Entry e, int level) {
    String head = "";
    String emptyhead = "";
    for(int i = 0; i < level; ++i ){
        head +=      "|- ";
        emptyhead += "   ";
    }
    if (e.isView()) {
        print.println(head + "View: " + e.getText().evaluate());
    } else {
        print.println(head + "Entry: " + e.getText().evaluate());
    }
    for(SessionDatum datum : e.getSessionDataReqs()) {
        if(datum instanceof FormIdDatum) {
            print.println(emptyhead + "Form: " + datum.getValue());
        } else if (datum instanceof EntityDatum) {
            String shortDetailId = ((EntityDatum)datum).getShortDetail();
            if(shortDetailId != null) {
                Detail d = s.getDetail(shortDetailId);
                try {
                    print.println(emptyhead + "|Select: " + d.getTitle().getText().evaluate(new EvaluationContext(null)));
                } catch(XPathMissingInstanceException ex) {
                    print.println(emptyhead + "|Select: " + "(dynamic title)");
                }
                print.print(emptyhead + "| ");
                for(DetailField f : d.getFields()) {
                    print.print(f.getHeader().evaluate() + " | ");
                }
                print.print("\n");
            }
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:34,代码来源:CommCareConfigEngine.java

示例6: print

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
private void print(Suite s, Entry e, int level) {
    String head = "";
    String emptyhead = "";
    for (int i = 0; i < level; ++i) {
        head += "|- ";
        emptyhead += "   ";
    }
    if (e.isView()) {
        print.println(head + "View: " + e.getText().evaluate());
    } else {
        print.println(head + "Entry: " + e.getText().evaluate());
    }
    for (SessionDatum datum : e.getSessionDataReqs()) {
        if (datum instanceof FormIdDatum) {
            print.println(emptyhead + "Form: " + datum.getValue());
        } else if (datum instanceof EntityDatum) {
            String shortDetailId = ((EntityDatum)datum).getShortDetail();
            if (shortDetailId != null) {
                Detail d = s.getDetail(shortDetailId);
                try {
                    print.println(emptyhead + "|Select: " + d.getTitle().getText().evaluate(new EvaluationContext(null)));
                } catch (XPathMissingInstanceException ex) {
                    print.println(emptyhead + "|Select: " + "(dynamic title)");
                }
                print.print(emptyhead + "| ");
                for (DetailField f : d.getFields()) {
                    print.print(f.getHeader().evaluate() + " | ");
                }
                print.print("\n");
            }
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:34,代码来源:CommCareConfigEngine.java

示例7: mockEasiestRoute

import org.commcare.suite.model.Entry; //导入方法依赖的package包/类
public static AndroidSessionWrapper mockEasiestRoute(CommCarePlatform platform, String formNamespace, String selectedValue) {
    AndroidSessionWrapper wrapper = null;
    int curPredicates = -1;

    Hashtable<String, Entry> menuMap = platform.getMenuMap();
    for (String key : menuMap.keySet()) {
        Entry e = menuMap.get(key);
        if (!(e.isView() || e.isRemoteRequest()) && formNamespace.equals(((FormEntry)e).getXFormNamespace())) {
            //We have an entry. Don't worry too much about how we're supposed to get there for now.

            //The ideal is that we only need one piece of data
            if (e.getSessionDataReqs().size() == 1) {
                //This should fit the bill. Single selection.
                SessionDatum datum = e.getSessionDataReqs().firstElement();
                // we only know how to mock a single case selection
                if (datum instanceof ComputedDatum) {
                    // Allow mocking of routes that need computed data, useful for case creation forms
                    wrapper = new AndroidSessionWrapper(platform);
                    wrapper.session.setCommand(platform.getModuleNameForEntry((FormEntry) e));
                    wrapper.session.setCommand(e.getCommandId());
                    wrapper.session.setComputedDatum(wrapper.getEvaluationContext());
                } else if (datum instanceof EntityDatum) {
                    EntityDatum entityDatum = (EntityDatum)datum;
                    //The only thing we need to know now is whether we have a better option available
                    int countPredicates = CommCareUtil.countPreds(entityDatum.getNodeset());

                    if (wrapper == null) {
                        //No previous value! Yay.
                        //Record the degree of specificity of this selection for now (we'll
                        //actually create the wrapper later
                        curPredicates = countPredicates;
                    } else {
                        //There's already a path to this form. Only keep going
                        //if the current choice is less specific
                        if (countPredicates >= curPredicates) {
                            continue;
                        }
                    }

                    wrapper = new AndroidSessionWrapper(platform);
                    wrapper.session.setCommand(platform.getModuleNameForEntry((FormEntry) e));
                    wrapper.session.setCommand(e.getCommandId());
                    wrapper.session.setDatum(entityDatum.getDataId(), selectedValue);
                }
            }

            //We don't really have a good thing to do with this yet. For now, just
            //hope there's another easy path to this form
        }
    }

    return wrapper;
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:54,代码来源:AndroidSessionWrapper.java


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