public interface Refactoring
Modifier and Type | Method and Description |
---|---|
void |
doRefactoring(UsageInfo[] usages)
Performs all changes in code that are necessary.
|
UsageInfo[] |
findUsages()
Searches for places in code that refactoring will change.
|
boolean |
isInteractive()
Returns whether refactoring is interactive.
|
boolean |
isPreviewUsages()
Returns value of
previewUsages property. |
boolean |
preprocessUsages(Ref<UsageInfo[]> usages)
Analyses usages (presumably obtained from
findUsages() for possible conflicts
and (if refactoring is interactive) presents user with appropriate conflicts dialog. |
void |
run()
Runs the whole refactoring.
|
void |
setInteractive(java.lang.Runnable prepareSuccessfulCallback)
Controls whether this refactoring is interactive: whether it should show conflicts dialog
and other dialogs.
|
void |
setPreviewUsages(boolean value)
Controls whether refactoring shows a preview.
|
boolean |
shouldPreviewUsages(UsageInfo[] usages)
Checks whether usages need to be shown.
|
void setPreviewUsages(boolean value)
If there are modifications that should be performed in non-java files or not in code, preview will be shown regardless of this setting.
boolean isPreviewUsages()
previewUsages
property.
If there are modifications that should be performed in non-java files or not in code,
preview will be shown regardless of this setting.void setInteractive(java.lang.Runnable prepareSuccessfulCallback)
If prepareSuccessfulCallback
is not null
, refactoring is interactive, and
the callback is executed if user did not cancel the refactoring operation, right after
preprocessUsages
has finished.
If prepareSuccessfulCallback
is null
, user is not presented with
conflicts etc., but the preview may still be shown.
Note: the callback is executed in dispatch thread.
Refactorings are interactive by default, with empty runnable as a callback.
boolean isInteractive()
setInteractive(Runnable)
UsageInfo[] findUsages()
boolean preprocessUsages(Ref<UsageInfo[]> usages)
findUsages()
for possible conflicts
and (if refactoring is interactive) presents user with appropriate conflicts dialog.setInteractive(Runnable)
boolean shouldPreviewUsages(UsageInfo[] usages)
setPreviewUsages(boolean)
,
isPreviewUsages()
void doRefactoring(UsageInfo[] usages)
void run()
findUsages()
(with progress dialog and all)
preprocessUsages(Ref)
shouldPreviewUsages(UsageInfo[])
, and show the preview
doRefactoring(UsageInfo[])
if appropriate (if either the preview
was not shown, or 'Do Refactor' button has been pressed)