org.eclipse.wst.jsdt.ui.wizards
Class NewJavaProjectWizardPage

java.lang.Object
  extended by WizardPage
      extended by org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage
          extended by 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
NewJavaProjectWizardPage(IWorkspaceRoot root, WizardNewProjectCreationPage mainpage)
          Creates a JavaScript project wizard creation page.
 
Method Summary
 void createControl(Composite parent)
           
 void dispose()
           
 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.
 IIncludePathEntry[] getRawClassPath()
          Returns the currently configured classpath.
 IRunnableWithProgress getRunnable()
          Returns the runnable that will create the JavaScript project.
 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 java.lang.Object
equals, 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.


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)

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