Package org.erlide.cover.views.model

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


        final StatsTreeObject selObj = (StatsTreeObject) treeSelection.getFirstElement();

        final BrowserDialog browser = new BrowserDialog(shell);

        if (selObj instanceof FunctionStats) {
            final ModuleStats module = (ModuleStats) selObj.getParent();
            browser.setObject(module);
        } else {
            browser.setObject(selObj);
        }
View Full Code Here


    @Override
    protected void perform(final StatsTreeObject selection) {

        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());
View Full Code Here

    @Override
    protected void perform(final StatsTreeObject selection) {

        if (selection instanceof ModuleStats) {
            final ModuleStats module = (ModuleStats) selection;
            final String name = module.getLabel() + ".erl";
            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();
            for (final ICoverageObject module : col) {
                if (ifMarkAnnotations((ModuleStats) module)) {
                    ((ModuleStats) module).couldBeMarked = true;
                } else {
                    ((ModuleStats) module).couldBeMarked = false;
                }
            }
            marker.addAnnotations();
        } else {
            final Collection<ICoverageObject> col = selection.getModules();
            for (final ICoverageObject module : col) {
                if (ifMarkAnnotations((ModuleStats) module)) {
                    final String name = module.getLabel() + ".erl";
                    ((ModuleStats) module).couldBeMarked = true;
                    marker.addAnnotationsToFile(name);
                }
            }
        }
View Full Code Here

    private void createAnnotationMap() {

        final Iterator<ModuleStats> it = ModuleSet.iterator();

        while (it.hasNext()) {
            final ModuleStats module = it.next();
            if (!module.couldBeMarked) {
                continue;
            }

            final List<LineResult> list = module.getLineResults();
            final String modName = module.getLabel() + ".erl";

            for (final LineResult lr : list) {

                coverage.addAnnotation(modName, lr, null);
View Full Code Here

        final IEditorPart currentEditor = workbench.getActiveWorkbenchWindow()
                .getActivePage().getActiveEditor();

        if (currentEditor.getTitle().equals(fileName) && !currentEditor.isDirty()) {

            final ModuleStats module = ModuleSet.get(fileName.replace(".erl", ""));

            if (module == null || !module.couldBeMarked) {
                return;
            }

            final List<LineResult> list = module.getLineResults();

            for (final LineResult lr : list) {
                coverage.addAnnotation(fileName, lr, null);
            }
View Full Code Here

                .getActivePage().getActiveEditor();

        if (currentEditor.getTitle().equals(fileName)
                && currentEditor instanceof ITextEditor && !currentEditor.isDirty()) {

            final ModuleStats module = ModuleSet.get(fileName.replace(".erl", ""));

            if (module == null || !module.couldBeMarked) {
                return;
            }

            final List<LineResult> list = module.getLineResults();

            final ITextEditor editor = (ITextEditor) currentEditor;

            log.info(fileName);
View Full Code Here

                        .toString());

                log.info(String.format("Module %s %s %d %d %f", moduleName, htmlPath,
                        allLines, coveredLines, percent));

                final ModuleStats moduleStats = new ModuleStats();

                moduleStats.setLabel(moduleName);
                moduleStats.setHtmlPath(htmlPath);
                moduleStats.setLiniesCount(allLines);
                moduleStats.setCoverCount(coveredLines);

                // calculate md5

                try {
                    final File file = new File(ErlangEngine.getInstance().getModel()
                            .findModule(moduleName).getFilePath());
                    moduleStats.setMd5(MD5Checksum.getMD5(file));
                } catch (final Exception e) {
                    ErlLogger.error(e);
                }

                //
View Full Code Here

TOP

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

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.