org.eclipse.wst.jsdt.ui.wizards

## Class NewJavaProjectWizardPage

- java.lang.Object
- - WizardPage
  - - org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage
    - - org.eclipse.wst.jsdt.ui.wizards.NewJavaProjectWizardPage

    public class NewJavaProjectWizardPage
    extends NewElementWizardPage

Standard wizard page for creating new JavaScript projects. This page can be used in project creation wizards for projects and will configure the project with the JavaScript nature. This page also allows the user to configure the JavaScript project's output location for class files generated by the JavaScript builder.

Whenever possible clients should use the class `JavaCapabilityConfigurationPage` in favor of this class.

Clients may instantiate or subclass.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Constructor Summary

Constructors
Constructor and Description
`NewJavaProjectWizardPage(IWorkspaceRoot root, WizardNewProjectCreationPage mainpage)` Creates a JavaScript project wizard creation page.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `createControl(Composite parent)`
`void` `dispose()`
`protected IPath` `getLocationPath()` Returns the project location path.
`IJavaScriptProject` `getNewJavaProject()` Returns the JavaScript project handle by converting the result of `getProjectHandle()` into a JavaScript project.
`IPath` `getOutputLocation()` Returns the currently configured output location.
`protected IProject` `getProjectHandle()` Returns the project handle.
`IIncludePathEntry[]` `getRawClassPath()` Returns the currently configured classpath.
`IRunnableWithProgress` `getRunnable()` Returns the runnable that will create the JavaScript project.
`protected void` `initBuildPaths()` Forces the initialization of the JavaScript project page.
`void` `setDefaultClassPath(IIncludePathEntry[] entries, boolean appendDefaultJRE)` Sets the default classpath to be used for the new JavaScript project.
`void` `setDefaultOutputFolder(IPath path)` Sets the default output location to be used for the new JavaScript project.
`void` `setProjectModified()` Sets the project state to modified.
`void` `setVisible(boolean visible)` Extend this method to set a user defined default classpath or output location.

### Methods inherited from class org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage

`updateStatus, updateStatus`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### NewJavaProjectWizardPage

    public NewJavaProjectWizardPage(IWorkspaceRoot root,
                                    WizardNewProjectCreationPage mainpage)

Creates a JavaScript project wizard creation page.

The JavaScript project wizard reads project name and location from the main page.

Parameters:
  `root` - the workspace root
  `mainpage` - the main page of the wizard

### Method Detail

#### dispose

    public void dispose()

#### setDefaultOutputFolder

    public void setDefaultOutputFolder(IPath path)

Sets the default output location to be used for the new JavaScript project. This is the path of the folder (with the project) into which the JavaScript builder will generate binary class files corresponding to the project's JavaScript source files.

The wizard will create this folder if required.

The default classpath will be applied when `initBuildPaths` is called. This is done automatically when the page becomes visible and the project or the default paths have changed.

Parameters:
  `path` - the folder to be taken as the default output path

#### setDefaultClassPath

    public void setDefaultClassPath(IIncludePathEntry[] entries,
                                    boolean appendDefaultJRE)

Sets the default classpath to be used for the new JavaScript project.

The caller of this method is responsible for creating the classpath entries for the `IJavaScriptProject` that corresponds to the created project. The caller is responsible for creating any new folders that might be mentioned on the classpath.

The default output location will be applied when `initBuildPaths` is called. This is done automatically when the page becomes visible and the project or the default paths have changed.

Parameters:
  `entries` - the default classpath entries
  `appendDefaultJRE` - `true` a variable entry for the default JRE (specified in the preferences) will be added to the classpath.

#### setProjectModified

    public void setProjectModified()

Sets the project state to modified. Doing so will initialize the page the next time it becomes visible.

#### getProjectHandle

    protected IProject getProjectHandle()

Returns the project handle. Subclasses should override this method if they don't provide a main page or if they provide their own main page implementation.

Returns:
  the project handle

#### getLocationPath

    protected IPath getLocationPath()

Returns the project location path. Subclasses should override this method if they don't provide a main page or if they provide their own main page implementation.

Returns:
  the project location path

#### getNewJavaProject

    public IJavaScriptProject getNewJavaProject()

Returns the JavaScript project handle by converting the result of `getProjectHandle()` into a JavaScript project.

Returns:
  the JavaScript project handle
See Also:
  `getProjectHandle()`

#### createControl

    public void createControl(Composite parent)

#### initBuildPaths

    protected void initBuildPaths()

Forces the initialization of the JavaScript project page. Default classpath or buildpath will be used if set. The initialization should only be performed when the project or default paths have changed. Toggling back and forward the pages without changes should not re-initialize the page, as changes from the user will be overwritten.

#### setVisible

    public void setVisible(boolean visible)

Extend this method to set a user defined default classpath or output location. The method `initBuildPaths` is called when the page becomes visible the first time or the project or the default paths have changed.

Overrides:
  `setVisible` in class `NewElementWizardPage`
Parameters:
  `visible` - if `true` the page becomes visible; otherwise it becomes invisible

#### getOutputLocation

    public IPath getOutputLocation()

Returns the currently configured output location. Note that the returned path might not be valid.

Returns:
  the configured output location

#### getRawClassPath

    public IIncludePathEntry[] getRawClassPath()

Returns the currently configured classpath. Note that the classpath might not be valid.

Returns:
  the configured classpath

#### getRunnable

    public IRunnableWithProgress getRunnable()

Returns the runnable that will create the JavaScript project. The runnable will create and open the project if needed. The runnable will add the JavaScript nature to the project, and set the project's classpath and output location.

To create the new JavaScript project, execute this runnable

Returns:
  the runnable