|
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.internal.libraries; |
|
20 |
|
21 import org.eclipse.core.runtime.Path; |
|
22 import org.eclipse.jface.dialogs.Dialog; |
|
23 import org.eclipse.jface.wizard.WizardPage; |
|
24 import org.eclipse.swt.SWT; |
|
25 import org.eclipse.swt.widgets.Composite; |
|
26 import org.eclipse.wst.jsdt.core.IIncludePathEntry; |
|
27 import org.eclipse.wst.jsdt.core.IJavaScriptProject; |
|
28 import org.eclipse.wst.jsdt.core.JavaScriptCore; |
|
29 import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.DialogField; |
|
30 import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.LayoutUtil; |
|
31 import org.eclipse.wst.jsdt.ui.wizards.IJsGlobalScopeContainerPage; |
|
32 |
|
33 @SuppressWarnings("restriction") |
|
34 public class TMWContainerPage extends WizardPage implements IJsGlobalScopeContainerPage { |
|
35 private static final String CONTAINER_ID = "org.symbian.tools.mtw.core.mobileWebLibrary"; //$NON-NLS-1$ |
|
36 |
|
37 public TMWContainerPage() { |
|
38 super("TMWLibraryWizzardPage"); //$NON-NLS-1$ |
|
39 setTitle("Mobile Web Runtime Library"); |
|
40 } |
|
41 |
|
42 public boolean finish() { |
|
43 return true; |
|
44 } |
|
45 |
|
46 public IIncludePathEntry getSelection() { |
|
47 return null; |
|
48 } |
|
49 |
|
50 public void setSelection(IIncludePathEntry containerEntry) { |
|
51 } |
|
52 |
|
53 public void createControl(Composite parent) { |
|
54 Composite composite = new Composite(parent, SWT.NONE); |
|
55 composite.setFont(parent.getFont()); |
|
56 DialogField field = new DialogField(); |
|
57 |
|
58 field.setLabelText("Library added to a project"); |
|
59 LayoutUtil.doDefaultLayout(composite, new DialogField[] { field }, false, SWT.DEFAULT, SWT.DEFAULT); |
|
60 Dialog.applyDialogFont(composite); |
|
61 setControl(composite); |
|
62 setDescription("Mobile application support"); |
|
63 } |
|
64 |
|
65 public void initialize(IJavaScriptProject project, IIncludePathEntry[] currentEntries) { |
|
66 // nothing to initialize |
|
67 } |
|
68 |
|
69 public IIncludePathEntry[] getNewContainers() { |
|
70 IIncludePathEntry library = JavaScriptCore.newContainerEntry(new Path(CONTAINER_ID)); |
|
71 return new IIncludePathEntry[] { library }; |
|
72 } |
|
73 } |