Java Code Examples for edu.umd.cs.findbugs.Project#setGuiCallback()

The following examples show how to use edu.umd.cs.findbugs.Project#setGuiCallback() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainFrameLoadSaveHelper.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
void loadAnalysis(final File file) {

        Runnable runnable = () -> {
            mainFrame.acquireDisplayWait();
            try {
                Project project = new Project();
                project.setGuiCallback(mainFrame.getGuiCallback());
                project.setCurrentWorkingDirectory(file.getParentFile());
                BugLoader.loadBugs(mainFrame, project, file);
                project.getSourceFinder(); // force source finder to be
                // initialized
                mainFrame.updateBugTree();
            } finally {
                mainFrame.releaseDisplayWait();
            }
        };
        if (EventQueue.isDispatchThread()) {
            new Thread(runnable, "Analysis loading thread").start();
        } else {
            runnable.run();
        }
    }
 
Example 2
Source File: MainFrameLoadSaveHelper.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
void loadAnalysis(final URL url) {

        Runnable runnable = () -> {
            mainFrame.acquireDisplayWait();
            try {
                Project project = new Project();
                project.setGuiCallback(mainFrame.getGuiCallback());
                BugLoader.loadBugs(mainFrame, project, url);
                project.getSourceFinder(); // force source finder to be
                // initialized
                mainFrame.updateBugTree();
            } finally {
                mainFrame.releaseDisplayWait();
            }
        };
        if (EventQueue.isDispatchThread()) {
            new Thread(runnable, "Analysis loading thread").start();
        } else {
            runnable.run();
        }
    }
 
Example 3
Source File: MainFrame.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void openBugCollection(SortedBugCollection bugs) {
    acquireDisplayWait();
    try {
        mainFrameLoadSaveHelper.prepareForFileLoad(null, null);

        Project project = bugs.getProject();
        project.setGuiCallback(guiCallback);
        BugLoader.addDeadBugMatcher(bugs);
        setProjectAndBugCollectionInSwingThread(project, bugs);
    } finally {
        releaseDisplayWait();
    }

}
 
Example 4
Source File: MergeSummarizeAndView.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
static SortedBugCollection createPreconfiguredBugCollection(List<String> workingDirList, List<String> srcDirList,
        IGuiCallback guiCallback) {
    Project project = new Project();
    for (String cwd : workingDirList) {
        project.addWorkingDir(cwd);
    }
    project.addSourceDirs(srcDirList);
    project.setGuiCallback(guiCallback);
    return new SortedBugCollection(project);
}