if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
if (ss.size() == 1) {
Object element = ss.getFirstElement();
if (element instanceof IAdaptable) {
IStackFrame frame = (IStackFrame) ((IAdaptable) element)
.getAdapter(IStackFrame.class);
boolean instOf = element instanceof IStackFrame
|| element instanceof IThread;
if (frame != null) {
// do not consider scrapbook frames