blob: e3da52e575dc9fb496ecadf81b9153b731ec0ffa (
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
|
/*******************************************************************************
* Copyright (c) 2009, 2015 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.examples.ui.pda.adapters;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.debug.core.commands.IRestartHandler;
import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
/**
* Adapter factory that provides debug command handler adapters for the
* PDA debugger.
*
* @since 3.6
*/
public class CommandAdapterFactory implements IAdapterFactory {
private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
@SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IRestartHandler.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
return (T) fgRestartHandler;
}
}
return null;
}
@Override
public Class<?>[] getAdapterList() {
return new Class[]{IRestartHandler.class};
}
}
|