public void handleEvent(Event event) { TableItem item = (TableItem) event.item; int tableIndex = indexOf(item); ScanningResult scanningResult = scanningResults.getResult(tableIndex); List<?> values = scanningResult.getValues(); String[] resultStrings = new String[values.size()]; for (int i = 0; i < values.size(); i++) { Object value = values.get(i); if (value != null) resultStrings[i] = value.toString(); } item.setText(resultStrings); item.setImage(0, listImages[scanningResult.getType().ordinal()]); }
public final void handleEvent(Event event) { ScanningResultList results = resultTable.getScanningResults(); int numElements = resultTable.getItemCount(); int startIndex = startIndex(); for (int i = inc(startIndex); i < numElements && i >= 0; i = inc(i)) { ScanningResult scanningResult = results.getResult(i); if (whatToSearchFor.matches(scanningResult.getType())) { resultTable.setSelection(i); resultTable.setFocus(); return; } } // rewind if (startIndex >= 0 && startIndex < numElements) { resultTable.deselectAll(); handleEvent(event); } }