org.eclipse.xtext.xtend2.ui.wizards
Class NewXtend2ClassWizardPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.eclipse.jdt.ui.wizards.NewElementWizardPage
              extended by org.eclipse.jdt.ui.wizards.NewContainerWizardPage
                  extended by org.eclipse.jdt.ui.wizards.NewTypeWizardPage
                      extended by org.eclipse.xtext.xtend2.ui.wizards.NewXtend2ClassWizardPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public class NewXtend2ClassWizardPage
extends org.eclipse.jdt.ui.wizards.NewTypeWizardPage

Author:
Robert von Massow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
org.eclipse.jdt.ui.wizards.NewTypeWizardPage.ImportsManager
 
Field Summary
 
Fields inherited from class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
ANNOTATION_TYPE, CLASS_TYPE, ENCLOSING, ENCLOSINGSELECTION, ENUM_TYPE, F_ABSTRACT, F_FINAL, F_PRIVATE, F_PROTECTED, F_PUBLIC, F_STATIC, fEnclosingTypeStatus, fModifierStatus, fPackageStatus, fSuperClassStatus, fSuperInterfacesStatus, fTypeNameStatus, INTERFACE_TYPE, INTERFACES, METHODS, MODIFIERS, PACKAGE, SUPER, TYPENAME
 
Fields inherited from class org.eclipse.jdt.ui.wizards.NewContainerWizardPage
CONTAINER, fContainerStatus
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
NewXtend2ClassWizardPage()
           
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Creates the top level control for this dialog page under the given parent composite.
 int createType()
           
 void createType(org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates the new type using the entered field values.
 org.eclipse.core.resources.IResource getResource()
           
protected  void handleFieldChanged(java.lang.String fieldName)
          Hook method that gets called when a field on this page has changed.
protected  void init(org.eclipse.jface.viewers.IStructuredSelection selection)
           
 void setVisible(boolean visible)
          The DialogPage implementation of this IDialogPage method sets the control to the given visibility state.
protected  org.eclipse.core.runtime.IStatus typeNameChanged()
          Hook method that gets called when the type name has changed.
 
Methods inherited from class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
addSuperInterface, chooseEnclosingType, choosePackage, chooseSuperClass, chooseSuperInterfaces, constructCUContent, containerChanged, createCommentControls, createEnclosingTypeControls, createInheritedMethods, createModifierControls, createPackageControls, createSeparator, createSuperClassControls, createSuperInterfacesControls, createTypeMembers, createTypeNameControls, enableCommentControl, enclosingTypeChanged, getCompilationUnitName, getCreatedType, getEnclosingType, getEnclosingTypeLabel, getEnclosingTypeText, getFileComment, getFileComment, getModifiedResource, getModifiers, getModifiersLabel, getPackageFragment, getPackageLabel, getPackageText, getRunnable, getSuperClass, getSuperClassLabel, getSuperInterfaces, getSuperInterfacesLabel, getTemplate, getTemplate, getTypeComment, getTypeComment, getTypeName, getTypeNameLabel, initTypePage, isAddComments, isEnclosingTypeSelected, modifiersChanged, packageChanged, setAddComments, setEnclosingType, setEnclosingTypeSelection, setFocus, setModifiers, setPackageFragment, setSuperClass, setSuperInterfaces, setTypeName, superClassChanged, superInterfacesChanged
 
Methods inherited from class org.eclipse.jdt.ui.wizards.NewContainerWizardPage
chooseContainer, createContainerControls, getContainerLabel, getCurrentTextSelection, getInitialJavaElement, getJavaProject, getMaxFieldWidth, getPackageFragmentRoot, getPackageFragmentRootText, getWorkspaceRoot, initContainerPage, setFocusOnContainer, setPackageFragmentRoot
 
Methods inherited from class org.eclipse.jdt.ui.wizards.NewElementWizardPage
updateStatus, updateStatus
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

NewXtend2ClassWizardPage

public NewXtend2ClassWizardPage()
Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Description copied from interface: org.eclipse.jface.dialogs.IDialogPage
Creates the top level control for this dialog page under the given parent composite.

Implementors are responsible for ensuring that the created control can be accessed via getControl

Parameters:
parent - the parent composite

setVisible

public void setVisible(boolean visible)
Description copied from class: org.eclipse.jface.dialogs.DialogPage
The DialogPage implementation of this IDialogPage method sets the control to the given visibility state. Subclasses may extend.

Specified by:
setVisible in interface org.eclipse.jface.dialogs.IDialogPage
Overrides:
setVisible in class org.eclipse.jdt.ui.wizards.NewElementWizardPage
Parameters:
visible - true to make this page visible, and false to hide it

init

protected void init(org.eclipse.jface.viewers.IStructuredSelection selection)

createType

public void createType(org.eclipse.core.runtime.IProgressMonitor monitor)
                throws org.eclipse.core.runtime.CoreException,
                       java.lang.InterruptedException
Description copied from class: org.eclipse.jdt.ui.wizards.NewTypeWizardPage
Creates the new type using the entered field values.

Overrides:
createType in class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
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 canceled.

createType

public int createType()

handleFieldChanged

protected void handleFieldChanged(java.lang.String fieldName)
Description copied from class: org.eclipse.jdt.ui.wizards.NewContainerWizardPage
Hook method that gets called when a field on this page has changed. For this page the method gets called when the source folder field changes.

Every sub type is responsible to call this method when a field on its page has changed. Subtypes override (extend) the method to add verification when a own field has a dependency to an other field. For example the class name input must be verified again when the package field changes (check for duplicated class names).

Overrides:
handleFieldChanged in class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
Parameters:
fieldName - The name of the field that has changed (field id). For the source folder the field id is CONTAINER

typeNameChanged

protected org.eclipse.core.runtime.IStatus typeNameChanged()
Description copied from class: org.eclipse.jdt.ui.wizards.NewTypeWizardPage
Hook method that gets called when the type name has changed. The method validates the type name and returns the status of the validation.

Subclasses may extend this method to perform their own validation.

Overrides:
typeNameChanged in class org.eclipse.jdt.ui.wizards.NewTypeWizardPage
Returns:
the status of the validation

getResource

public org.eclipse.core.resources.IResource getResource()