Package org.erlide.cover.views.model

Examples of org.erlide.cover.views.model.FunctionStats


        if (selection instanceof ModuleStats) {
            final ModuleStats module = (ModuleStats) selection;
            final String name = module.getLabel() + ".erl";
            marker.removeAnnotationsFromFile(name);
        } else if (selection instanceof FunctionStats) {
            final FunctionStats fs = (FunctionStats) selection;
            final ModuleStats module = (ModuleStats) fs.getParent();
            final String name = module.getLabel() + ".erl";

            log.info(fs.getLineStart());
            log.info(fs.getLineEnd());

            marker.removeAnnotationsFragment(name, fs.getLineStart(), fs.getLineEnd());

        } else {
            marker.clearAllAnnotations();
        }
    }
View Full Code Here


            if (ifMarkAnnotations(module)) {
                module.couldBeMarked = true;
                marker.addAnnotationsToFile(name);
            }
        } else if (selection instanceof FunctionStats) {
            final FunctionStats fs = (FunctionStats) selection;
            final ModuleStats module = (ModuleStats) fs.getParent();
            final String name = module.getLabel() + ".erl";

            if (ifMarkAnnotations(module)) {
                log.info(fs.getLineStart());
                log.info(fs.getLineEnd());
                module.couldBeMarked = true;
                marker.addAnnotationsFragment(name, fs.getLineStart(), fs.getLineEnd());
            }

        } else if (selection.equals(StatsTreeModel.getInstance().getRoot())) {
            // TODO: check annotation tree, only if root mark all annotations
            final Collection<ICoverageObject> col = selection.getModules();
View Full Code Here

            openInEditor(obj.getLabel() + ".erl");

        } else if (obj.getClass().equals(FunctionStats.class)) {

            final FunctionStats fs = (FunctionStats) obj;

            final String moduleName = ((StatsTreeObject) fs.getParent()).getLabel();
            final IEditorPart p = openInEditor(moduleName + ".erl");

            if (p == null || !(p instanceof ErlangEditor)) {
                return;
            }

            final ErlangEditor editor = (ErlangEditor) p;

            IErlModule module;
            try {
                module = ErlangEngine.getInstance().getModel().findModule(moduleName);

                final IErlFunction f = module.findFunction(new ErlangFunction(fs
                        .getLabel(), fs.getArity()));

                editor.setSelection(f);

            } catch (final ErlModelException e) {
                ErlLogger.error(e);
View Full Code Here

        final Iterator<OtpErlangObject> it = funcList.iterator();

        while (it.hasNext()) {
            final OtpErlangTuple res = (OtpErlangTuple) it.next();

            final FunctionStats func = new FunctionStats();

            final String name = res.elementAt(1).toString();
            final int arity = Integer.parseInt(res.elementAt(2).toString());
            final int allLines = Integer.parseInt(res.elementAt(3).toString());
            final int coveredLines = Integer.parseInt(res.elementAt(4).toString());

            func.setLabel(name);
            func.setLiniesCount(allLines);
            func.setCoverCount(coveredLines);
            func.setArity(arity);

            stats.addChild(func.getLabel(), func);
        }

    }
View Full Code Here

TOP

Related Classes of org.erlide.cover.views.model.FunctionStats

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.