Exemple #1
0
  /** Reads and processes the current markers and adds a listener for marker changes. */
  private void startMonitoringMarkers() {
    final IFile inputFile = getInputFile();
    if (inputFile != null) {
      updateFromExistingMarkers(inputFile);

      mMarkerMonitor =
          new IFileListener() {
            @Override
            public void fileChanged(IFile file, IMarkerDelta[] markerDeltas, int kind) {
              if (file.equals(inputFile)) {
                processMarkerChanges(markerDeltas);
              }
            }
          };

      GlobalProjectMonitor.getMonitor().addFileListener(mMarkerMonitor, IResourceDelta.CHANGED);
    }
  }
Exemple #2
0
  @Override
  public void dispose() {
    super.dispose();

    GlobalProjectMonitor.getMonitor().removeFileListener(mMarkerMonitor);
  }