|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWizardPage
org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage
org.eclipse.wst.jsdt.ui.wizards.NewContainerWizardPage
org.eclipse.wst.jsdt.ui.wizards.NewTypeWizardPage
public abstract class NewTypeWizardPage
The class NewTypeWizardPage
contains controls and validation routines
for a 'New Type WizardPage'. Implementors decide which components to add and to enable.
Implementors can also customize the validation code. NewTypeWizardPage
is intended to serve as base class of all wizards that create types like applets, servlets, classes,
interfaces, etc.
See NewClassWizardPage
or NewInterfaceWizardPage
for an
example usage of the NewTypeWizardPage
.
NewClassWizardPage
,
NewInterfaceWizardPage
,
org.eclipse.wst.jsdt.ui.wizards.NewEnumWizardPage
,
org.eclipse.wst.jsdt.ui.wizards.NewAnnotationWizardPage
Nested Class Summary | |
---|---|
static class |
NewTypeWizardPage.ImportsManager
Class used in stub creation routines to add needed imports to a compilation unit. |
Field Summary | |
---|---|
static int |
ANNOTATION_TYPE
Constant to signal that the created type is an annotation. |
static int |
CLASS_TYPE
Constant to signal that the created type is a class. |
static int |
ENUM_TYPE
Constant to signal that the created type is an enum. |
int |
F_ABSTRACT
Abstract property flag. |
int |
F_FINAL
Final access flag. |
int |
F_PRIVATE
Private access flag. |
int |
F_PROTECTED
Protected access flag. |
int |
F_PUBLIC
Public access flag. |
int |
F_STATIC
Static access flag. |
static int |
INTERFACE_TYPE
Constant to signal that the created type is a interface. |
Constructor Summary | |
---|---|
NewTypeWizardPage(boolean isClass,
java.lang.String pageName)
Creates a new NewTypeWizardPage . |
|
NewTypeWizardPage(int typeKind,
java.lang.String pageName)
Creates a new NewTypeWizardPage . |
Method Summary | |
---|---|
boolean |
addSuperInterface(java.lang.String superInterface)
Adds a super interface to the end of the list and selects it if it is not in the list yet. |
void |
createType(IProgressMonitor monitor)
Creates the new type using the entered field values. |
void |
enableCommentControl(boolean useAddCommentValue)
Sets to use the 'Add comment' checkbox value. |
IType |
getCreatedType()
Returns the created type or null is the type has not been created yet. |
IType |
getEnclosingType()
Returns the enclosing type corresponding to the current input. |
java.lang.String |
getEnclosingTypeText()
Returns the text of the enclosing type input field. |
IResource |
getModifiedResource()
Returns the resource handle that corresponds to the compilation unit to was or will be created or modified. |
int |
getModifiers()
Returns the selected modifiers. |
IPackageFragment |
getPackageFragment()
Returns the package fragment corresponding to the current input. |
java.lang.String |
getPackageText()
Returns the text of the package input field. |
IRunnableWithProgress |
getRunnable()
Returns the runnable that creates the type using the current settings. |
java.lang.String |
getSuperClass()
Returns the content of the superclass input field. |
java.util.List |
getSuperInterfaces()
Returns the chosen super interfaces. |
java.lang.String |
getTypeName()
Returns the type name entered into the type input field. |
boolean |
isAddComments()
Returns if comments are added. |
boolean |
isEnclosingTypeSelected()
Returns the selection state of the enclosing type checkbox. |
void |
setAddComments(boolean doAddComments,
boolean canBeModified)
Sets 'Add comment' checkbox. |
void |
setEnclosingType(IType type,
boolean canBeModified)
Sets the enclosing type. |
void |
setEnclosingTypeSelection(boolean isSelected,
boolean canBeModified)
Sets the enclosing type checkbox's selection state. |
void |
setModifiers(int modifiers,
boolean canBeModified)
Sets the modifiers. |
void |
setPackageFragment(IPackageFragment pack,
boolean canBeModified)
Sets the package fragment to the given value. |
void |
setSuperClass(java.lang.String name,
boolean canBeModified)
Sets the super class name. |
void |
setSuperInterfaces(java.util.List interfacesNames,
boolean canBeModified)
Sets the super interfaces. |
void |
setTypeName(java.lang.String name,
boolean canBeModified)
Sets the type name input field's text to the given value. |
Methods inherited from class org.eclipse.wst.jsdt.ui.wizards.NewContainerWizardPage |
---|
getJavaProject, getPackageFragmentRoot, getPackageFragmentRootText, setPackageFragmentRoot |
Methods inherited from class org.eclipse.wst.jsdt.ui.wizards.NewElementWizardPage |
---|
setVisible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int F_PUBLIC
public int F_PRIVATE
public int F_PROTECTED
public int F_STATIC
public int F_FINAL
public int F_ABSTRACT
public static final int CLASS_TYPE
public static final int INTERFACE_TYPE
public static final int ENUM_TYPE
public static final int ANNOTATION_TYPE
Constructor Detail |
---|
public NewTypeWizardPage(boolean isClass, java.lang.String pageName)
NewTypeWizardPage
.
isClass
- true
if a new class is to be created; otherwise
an interface is to be createdpageName
- the wizard page's namepublic NewTypeWizardPage(int typeKind, java.lang.String pageName)
NewTypeWizardPage
.
typeKind
- Signals the kind of the type to be created. Valid kinds are
CLASS_TYPE
, INTERFACE_TYPE
, ENUM_TYPE
and ANNOTATION_TYPE
pageName
- the wizard page's nameMethod Detail |
---|
public java.lang.String getPackageText()
public java.lang.String getEnclosingTypeText()
public IPackageFragment getPackageFragment()
null
if the input
could not be resolved.public void setPackageFragment(IPackageFragment pack, boolean canBeModified)
pack
- the package fragment to be setcanBeModified
- if true
the package fragment is
editable; otherwise it is read-only.public IType getEnclosingType()
null
if the enclosing type is
not selected or the input could not be resolvedpublic void setEnclosingType(IType type, boolean canBeModified)
type
- the enclosing typecanBeModified
- if true
the enclosing type field is
editable; otherwise it is read-only.public boolean isEnclosingTypeSelected()
public void setEnclosingTypeSelection(boolean isSelected, boolean canBeModified)
isSelected
- the checkbox's selection statecanBeModified
- if true
the enclosing type checkbox is
modifiable; otherwise it is read-only.public java.lang.String getTypeName()
public void setTypeName(java.lang.String name, boolean canBeModified)
name
- the new type namecanBeModified
- if true
the type name field is
editable; otherwise it is read-only.public int getModifiers()
Flags
public void setModifiers(int modifiers, boolean canBeModified)
modifiers
- F_PUBLIC
, F_PRIVATE
,
F_PROTECTED
, F_ABSTRACT
, F_FINAL
or F_STATIC
or a valid combination.canBeModified
- if true
the modifier fields are
editable; otherwise they are read-onlyFlags
public java.lang.String getSuperClass()
public void setSuperClass(java.lang.String name, boolean canBeModified)
name
- the new superclass namecanBeModified
- if true
the superclass name field is
editable; otherwise it is read-only.public java.util.List getSuperInterfaces()
String
public void setSuperInterfaces(java.util.List interfacesNames, boolean canBeModified)
interfacesNames
- a list of super interface. The method requires that
the list's elements are of type String
canBeModified
- if true
the super interface field is
editable; otherwise it is read-only.public boolean addSuperInterface(java.lang.String superInterface)
superInterface
- the fully qualified type name of the interface.
true
if the interfaces has been added, false
if the interface already is in the list.public void setAddComments(boolean doAddComments, boolean canBeModified)
enableCommentControl(boolean)
doAddComments
- if true
, comments are added.canBeModified
- if true
check box is
editable; otherwise it is read-only.public void enableCommentControl(boolean useAddCommentValue)
useAddCommentValue
- if true
,public boolean isAddComments()
enableCommentControl(boolean)
, otherwise
the settings as specified in the preferences is used.
true
if comments can be addedpublic IResource getModifiedResource()
public void createType(IProgressMonitor monitor) throws CoreException, java.lang.InterruptedException
monitor
- a progress monitor to report progress.
CoreException
- Thrown when the creation failed.
java.lang.InterruptedException
- Thrown when the operation was canceled.public IType getCreatedType()
null
is the type has not been created yet. The method
only returns a valid type after createType
has been called.
createType(IProgressMonitor)
public IRunnableWithProgress getRunnable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |