Examples of BugReporterEventImpl


Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

  public void actionPerformed(final AnActionEvent e) {
    _actionEvent = e;
    _dataContext = e.getDataContext();
    final com.intellij.openapi.project.Project project = DataKeys.PROJECT.getData(_dataContext);
    if (project != null) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_ABORTED, project.getName()));
    } else {
      LOGGER.error("No active project");
    }
  }
View Full Code Here

Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

      @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"})
      @Override
      public void run(@NotNull final ProgressIndicator indicator) {

        EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_STARTED, null, 0, project.getName()));
        setProgressIndicator(indicator);
        indicator.setFraction(0.0);
        indicator.setIndeterminate(false);
        indicator.setText(fileToImport);
        try {
          _bugCollection = new SortedBugCollection();
          final FindBugsPlugin pluginComponent = IdeaUtilImpl.getPluginComponent(project);
          _importBugCollection = _bugCollection.createEmptyCollectionWithMetadata();
          final edu.umd.cs.findbugs.Project importProject = _importBugCollection.getProject();
          importProject.setGuiCallback(new PluginGuiCallback(pluginComponent));
          _importBugCollection.setDoNotUseCloud(true);
          for (final Plugin plugin : Plugin.getAllPlugins()) {
            importProject.setPluginStatusTrinary(plugin.getPluginId(), !preferences.isPluginDisabled(plugin.getPluginId()));
          }
          _importBugCollection.readXML(fileToImport);

          final ProjectStats projectStats = _importBugCollection.getProjectStats();
          int bugCount = 0;
          for (final BugInstance bugInstance : _importBugCollection) {
            if (indicator.isCanceled()) {
              EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_ABORTED, project.getName()));
              Thread.currentThread().interrupt();
              return;
            }
            final Integer bugCounter = bugCount++;
            final double fraction = bugCounter.doubleValue() / projectStats.getTotalBugs();
            indicator.setFraction(fraction);
            indicator.setText2("Importing bug '" + bugCount + "' of '" + projectStats.getTotalBugs() + "' - " + bugInstance.getMessageWithoutPrefix());
            EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.NEW_BUG_INSTANCE, bugInstance, bugCounter, projectStats, project.getName()));
          }

          showToolWindowNotifier(project, "Imported bug collection from '" + fileToImport + "'.", MessageType.INFO);

          _importBugCollection.setDoNotUseCloud(false);
          _importBugCollection.setTimestamp(System.currentTimeMillis());
          _importBugCollection.reinitializeCloud();
        } catch (final IOException e1) {
          EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_ABORTED, project.getName()));
          final String message = "Import failed";
          showToolWindowNotifier(project, message, MessageType.ERROR);
          LOGGER.error(message, e1);

        } catch (final DocumentException e1) {
          EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_ABORTED, project.getName()));
          final String message = "Import failed";
          showToolWindowNotifier(project, message, MessageType.ERROR);
          LOGGER.error(message, e1);

        } finally {
          EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_FINISHED, null, _importBugCollection, project.getName()));
          _importBugCollection = null;
          Thread.currentThread().interrupt();
        }
      }
View Full Code Here

Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

    observeClass(bug.getPrimaryClass().getClassDescriptor());

    if (_isInspectionRun) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(BugReporterInspectionEvent.Operation.NEW_BUG_INSTANCE, bug, _filteredBugCount, getProjectStats(), _project.getName()));
    } else {
      EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(BugReporterEvent.Operation.NEW_BUG_INSTANCE, bug, _filteredBugCount, getProjectStats(), _project.getName()));
    }
  }
View Full Code Here

Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

    }

    if (_isInspectionRun) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_FINISHED, null, getBugCollection(), _project.getName(), _findBugsProject));
    } else {
      EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_FINISHED, null, getBugCollection(), _project.getName(), _findBugsProject));
    }

    setRunning(false);
  }
View Full Code Here

Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

      Thread.currentThread().interrupt();

      if (_isInspectionRun) {
        EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_ABORTED, _project.getName()));
      } else if (!isRunning()) {
        EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_ABORTED, _project.getName()));
      }
    }

    final String className = classDescriptor.getDottedClassName();
View Full Code Here

Examples of org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterEventImpl

    beginStage(ANALYZING_CLASSES_i18N, numClasses);

    if (_isInspectionRun) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_STARTED, null, 0, _project.getName()));
    } else if (!isRunning()) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterEventImpl(Operation.ANALYSIS_STARTED, null, 0, _project.getName()));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.