|
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.jface.resource.ImageDescriptor; |
|
22 import org.eclipse.swt.SWT; |
|
23 import org.eclipse.swt.graphics.FontData; |
|
24 import org.eclipse.swt.graphics.RGB; |
|
25 import org.eclipse.ui.PlatformUI; |
|
26 import org.eclipse.ui.model.IWorkbenchAdapter; |
|
27 import org.eclipse.ui.model.IWorkbenchAdapter2; |
|
28 import org.symbian.tools.mtw.ui.MTWCoreUI; |
|
29 |
|
30 public class BluetoothTargetWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2 { |
|
31 public RGB getForeground(Object element) { |
|
32 final BluetoothTarget target = (BluetoothTarget) element; |
|
33 if (!target.isDiscovered()) { |
|
34 return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay() |
|
35 .getSystemColor(SWT.COLOR_DARK_GRAY).getRGB(); |
|
36 } |
|
37 return null; |
|
38 } |
|
39 |
|
40 public RGB getBackground(Object element) { |
|
41 return null; |
|
42 } |
|
43 |
|
44 public FontData getFont(Object element) { |
|
45 return null; |
|
46 } |
|
47 |
|
48 public Object[] getChildren(Object o) { |
|
49 return null; |
|
50 } |
|
51 |
|
52 public ImageDescriptor getImageDescriptor(Object object) { |
|
53 return MTWCoreUI.getImages().getBluetoothImageDescriptor(); |
|
54 } |
|
55 |
|
56 public String getLabel(Object o) { |
|
57 final BluetoothTarget target = (BluetoothTarget) o; |
|
58 return target.getName(); |
|
59 } |
|
60 |
|
61 public Object getParent(Object o) { |
|
62 return null; |
|
63 } |
|
64 |
|
65 } |