Package net.sourceforge.processdash.ui.snippet

Examples of net.sourceforge.processdash.ui.snippet.SnippetPageFilter


    private void applySnippetFilters(PageContentTO page, String mode) {
        Map<SnippetInstanceTO, SnippetPageFilter> filters = null;
        for (Iterator i = page.getSnippets().iterator(); i.hasNext();) {
            SnippetInstanceTO snip = (SnippetInstanceTO) i.next();
            SnippetDefinition def = snip.getDefinition();
            SnippetPageFilter filter = null;

            try {
                if (def != null)
                    filter = def.getFilter(mode, null);
            } catch (Exception e) {
                logger.log(Level.SEVERE,
                    "Unable to create page filter for snippet '"
                            + snip.getSnippetID() + "'", e);
            }

            if (filter != null) {
                if (filters == null)
                    filters = new LinkedHashMap();
                filters.put(snip, filter);
            }
        }

        if (filters != null) {
            // if any filters were found, run them all against the page.
            for (Map.Entry<SnippetInstanceTO, SnippetPageFilter> e : filters
                    .entrySet()) {
                SnippetInstanceTO snip = e.getKey();
                SnippetPageFilter f = e.getValue();
                try {
                    f.filter(page, snip, mode);
                } catch (Exception ex) {
                    logger.log(Level.SEVERE, "Snippet page filter '"
                            + snip.getSnippetID()
                            + "' encountered an exception while running.", ex);
                }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.ui.snippet.SnippetPageFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.