public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (selection instanceof StructuredSelection) {
StructuredSelection ss = (StructuredSelection) selection;
RunInfo selected = ((RunInfo) ss.getFirstElement());
if (selected != null) {
String selectedId = ((RunInfo) ss.getFirstElement()).getTestId();
if (m_selectedId != null && !m_selectedId.startsWith(selectedId)) {
m_selectedId = selectedId;
}
}
}
}
});
//
// Content provider
//
m_testViewer.setContentProvider(new IStructuredContentProvider() {
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public Object[] getElements(Object inputElement) {
return m_tests.values().toArray();
}
});
//
// Label provider
//
m_testViewer.setLabelProvider(new ITableLabelProvider() {
public void removeListener(ILabelProviderListener listener) {
}
public boolean isLabelProperty(Object element, String property) {
return false;
}
public void dispose() {
}
public void addListener(ILabelProviderListener listener) {
}
public String getColumnText(Object element, int columnIndex) {
RunInfo runInfo = (RunInfo) element;
String testId = runInfo.getTestId();
switch(columnIndex) {
case 0: return ((RunInfo) element).getTestName();
case 1: return MessageFormat.format("{0}", ((float) getTestTime(testId)) / 1000);
case 2: return Integer.toString(getTestClassCount(testId));
case 3: return Integer.toString(getTestMethodCount(testId));