// Avvio thread
SwingWorker worker = new SwingWorker() {
@Override
protected String doInBackground() throws InterruptedException {
BugUpdater bugUpdater = new BugUpdater();
bugUpdater.update(true);
return null;
}
@Override
protected void done() {
layout.enableAll();
layout.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}
};
worker.execute();
break;
}
case 2: {
// Inizio l'analisi
if (layout != null) {
layout.disableAll();
layout.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
}
SwingWorker worker = new SwingWorker() {
@Override
protected String doInBackground() throws InterruptedException {
StartAnalyze analyzer = new StartAnalyze();
analyzer.start(false);
return null;
}
@Override
protected void done() {
layout.enableAll();
layout.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}
};
worker.execute();
break;
}
case 3: {
// Creo la query sql per creare il database
if (layout != null) {
layout.disableAll();
layout.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
}
SwingWorker worker = new SwingWorker() {
@Override
protected String doInBackground() throws InterruptedException {
// Verifico l'esisteza di almeno un file da indicizzare
File f = new File(Indexer.path_for_data);
if ((!f.exists()) || (f.listFiles().length == 0)) {
Layout.log("Cartella da indicizzare " + f.getPath() + " vuota, aggiorno i file!!");
// Aggiorno i file di bug
BugUpdater bugUpdater = new BugUpdater();
bugUpdater.update(false);
}
// Se non avevo clacolato le priorità statiche lo faccio ora
if (StartAnalyze.finalPriority == null) {
StartAnalyze s = new StartAnalyze();