blob: e83db9b2b56f580a7beac47f43efb6903d054d37 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*******************************************************************************
* Copyright (c) 2007, 2010 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
* Wind River Systems - support for alternative expression view content providers
* Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956)
*******************************************************************************/
package org.eclipse.debug.internal.ui.elements.adapters;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.ui.IDebugUIConstants;
/**
* @since 3.4
*/
public class StackFrameViewerInputProvider extends ViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
@Override
protected Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException {
if ( IDebugUIConstants.ID_REGISTER_VIEW.equals(context.getId()) ) {
return new RegisterGroupProxy((IStackFrame) source);
} else if ( IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(context.getId()) ) {
return new DefaultBreakpointsViewInput(context);
} else {
return DebugPlugin.getDefault().getExpressionManager();
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#supportsContextId(java.lang.String)
*/
@Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_REGISTER_VIEW.equals(id) ||
IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id) ||
IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id);
}
}
|