author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 09 Aug 2010 15:18:34 -0700 | |
changeset 461 | 7a8f9fa8d278 |
permissions | -rw-r--r-- |
461
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
1 |
/** |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies). |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
3 |
* All rights reserved. |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
8 |
* |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
10 |
* Symbian Foundation - initial contribution. |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
11 |
* Contributors: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
12 |
* Description: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
13 |
* Overview: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
14 |
* Details: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
15 |
* Platforms/Drives/Compatibility: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
16 |
* Assumptions/Requirement/Pre-requisites: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
17 |
* Failures and causes: |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
18 |
*/ |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
19 |
package org.symbian.tools.tmw.internal.deployment; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
20 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
21 |
import org.eclipse.core.runtime.IConfigurationElement; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
22 |
import org.eclipse.core.runtime.Platform; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
23 |
import org.symbian.tools.tmw.ui.TMWCoreUI; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
24 |
import org.symbian.tools.tmw.ui.deployment.IDeploymentTargetType; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
25 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
26 |
public class DeploymentTargetTypesRegistry { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
27 |
private DeploymentTargetTypeDescriptor[] descriptors; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
28 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
29 |
public DeploymentTargetTypesRegistry() { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
30 |
readExtensions(); |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
31 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
32 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
33 |
private void readExtensions() { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
34 |
final IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor( |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
35 |
TMWCoreUI.PLUGIN_ID, "deploymentTargetType"); |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
36 |
descriptors = new DeploymentTargetTypeDescriptor[elements.length]; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
37 |
for (int i = 0; i < elements.length; i++) { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
38 |
descriptors[i] = new DeploymentTargetTypeDescriptor(elements[i]); |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
39 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
40 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
41 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
42 |
public DeploymentTargetTypeDescriptor[] getProviders() { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
43 |
return descriptors; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
44 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
45 |
|
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
46 |
public IDeploymentTargetType getType(String id) { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
47 |
DeploymentTargetTypeDescriptor[] providers = getProviders(); |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
48 |
for (DeploymentTargetTypeDescriptor descriptor : providers) { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
49 |
if (descriptor.getId().equals(id)) { |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
50 |
return descriptor; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
51 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
52 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
53 |
return null; |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
54 |
} |
7a8f9fa8d278
Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
55 |
} |