public class RefactoringHistoryWizard extends Wizard
A refactoring history wizard is usually opened using the WizardDialog
.
Clients must ensure that the calling thread holds the workspace lock.
Note: this class is intended to be extended by clients.
Refactoring
,
RefactoringHistory
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_CODE_INTERRUPTED
The status code representing an interrupted operation.
|
DEFAULT_IMAGE
Constructor and Description |
---|
RefactoringHistoryWizard(boolean overview,
String caption,
String title,
String description)
Creates a new refactoring history wizard.
|
RefactoringHistoryWizard(String caption,
String title,
String description)
Creates a new refactoring history wizard.
|
Modifier and Type | Method and Description |
---|---|
protected RefactoringStatus |
aboutToPerformHistory(IProgressMonitor monitor)
Hook method which is called before the first refactoring of the history
is executed.
|
protected RefactoringStatus |
aboutToPerformRefactoring(Refactoring refactoring,
RefactoringDescriptor descriptor,
IProgressMonitor monitor)
Hook method which is called before the a refactoring of the history is
executed.
|
void |
addPage(IWizardPage page)
Adds a new page to this wizard.
|
void |
addPages()
The
Wizard implementation of this IWizard
method does nothing. |
protected void |
addUserDefinedPages()
Adds user defined wizard pages in front of the wizard.
|
boolean |
canFinish()
Returns whether this wizard could be finished without further user
interaction.
|
protected Refactoring |
createRefactoring(RefactoringDescriptor descriptor,
RefactoringStatus status)
Deprecated.
since 3.6. Override
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor) instead |
protected Refactoring |
createRefactoring(RefactoringDescriptor descriptor,
RefactoringStatus status,
IProgressMonitor monitor)
Deprecated.
since 3.7. Override
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor) instead |
protected RefactoringContext |
createRefactoringContext(RefactoringDescriptor descriptor,
RefactoringStatus status,
IProgressMonitor monitor)
Creates a refactoring context from the specified refactoring descriptor.
|
void |
dispose()
The
Wizard implementation of this IWizard
method disposes all the pages controls using
DialogPage.dispose . |
org.eclipse.ltk.internal.ui.refactoring.IErrorWizardPage |
getErrorPage()
Returns the error wizard page.
|
IWizardPage |
getNextPage(IWizardPage page)
Returns the successor of the given page.
|
org.eclipse.ltk.internal.ui.refactoring.IPreviewWizardPage |
getPreviewPage()
Returns the preview wizard page.
|
IWizardPage |
getPreviousPage(IWizardPage page)
Returns the predecessor of the given page.
|
protected RefactoringStatus |
historyPerformed(IProgressMonitor monitor)
Hook method which is called when all refactorings of the history have
been executed.
|
boolean |
performCancel()
The
Wizard implementation of this IWizard
method does nothing and returns true . |
boolean |
performFinish()
Subclasses must implement this
IWizard method to perform
any special finish processing for their wizard. |
RefactoringStatus |
performPreviewChange(Change change,
Refactoring refactoring)
Performs the change previously displayed in the preview.
|
protected RefactoringStatus |
refactoringPerformed(Refactoring refactoring,
IProgressMonitor monitor)
Hook method which is called when the specified refactoring has been
performed, e.g. its change object has been successfully applied to the
workspace.
|
protected boolean |
selectPreviewChange(Change change)
Hook method which is called for each change before it is displayed in a
preview page.
|
protected boolean |
selectStatusEntry(RefactoringStatusEntry entry)
Hook method which is called for each status entry before it is displayed
in a wizard page.
|
void |
setConfiguration(RefactoringHistoryControlConfiguration configuration)
Sets the refactoring history control configuration.
|
void |
setInput(RefactoringHistory history)
Sets the refactoring history.
|
createPageControls, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
public static final int STATUS_CODE_INTERRUPTED
Note: This API must not be used from outside the refactoring framework.
public RefactoringHistoryWizard(boolean overview, String caption, String title, String description)
Clients must ensure that the refactoring history and the refactoring history control configuration are set before opening the wizard in a dialog.
overview
- true
to show an overview of the refactorings,
false
otherwisecaption
- the caption of the wizard windowtitle
- the title of the overview pagedescription
- the description of the overview pagesetConfiguration(RefactoringHistoryControlConfiguration)
,
setInput(RefactoringHistory)
public RefactoringHistoryWizard(String caption, String title, String description)
Clients must ensure that the refactoring history and the refactoring history control configuration are set before opening the wizard in a dialog.
Calling his constructor is equivalent to
RefactoringHistoryWizard(boolean, String, String, String)
with
the first argument equal to true
.
caption
- the caption of the wizard windowtitle
- the title of the overview pagedescription
- the description of the overview pagesetConfiguration(RefactoringHistoryControlConfiguration)
,
setInput(RefactoringHistory)
protected RefactoringStatus aboutToPerformHistory(IProgressMonitor monitor)
This method is guaranteed to be called exactly once during the lifetime
of a refactoring history wizard. The default implementation does nothing
and returns a refactoring status of severity RefactoringStatus.OK
.
Subclasses may reimplement this method to perform any special processing.
Returning a status of severity RefactoringStatus.FATAL
will
terminate the execution of the refactorings.
monitor
- the progress monitor to useprotected RefactoringStatus aboutToPerformRefactoring(Refactoring refactoring, RefactoringDescriptor descriptor, IProgressMonitor monitor)
RefactoringStatus.OK
. This method may be
called from non-UI threads.
Subclasses may extend this method to perform any special processing.
Returning a status of severity RefactoringStatus.FATAL
will
terminate the execution of the current refactoring.
refactoring
- the refactoring about to be executeddescriptor
- the refactoring descriptormonitor
- the progress monitor to usepublic final void addPage(IWizardPage page)
addUserDefinedPages()
.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
.protected void addUserDefinedPages()
Clients may extend this method to add custom wizard pages in front of the wizard.
public boolean canFinish()
The result of this method is typically used by the wizard container to enable or disable the Finish button.
protected Refactoring createRefactoring(RefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor)
insteadSubclasses may reimplement this method to customize the initialization of a refactoring.
descriptor
- the refactoring descriptorstatus
- a refactoring status describing the outcome of the
initializationnull
if this refactoring
descriptor represents the unknown refactoring, or if no
refactoring contribution is available for this refactoring
descriptorCoreException
- if an error occurs while creating the refactoring instanceprotected Refactoring createRefactoring(RefactoringDescriptor descriptor, RefactoringStatus status, IProgressMonitor monitor) throws CoreException
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor)
instead
The default implementation calls createRefactoring(RefactoringDescriptor, RefactoringStatus)
followed by
aboutToPerformRefactoring(Refactoring, RefactoringDescriptor, IProgressMonitor)
.
Implementors can replace this implementation.
descriptor
- the refactoring descriptorstatus
- the refactoring statusmonitor
- the progress monitor to usenull
if this refactoring
descriptor represents the unknown refactoring, or if no
refactoring contribution is available for this refactoring
descriptorCoreException
- if an error occurs while creating the refactoring instanceprotected RefactoringContext createRefactoringContext(RefactoringDescriptor descriptor, RefactoringStatus status, IProgressMonitor monitor) throws CoreException
The default implementation calls
RefactoringDescriptor.createRefactoringContext(RefactoringStatus)
followed by
aboutToPerformRefactoring(Refactoring, RefactoringDescriptor, IProgressMonitor)
.
Implementors can replace this implementation.
descriptor
- the refactoring descriptorstatus
- the refactoring statusmonitor
- the progress monitor to usenull
if this refactoring descriptor
represents the unknown refactoring, or if no refactoring contribution is available
for this refactoring descriptorCoreException
- if an error occurs while creating the refactoring contextpublic void dispose()
Wizard
implementation of this IWizard
method disposes all the pages controls using
DialogPage.dispose
. Subclasses should extend this method
if the wizard instance maintains addition SWT resource that need to be
disposed.public final org.eclipse.ltk.internal.ui.refactoring.IErrorWizardPage getErrorPage()
Note: This API must not be called from outside the refactoring framework.
public IWizardPage getNextPage(IWizardPage page)
This method is typically called by a wizard page
getNextPage
in interface IWizard
getNextPage
in class Wizard
page
- the pagenull
if nonepublic final org.eclipse.ltk.internal.ui.refactoring.IPreviewWizardPage getPreviewPage()
Note: This API must not be called from outside the refactoring framework.
public 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 noneprotected RefactoringStatus historyPerformed(IProgressMonitor monitor)
This method is guaranteed to be called exactly once during the lifetime
of a refactoring history wizard. It is not guaranteed that the user
interface has not already been disposed of. The default implementation
does nothing and returns a refactoring status of severity
RefactoringStatus.OK
.
Subclasses may reimplement this method to perform any special processing.
monitor
- the progress monitor to usepublic boolean performCancel()
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 boolean performFinish()
IWizard
method to perform
any special finish processing for their wizard.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 final RefactoringStatus performPreviewChange(Change change, Refactoring refactoring)
Note: This API must not be called from outside the refactoring framework.
change
- the change displayed in the previewrefactoring
- the associated refactoringprotected RefactoringStatus refactoringPerformed(Refactoring refactoring, IProgressMonitor monitor)
RefactoringStatus.OK
. This method
may be called from non-UI threads.
Subclasses may reimplement this method to perform any special processing.
Returning a status of severity RefactoringStatus.FATAL
will
terminate the execution of the refactorings.
refactoring
- the refactoring which has been performedmonitor
- the progress monitor to useprotected boolean selectPreviewChange(Change change)
true
.
Subclasses may reimplement this method to perform any special filtering of preview changes.
change
- the change to selecttrue
if the change passes the filter,
false
otherwiseprotected boolean selectStatusEntry(RefactoringStatusEntry entry)
true
.
Subclasses may reimplement this method to perform any special filtering of status entries on error pages.
entry
- the status entry to selecttrue
if the status entry passes the filter,
false
otherwisepublic final void setConfiguration(RefactoringHistoryControlConfiguration configuration)
This method must be called before opening the wizard in a dialog.
configuration
- the configuration to setpublic final void setInput(RefactoringHistory history)
This method must be called before opening the wizard in a dialog.
history
- the refactoring history
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.