public void run(IProgressMonitor monitor)
     throws InvocationTargetException, InterruptedException {
   if (fgFirstTime) {
     // Join the initialize after load job.
     IJobManager manager = Job.getJobManager();
     manager.join(JavaScriptUI.ID_PLUGIN, monitor);
   }
   OpenTypeHistory history = OpenTypeHistory.getInstance();
   if (fgFirstTime || history.isEmpty()) {
     monitor.beginTask(JavaUIMessages.TypeSelectionDialog_progress_consistency, 100);
     if (history.needConsistencyCheck()) {
       refreshSearchIndices(new SubProgressMonitor(monitor, 90));
       history.checkConsistency(new SubProgressMonitor(monitor, 10));
     } else {
       refreshSearchIndices(monitor);
     }
     monitor.done();
     fgFirstTime = false;
   } else {
     history.checkConsistency(monitor);
   }
 }
 public boolean needsExecution() {
   OpenTypeHistory history = OpenTypeHistory.getInstance();
   return fgFirstTime || history.isEmpty() || history.needConsistencyCheck();
 }