org.eclipse.cdt.ui.wizards
Class NewClassCreationWizardPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.eclipse.cdt.internal.ui.wizards.NewElementWizardPage
              extended by org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public class NewClassCreationWizardPage
extends NewElementWizardPage


Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
NewClassCreationWizardPage()
          Constructor for NewClassCreationWizardPage
 
Method Summary
 void createClass(org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates the new class using the entered field values.
 void createControl(org.eclipse.swt.widgets.Composite parent)
           
 java.lang.String getClassName()
          Returns the class name entered into the class input field.
 org.eclipse.cdt.core.model.ICElement getCreatedClass()
          Returns the created class.
 org.eclipse.core.resources.IFile getCreatedHeaderFile()
          Returns the created header file.
 org.eclipse.core.resources.IFile getCreatedSourceFile()
          Returns the created source file.
 java.lang.String getHeaderFileText()
          Returns the text entered into the header file input field.
 java.lang.String getNamespaceText()
          Returns the text entered into the namespace input field.
 java.lang.String getSourceFileText()
          Returns the text entered into the source file input field.
 java.lang.String getSourceFolderText()
          Returns the text entered into the source folder input field.
 void init(org.eclipse.jface.viewers.IStructuredSelection selection)
          The wizard owning this page is responsible for calling this method with the current selection.
 boolean isNamespaceSelected()
          Returns the selection state of the namespace checkbox.
 boolean isUseDefaultSelected()
          Returns the selection state of the file group checkbox.
 boolean openClassInEditor()
          Returns whether the generated header and source files should be opened in editors after the finish button is pressed.
 void setClassName(java.lang.String name, boolean update)
          Sets the text of the class name input field.
 void setHeaderFileText(java.lang.String header, boolean update)
          Sets the text of the header file input field.
 void setNamespaceSelection(boolean isSelected, boolean canBeModified)
          Sets the namespace checkbox's selection state.
 void setNamespaceText(java.lang.String namespace, boolean update)
          Sets the text of the namespace input field.
 void setSourceFileText(java.lang.String source, boolean update)
          Sets the text of the source file input field.
 void setSourceFolderText(java.lang.String folder, boolean update)
          Sets the text of the source folder input field.
 void setUseDefaultSelection(boolean isSelected, boolean canBeModified)
          Sets the use default checkbox's selection state.
 void setVisible(boolean visible)
           
 boolean verifyBaseClasses()
          Checks if the base classes need to be verified (ie they must exist in the project)
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getMessageType, getTitle, performHelp, setMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp
 

Constructor Detail

NewClassCreationWizardPage

public NewClassCreationWizardPage()
Constructor for NewClassCreationWizardPage

Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)

init

public void init(org.eclipse.jface.viewers.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

getSourceFolderText

public java.lang.String getSourceFolderText()
Returns the text entered into the source folder input field.

Returns:
the source folder

setSourceFolderText

public void setSourceFolderText(java.lang.String folder,
                                boolean update)
Sets the text of the source folder input field.

Parameters:
folder - the folder name
update - true if the dialog should be updated

getNamespaceText

public java.lang.String getNamespaceText()
Returns the text entered into the namespace input field.

Returns:
the namespace

setNamespaceText

public void setNamespaceText(java.lang.String namespace,
                             boolean update)
Sets the text of the namespace input field.

Parameters:
namespace - the namespace name
update - true if the dialog should be updated

isNamespaceSelected

public boolean isNamespaceSelected()
Returns the selection state of the namespace checkbox.

Returns:
the selection state of the namespace checkbox

setNamespaceSelection

public void setNamespaceSelection(boolean isSelected,
                                  boolean canBeModified)
Sets the namespace checkbox's selection state.

Parameters:
isSelected - the checkbox's selection state
canBeModified - if true the checkbox is modifiable; otherwise it is read-only.

getClassName

public java.lang.String getClassName()
Returns the class name entered into the class input field.

Returns:
the class name

setClassName

public void setClassName(java.lang.String name,
                         boolean update)
Sets the text of the class name input field.

Parameters:
name - the new class name
update - true if the dialog should be updated

isUseDefaultSelected

public boolean isUseDefaultSelected()
Returns the selection state of the file group checkbox.

Returns:
the selection state of the file group checkbox

setUseDefaultSelection

public void setUseDefaultSelection(boolean isSelected,
                                   boolean canBeModified)
Sets the use default checkbox's selection state.

Parameters:
isSelected - the checkbox's selection state
canBeModified - if true the checkbox is modifiable; otherwise it is read-only.

getHeaderFileText

public java.lang.String getHeaderFileText()
Returns the text entered into the header file input field.

Returns:
the header file

setHeaderFileText

public void setHeaderFileText(java.lang.String header,
                              boolean update)
Sets the text of the header file input field.

Parameters:
header - the header file name
update - true if the dialog should be updated

getSourceFileText

public java.lang.String getSourceFileText()
Returns the text entered into the source file input field.

Returns:
the source file

setSourceFileText

public void setSourceFileText(java.lang.String source,
                              boolean update)
Sets the text of the source file input field.

Parameters:
source - the source file name
update - true if the dialog should be updated

setVisible

public void setVisible(boolean visible)
Specified by:
setVisible in interface org.eclipse.jface.dialogs.IDialogPage
Overrides:
setVisible in class NewElementWizardPage

verifyBaseClasses

public boolean verifyBaseClasses()
Checks if the base classes need to be verified (ie they must exist in the project)

Returns:
true if the base classes should be verified

createClass

public void createClass(org.eclipse.core.runtime.IProgressMonitor monitor)
                 throws org.eclipse.core.runtime.CoreException,
                        java.lang.InterruptedException
Creates the new class using the entered field values.

Parameters:
monitor - a progress monitor to report progress.
Throws:
org.eclipse.core.runtime.CoreException - Thrown when the creation failed.
java.lang.InterruptedException - Thrown when the operation was cancelled.

openClassInEditor

public boolean openClassInEditor()
Returns whether the generated header and source files should be opened in editors after the finish button is pressed.

Returns:
true if the header and source file should be displayed

getCreatedClass

public org.eclipse.cdt.core.model.ICElement getCreatedClass()
Returns the created class. The method only returns a valid class after createClass has been called.

Returns:
the created class
See Also:
createClass(IProgressMonitor)

getCreatedHeaderFile

public org.eclipse.core.resources.IFile getCreatedHeaderFile()
Returns the created header file. The method only returns a valid file after createClass has been called.

Returns:
the created header file
See Also:
createClass(IProgressMonitor)

getCreatedSourceFile

public org.eclipse.core.resources.IFile getCreatedSourceFile()
Returns the created source file. The method only returns a valid file after createClass has been called.

Returns:
the created source file
See Also:
createClass(IProgressMonitor)