task = null;
}
}
private void updateButtonsPanel() {
final TracingResultsNode resultSet = TraceBackend.getInstance()
.getActiveResultSet();
if (resultSet != null) {
index = TraceBackend.getInstance().getStartIndex();
final int size = TraceCollections.getTracesList().size();
final boolean previousEnabled = index > 1;
final boolean nextEnabled = index + size - 1 < resultSet.getSize();
previousButton.setEnabled(previousEnabled);
nextButton.setEnabled(nextEnabled);
showButton.setEnabled(previousEnabled || nextEnabled);
traceIndexField.setEnabled(previousEnabled || nextEnabled);
traceIndexField.setText(String.valueOf(index));
buttonsPanel.setEnabled(true);
final StringBuilder stringBuilder = new StringBuilder(" (");
if (resultSet.getSize() == 0) {
stringBuilder.append("no traces)");
} else {
stringBuilder.append(index).append(" - ").append(index + size - 1)
.append(" of ").append(resultSet.getSize()).append(" traces)");
}
label.setText(stringBuilder.toString());
} else {
traceIndexField.setText("");
label.setText("");