Search in sources :

Example 1 with SnippetInstanceTO

use of net.sourceforge.processdash.net.cms.SnippetInstanceTO in project processdash by dtuma.

the class ProcessAdvisor method getAdvisorSnippets.

/**
     * @param pageRegion
     * @return a list of all snippets in the "advice" category
     */
private static List getAdvisorSnippets(int pageRegion) {
    List result = new ArrayList();
    Set snippets = SnippetDefinitionManager.getAllSnippets();
    for (Iterator i = snippets.iterator(); i.hasNext(); ) {
        SnippetDefinition snipDef = (SnippetDefinition) i.next();
        if (snipDef.matchesCategory(ADVISOR_SNIPPET_CATEGORY)) {
            SnippetInstanceTO snip = new SnippetInstanceTO();
            snip.setSnippetID(snipDef.getId());
            snip.setDefinition(snipDef);
            snip.setPageRegion(pageRegion);
            result.add(snip);
        }
    }
    return result;
}
Also used : Set(java.util.Set) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) SnippetInstanceTO(net.sourceforge.processdash.net.cms.SnippetInstanceTO) SnippetDefinition(net.sourceforge.processdash.ui.snippet.SnippetDefinition)

Example 2 with SnippetInstanceTO

use of net.sourceforge.processdash.net.cms.SnippetInstanceTO in project processdash by dtuma.

the class ProcessAdvisor method getAdvisorSnippets.

/**
     * @param pageRegion
     * @return a list of all snippets in the "advice" category
     */
private static List getAdvisorSnippets(int pageRegion) {
    List result = new ArrayList();
    Set snippets = SnippetDefinitionManager.getAllSnippets();
    for (Iterator i = snippets.iterator(); i.hasNext(); ) {
        SnippetDefinition snipDef = (SnippetDefinition) i.next();
        if (snipDef.matchesCategory(ADVISOR_SNIPPET_CATEGORY)) {
            SnippetInstanceTO snip = new SnippetInstanceTO();
            snip.setSnippetID(snipDef.getId());
            snip.setDefinition(snipDef);
            snip.setPageRegion(pageRegion);
            result.add(snip);
        }
    }
    return result;
}
Also used : Set(java.util.Set) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) SnippetInstanceTO(net.sourceforge.processdash.net.cms.SnippetInstanceTO) SnippetDefinition(net.sourceforge.processdash.ui.snippet.SnippetDefinition)

Aggregations

ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Set (java.util.Set)2 SnippetInstanceTO (net.sourceforge.processdash.net.cms.SnippetInstanceTO)2 SnippetDefinition (net.sourceforge.processdash.ui.snippet.SnippetDefinition)2