|
Eclipse JDT Release 3.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
org.eclipse.jdt.ui.wizards.NewElementWizardPage
org.eclipse.jdt.ui.wizards.NewContainerWizardPage
org.eclipse.jdt.ui.wizards.NewTypeWizardPage
org.eclipse.jdt.junit.wizards.NewTestSuiteWizardPage
public class NewTestSuiteWizardPage
The class NewTestSuiteWizardPage
contains controls and validation routines
for the single page in the 'New JUnit TestSuite Wizard'.
Clients can use the page as-is and add it to their own wizard, or extend it to modify validation or add and remove controls.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.jdt.ui.wizards.NewTypeWizardPage |
---|
NewTypeWizardPage.ImportsManager |
Field Summary | |
---|---|
static String |
CLASSES_IN_SUITE
Field ID of the class in suite field. |
static String |
COMMENT_START
|
static String |
END_MARKER
The string used to mark the end of the generated code |
static String |
NON_COMMENT_END_MARKER
|
static String |
NON_COMMENT_START_MARKER
|
static String |
START_MARKER
The string used to mark the beginning of the generated code |
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 | |
---|---|
NewTestSuiteWizardPage()
Creates a new NewTestSuiteWizardPage . |
Method Summary | |
---|---|
protected void |
createClassesInSuiteControl(Composite parent,
int nColumns)
Creates the controls for the list of classes in the suite. |
void |
createControl(Composite parent)
|
protected void |
createMethodStubSelectionControls(Composite composite,
int nColumns)
Creates the controls for the method stub selection buttons. |
void |
createType(IProgressMonitor monitor)
Creates the new type using the entered field values. |
protected void |
createTypeMembers(IType type,
NewTypeWizardPage.ImportsManager imports,
IProgressMonitor monitor)
Hook method that gets called from createType to support adding of
unanticipated methods, fields, and inner types to the created type. |
protected void |
handleFieldChanged(String fieldName)
Hook method that gets called when a field on this page has changed. |
boolean |
hasUpdatedExistingClass()
Returns true iff an existing suite() method has been replaced. |
void |
init(IStructuredSelection selection)
Should be called from the wizard with the initial selection. |
void |
setVisible(boolean visible)
|
protected IStatus |
typeNameChanged()
Hook method that gets called when the type name has changed. |
protected void |
updateClassesInSuiteTable()
Updates the classes in the suite table. |
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 |
Field Detail |
---|
public static final String NON_COMMENT_END_MARKER
public static final String NON_COMMENT_START_MARKER
public static final String COMMENT_START
public static final String START_MARKER
public static final String END_MARKER
public static final String CLASSES_IN_SUITE
Constructor Detail |
---|
public NewTestSuiteWizardPage()
NewTestSuiteWizardPage
.
Method Detail |
---|
public void createControl(Composite parent)
protected void createMethodStubSelectionControls(Composite composite, int nColumns)
GridLayout
with
at least 3 columns.
composite
- the parent compositenColumns
- number of columns to spanpublic void init(IStructuredSelection selection)
selection
- the initial selectionprotected void handleFieldChanged(String fieldName)
NewContainerWizardPage
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).
handleFieldChanged
in class NewTypeWizardPage
fieldName
- The name of the field that has changed (field id). For the
source folder the field id is CONTAINER
public void setVisible(boolean visible)
setVisible
in interface IDialogPage
setVisible
in class NewElementWizardPage
protected void updateClassesInSuiteTable()
protected void createClassesInSuiteControl(Composite parent, int nColumns)
GridLayout
with
at least 3 columns.
parent
- the parent compositenColumns
- number of columns to spanprotected void createTypeMembers(IType type, NewTypeWizardPage.ImportsManager imports, IProgressMonitor monitor) throws CoreException
NewTypeWizardPage
createType
to support adding of
unanticipated methods, fields, and inner types to the created type.
Implementers can use any methods defined on IType
to manipulate the
new type.
The source code of the new type will be formatted using the platform's formatter. Needed imports are added by the wizard at the end of the type creation process using the given import manager.
createTypeMembers
in class NewTypeWizardPage
type
- the new type created via createType
imports
- an import manager which can be used to add new importsmonitor
- a progress monitor to report progress. Must not be null
CoreException
- thrown when creation of the type members failedNewTypeWizardPage.createType(IProgressMonitor)
public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException
NewTypeWizardPage
createType
in class NewTypeWizardPage
monitor
- a progress monitor to report progress.
CoreException
- Thrown when the creation failed.
InterruptedException
- Thrown when the operation was canceled.public boolean hasUpdatedExistingClass()
true
is returned if an existing test suite has been replacedprotected IStatus typeNameChanged()
NewTypeWizardPage
Subclasses may extend this method to perform their own validation.
typeNameChanged
in class NewTypeWizardPage
|
Eclipse JDT Release 3.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |