@Override public void catalogElementsInsertionFinished() { pm.setPreMessage("Scanning variables... "); pm.setPostMessage(""); pm.beginTask("", totalWork); pm.worked(worked); }
@Override protected void done() { try { DAPVariable[] dapVariables = get(); listModel.addVariables(dapVariables); } catch (Exception e) { BeamLogManager.getSystemLogger().warning( "Stopping to scan for variables due to exception: " + e.getMessage()); } finally { filterPreparators.remove(this); pm.worked(1); worked++; if (!filterPreparatorsInWait.isEmpty()) { VariableFilterPreparator nextFilterPreparator = filterPreparatorsInWait.remove(0); filterPreparators.add(nextFilterPreparator); nextFilterPreparator.execute(); } int percentage = (int) (((double) worked / (double) totalWork) * 100); pm.setTaskName(percentage + " %"); if (filterPreparators.isEmpty()) { updateUI(true, true, true); filterCheckBox.setEnabled(true); pm.done(); worked = 0; totalWork = 0; } } } }