@Override public IModelSelectionPolicy createModelSelectionPolicyAdapter(Object element, IPresentationContext context) { if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { if (element instanceof IDebugElement) { return new DefaultSelectionPolicy((IDebugElement)element); } } return null; }
protected boolean overrides(Object existing, Object candidate) { if (existing == null) { return true; } if (existing.equals(candidate)) { return true; } if (existing instanceof IStackFrame && candidate instanceof IStackFrame) { IStackFrame curr = (IStackFrame) existing; IStackFrame next = (IStackFrame) candidate; return curr.getThread().equals(next.getThread()) || !isSticky(existing); } return !isSticky(existing); }
@Override public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) { if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { if (existing instanceof IStructuredSelection && candidate instanceof IStructuredSelection) { IStructuredSelection ssExisting = (IStructuredSelection) existing; IStructuredSelection ssCandidate = (IStructuredSelection) candidate; return overrides(ssExisting.getFirstElement(), ssCandidate.getFirstElement()); } } return true; }
@Override public boolean isSticky(ISelection selection, IPresentationContext context) { if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { if (selection instanceof IStructuredSelection) { return isSticky(((IStructuredSelection)selection).getFirstElement()); } } return false; }