public void clearFinishedScans() { // Remove via controller int count = controller.removeFinishedScans(); if (count > 0) { // Some were removed - remove all and add back the remaining ones progressModel.removeAllElements(); progressModel.addElement(Constant.messages.getString(prefix + ".toolbar.progress.select")); for (GS scan : controller.getAllScans()) { progressModel.addElement(nameForScanner(scan)); } updateScannerUI(); } clearScansButton.setEnabled(false); }
private void setActiveScanLabelsEventHandler() { List<GS> ascans = controller.getActiveScans(); getActiveScansValueLabel().setText(String.valueOf(ascans.size())); StringBuilder sb = new StringBuilder(); sb.append("<html>"); for (GS ascan : ascans) { sb.append(ascan.getDisplayName()); sb.append("<br>"); } sb.append("</html>"); final String toolTip = sb.toString(); getActiveScansNameLabel().setToolTipText(toolTip); getActiveScansValueLabel().setToolTipText(toolTip); scanStatus.setScanCount(ascans.size()); this.getClearScansButton().setEnabled(controller.getAllScans().size() - ascans.size() > 0); }