|
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.wrttools.wizards; |
|
20 |
|
21 import org.eclipse.core.databinding.observable.value.IObservableValue; |
|
22 import org.eclipse.jface.databinding.swt.SWTObservables; |
|
23 import org.eclipse.jface.databinding.wizard.WizardPageSupport; |
|
24 import org.eclipse.swt.SWT; |
|
25 import org.eclipse.swt.layout.GridLayout; |
|
26 import org.eclipse.swt.widgets.Button; |
|
27 import org.eclipse.swt.widgets.Composite; |
|
28 import org.symbian.tools.tmw.ui.project.AbstractNewApplicationWizardPage; |
|
29 import org.symbian.tools.tmw.ui.project.IProjectTemplate; |
|
30 |
|
31 /** |
|
32 * Entry for the basic template parameters. |
|
33 * |
|
34 * @author Eugene Ostroukhov (eugeneo@symbian.org) |
|
35 */ |
|
36 public class NewWrtAppTemplatePage extends AbstractNewApplicationWizardPage { |
|
37 |
|
38 public NewWrtAppTemplatePage() { |
|
39 this("WRTApplicationFiles", "Application Files", "Specify application file names"); |
|
40 } |
|
41 |
|
42 protected NewWrtAppTemplatePage(String name, String title, String description) { |
|
43 super(name, title, description); |
|
44 } |
|
45 |
|
46 public final void createControl(Composite parent) { |
|
47 Composite root = new Composite(parent, SWT.NONE); |
|
48 WizardPageSupport.create(this, bindingContext); |
|
49 root.setLayout(new GridLayout(2, false)); |
|
50 |
|
51 createLabel(root, "Name of main HTML:"); |
|
52 createText(root, IProjectTemplate.CommonKeys.main_html, "HTML file name", bindingContext); |
|
53 createLabel(root, ""); |
|
54 createLabel(root, ""); |
|
55 createLabel(root, "Name of CSS file:"); |
|
56 createText(root, IProjectTemplate.CommonKeys.main_css, "CSS file name", bindingContext); |
|
57 createLabel(root, ""); |
|
58 createLabel(root, ""); |
|
59 createLabel(root, "Name of JavaScript file:"); |
|
60 createText(root, IProjectTemplate.CommonKeys.main_js, "JavaScript file name", bindingContext); |
|
61 |
|
62 createLabel(root, ""); |
|
63 Button homeScreen = new Button(root, SWT.CHECK); |
|
64 homeScreen.setText("Enable HomeScreen"); |
|
65 |
|
66 createLabel(root, ""); |
|
67 createLabel(root, ""); |
|
68 |
|
69 IObservableValue view = SWTObservables.observeSelection(homeScreen); |
|
70 IObservableValue model = context.getParameterObservable(WizardContext.HOME_SCREEN); |
|
71 bindingContext.bindValue(view, model); |
|
72 |
|
73 addTemplateControls(root); |
|
74 |
|
75 setControl(root); |
|
76 } |
|
77 |
|
78 protected void addTemplateControls(Composite root) { |
|
79 // Subclasses may override |
|
80 } |
|
81 } |