Wizard page that acts as a base class for wizard pages that create new Java elements.
The class provides a input field for source folders (called container in this class) and
API to validate the enter source folder name.
chooseContainer() Opens a selection dialog that allows to select a source container.
protected IStatus
containerChanged() This method is a hook which gets called after the source folder's
text input field has changed.
protected void
createContainerControls(Composite parent, int nColumns) Creates the necessary controls (label, text field and browse button) to edit
the source folder location.
setPackageFragmentRoot(IPackageFragmentRoot root, boolean canBeModified) Sets the current source folder (model and text field) to the given package
fragment root.
Parameters: root - The new root. Parameters: canBeModified - if false the source folder field can not be changed by the user.
Opens a selection dialog that allows to select a source container.
returns the selected package fragment root or null if the dialog has been canceled.The caller typically sets the result to the container input field.
Clients can override this method if they want to offer a different dialog.
This method is a hook which gets called after the source folder's
text input field has changed. This default implementation updates
the model and returns an error status. The underlying model
is only valid if the returned status is OK.
the model's error status
createContainerControls
protected void createContainerControls(Composite parent, int nColumns)(Code)
Creates the necessary controls (label, text field and browse button) to edit
the source folder location. The method expects that the parent composite
uses a GridLayout as its layout manager and that the
grid layout has at least 3 columns.
Parameters: parent - the parent composite Parameters: nColumns - the number of columns to span. This number must begreater or equal three
Returns the text selection of the current editor. null is returned
when the current editor does not have focus or does not return a text selection.
Returns the text selection of the current editor or null. since: 3.0
Utility method to inspect a selection to find a Java element.
Parameters: selection - the selection to be inspected a Java element to be used as the initial selection, or null,if no Java element exists in the given selection
Returns the Java project of the currently selected package fragment root or null
if no package fragment root is configured.
The current Java project or null. since: 3.3
Returns the recommended maximum width for text fields (in pixels). This
method requires that createContent has been called before this method is
call. Subclasses may override to change the maximum width for text
fields.
the recommended maximum width for text fields.
Returns the IPackageFragmentRoot that corresponds to the current
value of the source folder field.
the IPackageFragmentRoot or null if the current sourcefolder value is not a valid package fragment root
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).
Parameters: fieldName - The name of the field that has changed (field id). For thesource folder the field id is CONTAINER
Initializes the source folder field with a valid package fragment root.
The package fragment root is computed from the given Java element.
Parameters: elem - the Java element used to compute the initial packagefragment root used as the source folder
Sets the current source folder (model and text field) to the given package
fragment root.
Parameters: root - The new root. Parameters: canBeModified - if false the source folder field can not be changed by the user. If true the field is editable
Methods inherited from org.eclipse.jdt.ui.wizards.NewElementWizardPage