|
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.tmw.core.internal.projects; |
|
20 |
|
21 import org.eclipse.core.runtime.CoreException; |
|
22 import org.eclipse.core.runtime.IConfigurationElement; |
|
23 import org.eclipse.wst.jsdt.core.IIncludePathEntry; |
|
24 import org.symbian.tools.tmw.core.TMWCore; |
|
25 import org.symbian.tools.tmw.core.projects.IFacetIncludePathProvider; |
|
26 import org.symbian.tools.tmw.core.projects.IMTWProject; |
|
27 |
|
28 public class LazyIncludePathProvider implements IFacetIncludePathProvider { |
|
29 private final IConfigurationElement element; |
|
30 private LazyIncludePathProvider provider; |
|
31 |
|
32 public LazyIncludePathProvider(IConfigurationElement element) { |
|
33 this.element = element; |
|
34 } |
|
35 |
|
36 public IIncludePathEntry[] getEntries(IMTWProject project) { |
|
37 if (provider == null) { |
|
38 try { |
|
39 provider = (LazyIncludePathProvider) element.createExecutableExtension("class"); |
|
40 } catch (CoreException e) { |
|
41 TMWCore.log(null, e); |
|
42 return new IIncludePathEntry[0]; |
|
43 } |
|
44 } |
|
45 return provider.getEntries(project); |
|
46 } |
|
47 |
|
48 } |