|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.wst.jsdt.ui.refactoring.RenameSupport
public class RenameSupport
Central access point to execute rename refactorings.
Note: this class is not intended to be subclassed.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Field Summary | |
---|---|
static int |
NONE
Flag indication that no additional update is to be performed. |
static int |
UPDATE_GETTER_METHOD
Flag indicating that the getter method is to be updated as well. |
static int |
UPDATE_REFERENCES
Flag indicating that references are to be updated as well. |
static int |
UPDATE_SETTER_METHOD
Flag indicating that the setter method is to be updated as well. |
static int |
UPDATE_TEXTUAL_MATCHES
Flag indicating that textual matches in comments and in string literals are to be updated as well. |
Method Summary | |
---|---|
static RenameSupport |
create(IField field,
java.lang.String newName,
int flags)
Creates a new rename support for the given IField . |
static RenameSupport |
create(IFunction method,
java.lang.String newName,
int flags)
Creates a new rename support for the given IFunction . |
static RenameSupport |
create(IJavaScriptProject project,
java.lang.String newName,
int flags)
Creates a new rename support for the given IJavaScriptProject . |
static RenameSupport |
create(IJavaScriptUnit unit,
java.lang.String newName,
int flags)
Creates a new rename support for the given IJavaScriptUnit . |
static RenameSupport |
create(ILocalVariable variable,
java.lang.String newName,
int flags)
Creates a new rename support for the given ILocalVariable . |
static RenameSupport |
create(IPackageFragmentRoot root,
java.lang.String newName)
Creates a new rename support for the given IPackageFragmentRoot . |
static RenameSupport |
create(IPackageFragment fragment,
java.lang.String newName,
int flags)
Creates a new rename support for the given IPackageFragment . |
static RenameSupport |
create(ITypeParameter parameter,
java.lang.String newName,
int flags)
Creates a new rename support for the given ITypeParameter . |
static RenameSupport |
create(IType type,
java.lang.String newName,
int flags)
Creates a new rename support for the given IType . |
static RenameSupport |
create(RenameJavaScriptElementDescriptor descriptor)
Creates a new rename support for the given RenameJavaScriptElementDescriptor . |
void |
openDialog(Shell parent)
Opens the refactoring dialog for this rename support. |
boolean |
openDialog(Shell parent,
boolean showPreviewOnly)
Opens the refactoring dialog for this rename support. |
void |
perform(Shell parent,
IRunnableContext context)
Executes the rename refactoring without showing a dialog to gather additional user input (for example the new name of the IJavaScriptElement). |
IStatus |
preCheck()
Executes some light weight precondition checking. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NONE
public static final int UPDATE_REFERENCES
public static final int UPDATE_TEXTUAL_MATCHES
public static final int UPDATE_GETTER_METHOD
public static final int UPDATE_SETTER_METHOD
Method Detail |
---|
public IStatus preCheck() throws CoreException
openDialog
or
perform
.
The method is mainly used to determine enable/disablement of actions.
CoreException
- if an unexpected exception occurs while performing the checking.openDialog(Shell)
,
perform(Shell, IRunnableContext)
public void openDialog(Shell parent) throws CoreException
parent
- a shell used as a parent for the refactoring dialog.
CoreException
- if an unexpected exception occurs while opening the
dialog.openDialog(Shell, boolean)
public boolean openDialog(Shell parent, boolean showPreviewOnly) throws CoreException
This method has to be called from within the UI thread.
parent
- a shell used as a parent for the refactoring, preview, or error dialogshowPreviewOnly
- if true
, the dialog skips all user input pages and
directly shows the preview or error page. Otherwise, shows all pages.
true
if the refactoring has been executed successfully,
false
if it has been canceled or if an error has happened during
initial conditions checking.
CoreException
- if an error occurred while executing the
operation.openDialog(Shell)
public void perform(Shell parent, IRunnableContext context) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
The method has to be called from within the UI thread.
parent
- a shell used as a parent for the error dialog.context
- a IRunnableContext
to execute the operation.
java.lang.InterruptedException
- if the operation has been canceled by the
user.
java.lang.reflect.InvocationTargetException
- if an error occurred while executing the
operation.openDialog(Shell)
,
IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
public static RenameSupport create(RenameJavaScriptElementDescriptor descriptor) throws CoreException
RenameJavaScriptElementDescriptor
.
descriptor
- the RenameJavaScriptElementDescriptor
to create a
RenameSupport
for. The caller is responsible for
configuring the descriptor before it is passed.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating the
RenameSupport
.public static RenameSupport create(IJavaScriptProject project, java.lang.String newName, int flags) throws CoreException
IJavaScriptProject
.
project
- the IJavaScriptProject
to be renamed.newName
- the project's new name. null
is a valid
value indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IPackageFragmentRoot root, java.lang.String newName) throws CoreException
IPackageFragmentRoot
.
root
- the IPackageFragmentRoot
to be renamed.newName
- the package fragment root's new name. null
is
a valid value indicating that no new name is provided.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IPackageFragment fragment, java.lang.String newName, int flags) throws CoreException
IPackageFragment
.
fragment
- the IPackageFragment
to be renamed.newName
- the package fragment's new name. null
is a
valid value indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, and UPDATE_TEXTUAL_MATCHES
,
or their bitwise OR, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IJavaScriptUnit unit, java.lang.String newName, int flags) throws CoreException
IJavaScriptUnit
.
unit
- the IJavaScriptUnit
to be renamed.newName
- the compilation unit's new name. null
is a
valid value indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, and UPDATE_TEXTUAL_MATCHES
,
or their bitwise OR, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IType type, java.lang.String newName, int flags) throws CoreException
IType
.
type
- the IType
to be renamed.newName
- the type's new name. null
is a valid value
indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, and UPDATE_TEXTUAL_MATCHES
,
or their bitwise OR, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IFunction method, java.lang.String newName, int flags) throws CoreException
IFunction
.
method
- the IFunction
to be renamed.newName
- the method's new name. null
is a valid value
indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(IField field, java.lang.String newName, int flags) throws CoreException
IField
.
field
- the IField
to be renamed.newName
- the field's new name. null
is a valid value
indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, UPDATE_TEXTUAL_MATCHES
,
UPDATE_GETTER_METHOD
, and UPDATE_SETTER_METHOD
,
or their bitwise OR, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(ITypeParameter parameter, java.lang.String newName, int flags) throws CoreException
ITypeParameter
.
parameter
- the ITypeParameter
to be renamed.newName
- the parameter's new name. null
is a valid value
indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.public static RenameSupport create(ILocalVariable variable, java.lang.String newName, int flags) throws CoreException
ILocalVariable
.
variable
- the ILocalVariable
to be renamed.newName
- the variable's new name. null
is a valid value
indicating that no new name is provided.flags
- flags controlling additional parameters. Valid flags are
UPDATE_REFERENCES
, or NONE
.
RenameSupport
.
CoreException
- if an unexpected error occurred while creating
the RenameSupport
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |