/** Make this TopComponent a listener to various change events. */
 private void subscribeToChangeEvents() {
   UserPreferences.addChangeListener(
       new PreferenceChangeListener() {
         @Override
         public void preferenceChange(PreferenceChangeEvent evt) {
           switch (evt.getKey()) {
             case UserPreferences.HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE:
               refreshContentTreeSafe();
               break;
             case UserPreferences.HIDE_KNOWN_FILES_IN_VIEWS_TREE:
               // TODO: Need a way to refresh the Views subtree
               break;
           }
         }
       });
   Case.addPropertyChangeListener(this);
   this.em.addPropertyChangeListener(this);
   IngestManager.getInstance().addIngestJobEventListener(this);
   IngestManager.getInstance().addIngestModuleEventListener(this);
 }
Exemplo n.º 2
0
 /**
  * Removes a hash database from the set of hash databases used to classify files as known or known
  * bad and saves the configuration.
  *
  * @param hashDb
  * @throws HashDbManagerException
  */
 public synchronized void removeHashDatabase(HashDb hashDb) throws HashDbManagerException {
   // Don't remove a database if ingest is running
   boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
   if (ingestIsRunning) {
     throw new HashDbManagerException(
         NbBundle.getMessage(this.getClass(), "HashDbManager.ingestRunningExceptionMsg"));
   }
   removeHashDatabaseInternal(hashDb);
   if (!save()) {
     throw new HashDbManagerException(
         NbBundle.getMessage(this.getClass(), "HashDbManager.saveErrorExceptionMsg"));
   }
 }
Exemplo n.º 3
0
 private void removeListeners() {
   deleteObservers();
   IngestManager.getInstance().removeIngestJobEventListener(pcl);
   IngestManager.getInstance().removeIngestModuleEventListener(pcl);
   Case.removePropertyChangeListener(pcl);
 }
Exemplo n.º 4
0
 FileSizeRootChildrenObservable() {
   IngestManager.getInstance().addIngestJobEventListener(pcl);
   IngestManager.getInstance().addIngestModuleEventListener(pcl);
   Case.addPropertyChangeListener(pcl);
 }
Exemplo n.º 5
0
 /**
  * Provides a callback for completed data source ingest jobs, allowing this ingest job to notify
  * the ingest manager when it is complete.
  *
  * @param dataSourceIngestJob A completed data source ingest job.
  */
 void dataSourceJobFinished(DataSourceIngestJob dataSourceIngestJob) {
   if (incompleteJobsCount.decrementAndGet() == 0) {
     IngestManager.getInstance().finishIngestJob(this);
   }
 }