private void openSelection() throws Exception {
IStructuredSelection selection = (IStructuredSelection)resultViewer.getSelection();
Object obj = selection.getFirstElement();
SearchResultDoc doc = null;
MatchLine selectedLineMatches = null;
if(obj instanceof SearchResultDoc) {
doc = (SearchResultDoc) obj;
} else if(obj instanceof MatchLine) {
selectedLineMatches = (MatchLine) obj;
doc = selectedLineMatches.getResultDoc();
} else if(obj instanceof Exception) {
InstaSearchUI.showError((Exception)obj);
return;
} else if(obj instanceof SearchQuery ) {
search( (SearchQuery) obj, true );