public abstract class RefactoringWizard extends Wizard
RefactoringWizardPage
can be added to a refactoring wizard. Trying to
add a different kind of page results in an exception.
A refactoring wizard is best opened using the RefactoringWizardOpenOperation
.
Clients may extend this class.
Refactoring
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_INITIAL_CONDITIONS_ON_OPEN
Flag (value 1) indicating that the initial condition checking of the refactoring is done when
the wizard opens.
|
static int |
DIALOG_BASED_UESR_INTERFACE
Deprecated.
Use
DIALOG_BASED_USER_INTERFACE instead. |
static int |
DIALOG_BASED_USER_INTERFACE
Flag (value 4) indicating that a lightweight dialog based user interface should
be used to present this refactoring wizard.
|
static int |
NO_BACK_BUTTON_ON_STATUS_DIALOG
Flag (value 64) indicating that the dialog representing the refactoring
status to the user will not contain a back button.
|
static int |
NO_PREVIEW_PAGE
Flag (value 16) indicating that the wizard should not show a preview page.
|
static int |
NONE
Flag (value 0) indicating that no special flags are provided.
|
static int |
PREVIEW_EXPAND_FIRST_NODE
Flag (value 32) indicating that the first change node presented in the
preview page should be fully expanded.
|
static int |
SHOW_HELP_CONTROL
Flag (value 128) indicating that a help control should be shown.
|
static int |
WIZARD_BASED_USER_INTERFACE
Flag (value 2) indicating that a normal wizard based user interface consisting
of a back, next, finish and cancel button should be used to present
this refactoring wizard.
|
static int |
YES_NO_BUTTON_STYLE
Flag (value 8) indicating that the finish and cancel button should be named
yes and no.
|
DEFAULT_IMAGE
Constructor and Description |
---|
RefactoringWizard(RefactoringContext refactoringContext,
int flags)
Creates a new refactoring wizard for the given refactoring context.
|
RefactoringWizard(Refactoring refactoring,
int flags)
Creates a new refactoring wizard for the given refactoring.
|
Modifier and Type | Method and Description |
---|---|
void |
addPage(IWizardPage page)
Adds a new page to this wizard.
|
void |
addPages()
The
Wizard implementation of this IWizard
method does nothing. |
protected abstract void |
addUserInputPages()
Hook method to add user input pages to this refactoring wizard.
|
boolean |
canFinish()
Returns whether this wizard could be finished without further user
interaction.
|
Change |
getChange()
Returns the refactoring's change object or
null if no change
object has been created yet. |
String |
getDefaultPageTitle()
Returns the default page title used for pages that don't provide their
own page title.
|
int |
getMessageLineWidthInChars()
Returns the width in characters to be used for the message line embedded into
the refactoring wizard dialog.
|
IWizardPage |
getPreviousPage(IWizardPage page)
Returns the predecessor of the given page.
|
Refactoring |
getRefactoring()
Returns the refactoring this wizard is associated with.
|
RefactoringContext |
getRefactoringContext()
Returns the refactoring context this wizard is associated with, or
null if none. |
IWizardPage |
getStartingPage()
Returns the first page to be shown in this wizard.
|
int |
getWizardFlags()
Returns the refactoring wizard flags that have been set for this wizard.
|
Change |
internalCreateChange(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api,
CreateChangeOperation operation,
boolean updateStatus)
Note: This method is for internal use only.
|
boolean |
internalGetExpandFirstNode(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
Note: This method is for internal use only.
|
boolean |
internalHasPreviewPage(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
Note: This method is for internal use only.
|
boolean |
internalIsYesNoStyle(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
Note: This method is for internal use only.
|
org.eclipse.ltk.internal.ui.refactoring.FinishResult |
internalPerformFinish(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api,
PerformChangeOperation op)
Note: This method is for internal use only.
|
void |
internalSetChange(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api,
Change change)
Note: This method is for internal use only.
|
void |
internalSetPreviewShown(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api,
boolean shown)
Note: This method is for internal use only.
|
boolean |
internalShowBackButtonOnStatusDialog(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
Note: This method is for internal use only.
|
boolean |
performCancel()
The
Wizard implementation of this IWizard
method does nothing and returns true . |
boolean |
performFinish()
Calls
RefactoringWizardPage.performFinish() on the currently active wizard page. |
void |
setChangeCreationCancelable(boolean isChangeCreationCancelable)
If set to
true the change creation is cancelable by the user. |
void |
setDefaultPageTitle(String defaultPageTitle)
Sets the default page title to the given value.
|
void |
setForcePreviewReview(boolean forcePreviewReview)
If set to
true the Finish or OK button, respectively will
be disabled until the user has visited the preview page. |
void |
setHelpAvailable(boolean b)
Deprecated.
WIZARD_BASED_USER_INTERFACE always shows a '?' button.
To show the button with DIALOG_BASED_USER_INTERFACE , add the SHOW_HELP_CONTROL flag. |
void |
setInitialComputationContext(IRunnableContext context)
Sets the runnable context that will be used to computing refactoring conditions and change
while the refactoring dialog is not yet shown.
|
void |
setInitialConditionCheckingStatus(RefactoringStatus status)
Sets the initial condition checking status computed by the refactoring.
|
createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getShell, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
public static final int NONE
public static final int CHECK_INITIAL_CONDITIONS_ON_OPEN
public static final int WIZARD_BASED_USER_INTERFACE
DIALOG_BASED_USER_INTERFACE
.public static final int DIALOG_BASED_USER_INTERFACE
WIZARD_BASED_USER_INTERFACE
.public static final int DIALOG_BASED_UESR_INTERFACE
DIALOG_BASED_USER_INTERFACE
instead.public static final int YES_NO_BUTTON_STYLE
WIZARD_BASED_USER_INTERFACE
is specified.public static final int NO_PREVIEW_PAGE
WIZARD_BASED_USER_INTERFACE
is specified.public static final int PREVIEW_EXPAND_FIRST_NODE
public static final int NO_BACK_BUTTON_ON_STATUS_DIALOG
WIZARD_BASED_USER_INTERFACE
is specified.public static final int SHOW_HELP_CONTROL
WIZARD_BASED_USER_INTERFACE
is specified (the '?' button is always shown there).TrayDialog.setHelpAvailable(boolean)
,
Constant Field Valuespublic RefactoringWizard(Refactoring refactoring, int flags)
refactoring
- the refactoring the wizard is presentingflags
- flags specifying the behavior of the wizard. If neither
WIZARD_BASED_USER_INTERFACE
nor DIALOG_BASED_UESR_INTERFACE
is specified then WIZARD_BASED_USER_INTERFACE
will be
taken as a default.public RefactoringWizard(RefactoringContext refactoringContext, int flags)
refactoringContext
- the refactoringContext the wizard is presentingflags
- flags specifying the behavior of the wizard. If neither
WIZARD_BASED_USER_INTERFACE
nor DIALOG_BASED_UESR_INTERFACE
is specified then WIZARD_BASED_USER_INTERFACE
will be
taken as a default.public final Refactoring getRefactoring()
public final RefactoringContext getRefactoringContext()
null
if none.null
public final int getWizardFlags()
public final void setDefaultPageTitle(String defaultPageTitle)
defaultPageTitle
- the default page title.Wizard.setDefaultPageImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
public final String getDefaultPageTitle()
null
if non has been setsetDefaultPageTitle(String)
public final void setForcePreviewReview(boolean forcePreviewReview)
true
the Finish or OK button, respectively will
be disabled until the user has visited the preview page. If set to
false
the refactoring can be performed before the preview
page has been visited.forcePreviewReview
- if true
to user must confirm the
previewpublic int getMessageLineWidthInChars()
Subclasses may override this method and return a different value.
public final void setChangeCreationCancelable(boolean isChangeCreationCancelable)
true
the change creation is cancelable by the user.
By default, change creation is cancelable.
isChangeCreationCancelable
- determines whether the change creation
is cancelable by the user or not.Refactoring.createChange(IProgressMonitor)
public final void setInitialConditionCheckingStatus(RefactoringStatus status)
status
- the initial condition checking status.Refactoring.checkInitialConditions(IProgressMonitor)
,
CHECK_INITIAL_CONDITIONS_ON_OPEN
public final Change getChange()
null
if no change
object has been created yet.null
Refactoring.createChange(IProgressMonitor)
public void setHelpAvailable(boolean b)
WIZARD_BASED_USER_INTERFACE
always shows a '?' button.
To show the button with DIALOG_BASED_USER_INTERFACE
, add the SHOW_HELP_CONTROL
flag.Wizard
The result of this method is typically used by the container to show or hide the button labeled "Help".
Note: This wizard's container might be a TrayDialog
which provides
its own help support that is independent of this property.
Note 2: In the default WizardDialog
implementation, the "Help"
button only works when IDialogPage.performHelp()
is implemented.
setHelpAvailable
in class Wizard
b
- true
if help is available, false
otherwiseWizard.isHelpAvailable()
,
TrayDialog.isHelpAvailable()
,
TrayDialog.setHelpAvailable(boolean)
public final void addPages()
Wizard
implementation of this IWizard
method does nothing. Subclasses should extend if extra pages need to be
added before the wizard opens. New pages should be added by calling
addPage
.
This method calls the hook method addUserInputPages()
to allow
subclasses to add specific user input pages.public final void addPage(IWizardPage page)
RefactoringWizardPage
.protected abstract void addUserInputPages()
UserInputWizardPage
.
Adding pages of a different kind is not permitted and will result
in unexpected behavior.public IWizardPage getStartingPage()
getStartingPage
in interface IWizard
getStartingPage
in class Wizard
public void setInitialComputationContext(IRunnableContext context)
context
- a runnable context, or null
to re-set the defaultpublic IWizardPage getPreviousPage(IWizardPage page)
This method is typically called by a wizard page
getPreviousPage
in interface IWizard
getPreviousPage
in class Wizard
page
- the pagenull
if nonepublic boolean canFinish()
The result of this method is typically used by the wizard container to enable or disable the Finish button.
public final Change internalCreateChange(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api, CreateChangeOperation operation, boolean updateStatus)
api
- internal instance to avoid access from external clientsoperation
- the create change operationupdateStatus
- flag indicating if status updating is requestedpublic final org.eclipse.ltk.internal.ui.refactoring.FinishResult internalPerformFinish(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api, PerformChangeOperation op)
api
- internal instance to avoid access from external clientsop
- the perform change operationpublic boolean performFinish()
RefactoringWizardPage.performFinish()
on the currently active wizard page.
Clients are not expected to extend this method to do lengthy processing
(the Refactoring
class should implement analysis and Change
creation).performFinish
in interface IWizard
performFinish
in class Wizard
true
to indicate the finish request
was accepted, and false
to indicate
that the finish request was refusedpublic boolean performCancel()
Wizard
Wizard
implementation of this IWizard
method does nothing and returns true
. Subclasses should
reimplement this method if they need to perform any special cancel
processing for their wizard.performCancel
in interface IWizard
performCancel
in class Wizard
true
to indicate the cancel request
was accepted, and false
to indicate
that the cancel request was refusedpublic final boolean internalHasPreviewPage(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
api
- internal instance to avoid access from external clientspublic final boolean internalIsYesNoStyle(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
api
- internal instance to avoid access from external clientspublic final boolean internalGetExpandFirstNode(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
api
- internal instance to avoid access from external clientspublic final void internalSetChange(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api, Change change)
api
- internal instance to avoid access from external clientschange
- the change to setpublic final void internalSetPreviewShown(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api, boolean shown)
api
- internal instance to avoid access from external clientsshown
- a boolean indicating if the preview page has been shown or notpublic final boolean internalShowBackButtonOnStatusDialog(org.eclipse.ltk.internal.ui.refactoring.InternalAPI api)
api
- internal instance to avoid access from external clients
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.