2
|
1 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
|
2 |
// Use of this source code is governed by a BSD-style license that can be
|
|
3 |
// found in the LICENSE file.
|
|
4 |
|
|
5 |
package org.chromium.debug.core.model;
|
|
6 |
|
|
7 |
import org.chromium.debug.core.ChromiumDebugPlugin;
|
|
8 |
import org.eclipse.core.runtime.PlatformObject;
|
|
9 |
import org.eclipse.debug.core.ILaunch;
|
|
10 |
import org.eclipse.debug.core.model.IDebugElement;
|
|
11 |
|
|
12 |
/**
|
|
13 |
* A generic IDebugElement implementation.
|
|
14 |
*/
|
|
15 |
public class DebugElementImpl extends PlatformObject implements IDebugElement {
|
|
16 |
|
|
17 |
private final IChromiumDebugTarget debugTarget;
|
|
18 |
|
|
19 |
public DebugElementImpl(IChromiumDebugTarget debugTarget) {
|
|
20 |
this.debugTarget = debugTarget;
|
|
21 |
}
|
|
22 |
|
|
23 |
public IChromiumDebugTarget getDebugTarget() {
|
|
24 |
return debugTarget;
|
|
25 |
}
|
|
26 |
|
|
27 |
public ILaunch getLaunch() {
|
|
28 |
return getDebugTarget().getLaunch();
|
|
29 |
}
|
|
30 |
|
|
31 |
public String getModelIdentifier() {
|
|
32 |
return ChromiumDebugPlugin.DEBUG_MODEL_ID;
|
|
33 |
}
|
|
34 |
|
|
35 |
@Override
|
|
36 |
@SuppressWarnings("unchecked")
|
|
37 |
public Object getAdapter(Class adapter) {
|
|
38 |
if (adapter == IDebugElement.class) {
|
|
39 |
return this;
|
|
40 |
}
|
|
41 |
return super.getAdapter(adapter);
|
|
42 |
}
|
|
43 |
|
|
44 |
}
|