예제 #1
0
 public Object getIndex() {
   if (worker == null || !worker.isDone()) {
     return null;
   } else {
     try {
       return worker.get();
     } catch (Exception ex) {
       MessageUtils.showMessage(ex.getMessage());
     }
     return null;
   }
 }
예제 #2
0
 private void cancelButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cancelButtonActionPerformed
   if (worker != null) {
     worker.cancel(true);
   }
   setVisible(false);
 } // GEN-LAST:event_cancelButtonActionPerformed
예제 #3
0
  private void goButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_goButtonActionPerformed

    if (worker.isDone() || worker.isCancelled()) {
      setVisible(false);
    } else {
      goButton.setEnabled(false);
      worker.execute();
      jLabel1.setVisible(true);
      // Haven't worked out how to publish progress yet, just going to set it to indeterminate
      if (fileType == FileType.VCF) {
        IndexCreatorDialog.this.progressBar.setIndeterminate(true);
        jLabel1.setText("Creating index...");
      }
    }
  } // GEN-LAST:event_goButtonActionPerformed