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

java.lang.Object
  extended by WizardPage
      extended by org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage
          extended by org.eclipse.wst.jsdt.ui.wizards.NewContainerWizardPage
              extended by org.eclipse.wst.jsdt.ui.wizards.NewPackageWizardPage

public class NewPackageWizardPage
extends NewContainerWizardPage

Wizard page to create a new package.

Note: This class is not intended to be subclassed, but clients can instantiate. To implement a different kind of a new package wizard page, extend NewContainerWizardPage.

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
NewPackageWizardPage()
          Creates a new NewPackageWizardPage
 
Method Summary
 void createControl(Composite parent)
           
 void createPackage(IProgressMonitor monitor)
          Creates the new package using the entered field values.
 IResource getModifiedResource()
          Returns the resource handle that corresponds to the element to was created or will be created.
 IPackageFragment getNewPackageFragment()
          Returns the created package fragment.
 java.lang.String getPackageText()
          Returns the content of the package input field.
 IRunnableWithProgress getRunnable()
          Returns a runnable that creates a package using the current settings.
 void init(IStructuredSelection selection)
          The wizard owning this page is responsible for calling this method with the current selection.
 void setPackageText(java.lang.String str, boolean canBeModified)
          Sets the content of the package input field to the given value.
 void setVisible(boolean visible)
           
 
Methods inherited from class org.eclipse.wst.jsdt.ui.wizards.NewContainerWizardPage
getJavaProject, getPackageFragmentRoot, getPackageFragmentRootText, setPackageFragmentRoot
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewPackageWizardPage

public NewPackageWizardPage()
Creates a new NewPackageWizardPage

Method Detail

init

public void init(IStructuredSelection selection)
The wizard owning this page is responsible for calling this method with the current selection. The selection is used to initialize the fields of the wizard page.

Parameters:
selection - used to initialize the fields

createControl

public void createControl(Composite parent)

setVisible

public void setVisible(boolean visible)
Overrides:
setVisible in class NewElementWizardPage
See Also:
org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)

getPackageText

public java.lang.String getPackageText()
Returns the content of the package input field.

Returns:
the content of the package input field

setPackageText

public void setPackageText(java.lang.String str,
                           boolean canBeModified)
Sets the content of the package input field to the given value.

Parameters:
str - the new package input field text
canBeModified - if true the package input field can be modified; otherwise it is read-only.

getModifiedResource

public IResource getModifiedResource()
Returns the resource handle that corresponds to the element to was created or will be created.

Returns:
A resource or null if the page contains illegal values.

getRunnable

public IRunnableWithProgress getRunnable()
Returns a runnable that creates a package using the current settings.

Returns:
the runnable that creates the new package

getNewPackageFragment

public IPackageFragment getNewPackageFragment()
Returns the created package fragment. This method only returns a valid value after getRunnable or createPackage have been executed.

Returns:
the created package fragment

createPackage

public void createPackage(IProgressMonitor monitor)
                   throws CoreException,
                          java.lang.InterruptedException
Creates the new package using the entered field values.

Parameters:
monitor - a progress monitor to report progress. The progress monitor must not be null
Throws:
CoreException - Thrown if creating the package failed.
java.lang.InterruptedException - Thrown when the operation has been canceled.