History log of /sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizardState.java
Revision Date Author Comments
4ef523b33a392e6c9ca407222d7780e8534b2905 24-Aug-2012 Tor Norbye <tnorbye@google.com> Add target SDK setting to the New Project wizard

Since the first page is getting too large, rather than add
one more, split some of the contents into a second page.
In addition, the new project dialog was missing a workset
chooser like the old wizard had, so add one in on the new
page now that we have plenty room for it. Some other tweaks
as well based on input from Xav.

Change-Id: I4dd2334b2f5af623cba4bbb3a6d2d0b053d1763f
32cfe7a5da41360a66820a056b71ce8b9a10bc60 27-Jul-2012 Tor Norbye <tnorbye@google.com> Add support for theme selection in new projects

The project templates now contain a variable for controlling the
initial theme used with the project. This changeset adds support for
this in the New Project wizard, since it has custom UI code rather
than being data driven like most of the templates. In particular, it
conditionally adds the theme selector if it's available in the
template, and it handles validation based on the build target.
There's some code reorganization to be able to share UI code between
the New Template Page and the New Project Page.

Change-Id: I53e5602a0a983c4a1aea9ae7fc5cd1054ccd4e69
c58247bd46d86afe244d2d9dd9160da10e0db648 25-Jul-2012 Tor Norbye <tnorbye@google.com> Template support for minimum build target

This changeset adds a minBuildApi attribute to the <template>
element which can be used to require a minimum level of build
target (which can be higher than the template's required
minimum API). As with the minimum API, this can be specified
both on the root element, as well as on <option> elements.

Examples:
name="New Blank Activity"
+ minBuildApi="12"
description="Creates a new blank activity, with optional inner navigation.">
<parameter id="navType" ...>
<option id="tabs_pager" minApi="14">Tabs + Swipe</option>
+ <option id="pager_strip" minApi="14" minBuildApi="15">Swipe Views + Title Strip</option>
<option id="dropdown" minApi="14">Dropdown</option>

Change-Id: I9d5b426bf2d440103a57f2a99ba6713cd6e7afaa
c9144be8def70a05dc90bed61a63bc58321aa963 21-Jun-2012 Siva Velusamy <vsiva@google.com> NPW: Allow specifying custom location for project.

Change-Id: Ide4e3ea8bf0f53cd4fc21dd23329f45c7f901618
6d1e4fdd6b2132b895aae80de3dba83c3960d43f 21-Jun-2012 Tor Norbye <tnorbye@google.com> Miscellaneous wizard fixes

* Add minSdk requirements on templates, and attempting to pick a
template with a higher minimum SDK than the one used by the current
project will result in a validation error message (and the Next
button is disabled).

Similarly, add a minSdk requirement on options, such as the
BlankActivity's navigation type. This is used to block all
navigation types except for "none", unless minSdkVersion >= 14.

* Add a buildApi property, which the templates use to only
conditionally write contents which requires a higher compilation
target. For example, the values-v11 and values-v14 folders
specifying Theme.Holo.Light and Theme.Holo.Light.DarkActionBar are
only written if the build target is at least 11 and 14 respectively.

* Fix some other minor issues which prevented the projects from
compiling with low minSdkVersions and low build targets.

* Replace the default simple activity's layout (which was just a
<TextView> with a center gravity, with a <RelativeLayout> containing
the <TextView> with center constraints

* Make the code which combines the list of templates from extras/ and
tools/ smarter; instead of just concatenating the two lists, it now
compares them, and when they have the same names (same templates,
different versions), it now chooses which one to use based on the
template revision number in the metadata file.

Moved some code out of TemplateHandler and into a new TemplateManager
class, such that I could add metadata caching (since the code to merge
templates in multiple files would repeatedly read and parse the
metadata for each pair comparison.)

Change-Id: I94fc4f754dd7125b5be5c78e61efcfc268f73af5
93fcf4cee5a95dca2427d49a7a73fc8ddac3812c 15-Jun-2012 Tor Norbye <tnorbye@google.com> Project wizard tweaks

Get rid of the ApplicationSkeleton page, and move the Create Custom
Icon checkbox up to the front page. Also add a new "Mark as library
project" checkbox there, which allows to create a new library project.
Move the icon page up such that it appears before the activity
template pages. Fix a bug in minSdk handling. And get rid of the
"Android Blank Project" wizard since it's now redundant with the
Android Application Project.

Change-Id: I54ea0bb740ad8078008a832799378694f37bf9e0
56afaff9c34a60c0e850324938d101a0509f8a38 26-May-2012 Tor Norbye <tnorbye@google.com> Allow project templates to be bundled separately

This changeset moves the various FreeMarker templates out of the ADT
plugin and over into the tools install area. The code to instantiate
templates is simplified a bit now that it no longer needs to both
handle files on disk and files read out of the .jar.

There's a new first page to the various template wizards which is
shown if the tools are not up to date (specifically, if the
$SDK/tools/templates/ directory does not exist). This page explains
that the tools have to be updated, and the Next button is disabled
until they are up to date.

This CL also contains some other tweaks suggested by Roman to the
activity-to-layout name mapping and misc code changes.

Change-Id: I3bc65f54a6b79bbeedfb917a9d34ec0d312f3526
7dd444ea0125e50a5e88604afb6de43e80b7c270 08-May-2012 Tor Norbye <tnorbye@google.com> New Template Wizard support

This changeset adds several new templates, to create a new project, a
new activity, a new custom view, etc.

More importantly, it contains support for these wizards (and the
corresponding code generation) to be driven by templates.

A wizard contains metadata which provides a name, description and icon
for the template, as well as a list of parameters, along with type and
constraint metadata for those parameters. When a wizard is created for
this template, it automatically adds UI elements to input the
parameters and to validate the input. Parameters can also specify
their default values as templated expressions using the other
variables on the page, so in the New Blank Activity wizard for
example, editing the activity name automatically updates the suggested
layout name, by repeatedly evaluating a template expression to compute
a layout name from an activity name.

There's a recipe file for each template which states what actions to
take to create the template. In addition to obviously copying
resources (such as icons and jar files) and instantiating templates
(to rewrite text using variables and FreeMarker logic), it can also
merge XML contents (to for example insert activity registration
metadata into the manifest file, or add string definitions to the
strings.xml file), and it can cause files to be opened when the
template is created.

Tne new wizards also use JFace's decorator support to provide help and
to mark text fields that contain errors, when one or more of the page
fields do not validate, as well as to show tip text along the bottom
of the page. One example of this is that it explains what a "package
name" is when the package field has focus.

This changeset also contains a "Template Development Wizard" which
lets you point to a local directory containing a template definition,
and run a test wizard from there. This is useful for developing,
debugging and testing templates.

Change-Id: I08e7d2464a1ef00d09517f0154c42681249a7ff6