use of org.eclipse.titan.log.viewer.search.SearchLabelProvider in project titan.EclipsePlug-ins by eclipse.
the class LogSearchResultPage method configureTreeViewer.
@Override
protected void configureTreeViewer(final TreeViewer viewer) {
treeViewer = viewer;
contentProvider = new TreeContentProvider(this);
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(new SearchLabelProvider());
viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
try {
Object selectedElement = ((TreeSelection) event.getSelection()).getFirstElement();
if (selectedElement instanceof Match) {
showMatch((Match) selectedElement, 0, 0, true);
return;
}
} catch (PartInitException e) {
ErrorReporter.logExceptionStackTrace(e);
// $NON-NLS-1$
TitanLogExceptionHandler.handleException(new TechnicalException("Could not show the selected match. Reason: " + e.getMessage()));
}
}
});
}
Aggregations