|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ltk.core.refactoring.RefactoringContribution
Partial implementation of refactoring contribution objects which are capable of creating refactoring descriptors or refactoring arguments.
Clients which would like to add refactoring history and refactoring scripting
support to a refactoring are required to register a subclass of
RefactoringContribution
with the extension point
org.eclipse.ltk.core.refactoring.refactoringContributions
to
participate in the refactoring services. Refactoring contributions are
stateless objects. They are instantiated on demand by the refactoring
framework in the following cases:
createDescriptor(String, String, String, String, Map, int)
with the
appropriate arguments read from the refactoring script to obtain a
language-specific refactoring descriptor. This refactoring descriptor is then
used to dynamically construct the corresponding refactoring object and to
initialize the refactoring object afterwards. The returned refactoring object
is completely initialized and ready to be executed, ie. by
PerformRefactoringOperation
. retrieveArgumentMap(RefactoringDescriptor)
of the refactoring
contribution associated with the executed refactoring to obtain a neutral
key-value representation of the state of the language-specific refactoring
descriptor. RefactoringDescriptor
during change generation (ie.
returning a change object whose Change.getDescriptor()
method has
been implemented to return a RefactoringChangeDescriptor
encapsulating RefactoringDescriptor
.
Note: Clients which extend this class are required to reimplement the method
retrieveArgumentMap(RefactoringDescriptor)
in subclasses to capture
the state of a language-specific refactoring descriptor in a neutral
key-value representation used by the refactoring framework.
Constructor Summary | |
---|---|
RefactoringContribution()
|
Method Summary | |
---|---|
abstract RefactoringDescriptor |
createDescriptor(String id,
String project,
String description,
String comment,
Map arguments,
int flags)
Creates a new refactoring descriptor. |
Map |
retrieveArgumentMap(RefactoringDescriptor descriptor)
Retrieves the argument map of the specified refactoring descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RefactoringContribution()
Method Detail |
public abstract RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags)
This method is used by the refactoring framework to create a
language-specific refactoring descriptor representing the refactoring
instance corresponding to the specified arguments. Implementations of
this method must never return null
. The refactoring
framework guarantees that this method is only called with id
values for which the refactoring contribution has been registered with
the extension point.
id
- the unique id of the refactoringproject
- the non-empty name of the project associated with this
refactoring, or null
for a workspace
refactoringdescription
- a non-empty human-readable description of the particular
refactoring instancecomment
- the comment associated with the refactoring, or
null
for no commentarguments
- the argument map (element type: <String, String>). The
keys of the arguments are required to be non-empty strings
which must not contain spaces. The values must be non-empty
stringsflags
- the flags of the refactoring descriptor
retrieveArgumentMap(RefactoringDescriptor)
public Map retrieveArgumentMap(RefactoringDescriptor descriptor)
This method is used by the refactoring framework to obtain
refactoring-specific arguments provided by the refactoring descriptor.
These are the arguments which are specific to certain refactoring
instances, and correspond to the argument map which has been passed to
createDescriptor(String, String, String, String, Map, int)
upon
creation of the refactoring descriptor.
The returned argument map (element type: <String, String>) must satisfy the following conditions:
Subclasses must extend this method to provide more specific
implementation in order to let the refactoring framework retrieve the
argument map from language-specific refactoring descriptors.
Implementations of this method must never return null
.
The refactoring framework guarantees that this method is only called for
refactoring descriptors which have been obtained by a previous call to
createDescriptor(String, String, String, String, Map, int)
.
descriptor
- the refactoring descriptor to retrieve its argument map
createDescriptor(String, String, String, String, Map, int)
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.