org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothTargetAdapterFactory.java
equal
deleted
inserted
replaced
1 /** |
|
2 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Symbian Foundation - initial contribution. |
|
11 * Contributors: |
|
12 * Description: |
|
13 * Overview: |
|
14 * Details: |
|
15 * Platforms/Drives/Compatibility: |
|
16 * Assumptions/Requirement/Pre-requisites: |
|
17 * Failures and causes: |
|
18 */ |
|
19 package org.symbian.tools.mtw.ui.deployment.bluetooth; |
|
20 |
|
21 import org.eclipse.core.runtime.IAdapterFactory; |
|
22 import org.eclipse.ui.model.IWorkbenchAdapter; |
|
23 import org.eclipse.ui.model.IWorkbenchAdapter2; |
|
24 |
|
25 @SuppressWarnings({ "unchecked", "rawtypes" }) |
|
26 public class BluetoothTargetAdapterFactory implements IAdapterFactory { |
|
27 private final BluetoothTargetWorkbenchAdapter workbenchAdapter = new BluetoothTargetWorkbenchAdapter(); |
|
28 |
|
29 public Object getAdapter(Object adaptableObject, Class adapterType) { |
|
30 if ((adapterType.isAssignableFrom(IWorkbenchAdapter.class) || adapterType |
|
31 .isAssignableFrom(IWorkbenchAdapter2.class)) && adaptableObject instanceof BluetoothTarget) { |
|
32 return workbenchAdapter; |
|
33 } |
|
34 return null; |
|
35 } |
|
36 |
|
37 public Class[] getAdapterList() { |
|
38 return new Class[] { IWorkbenchAdapter2.class, IWorkbenchAdapter.class }; |
|
39 } |
|
40 |
|
41 } |
|