Interface IRefactoringHistoryService
An instance of a refactoring history service may be obtained by calling
RefactoringCore.getHistoryService()
.
All time stamps are measured as the milliseconds since January 1, 1970, 00:00:00 GMT.
Note: this interface is not intended to be implemented by clients.
- Since:
- 3.2
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified refactoring execution listener to this service.void
Adds the specified refactoring history listener to this service.void
connect()
Connects the refactoring history service to the workbench's operation history if necessary and increments an internal counter.void
Disconnects the refactoring history service from the workbench's operation history if necessary and decrements an internal counter.getProjectHistory
(IProject project, long start, long end, int flags, IProgressMonitor monitor) Returns a project refactoring history for the specified project.getProjectHistory
(IProject project, IProgressMonitor monitor) Returns a project refactoring history for the specified project.getRefactoringHistory
(IProject[] projects, long start, long end, int flags, IProgressMonitor monitor) Returns the combined refactoring history for the specified projects.getRefactoringHistory
(IProject[] projects, IProgressMonitor monitor) Returns the combined refactoring history for the specified projects.getWorkspaceHistory
(long start, long end, IProgressMonitor monitor) Returns the workspace refactoring history.getWorkspaceHistory
(IProgressMonitor monitor) Returns the workspace refactoring history.readRefactoringHistory
(InputStream stream, int flags) Reads a refactoring history from the input stream.void
Removes the specified refactoring execution listener from this service.void
Removes the specified refactoring history listener from this service.void
writeRefactoringDescriptors
(RefactoringDescriptorProxy[] proxies, OutputStream stream, int flags, boolean time, IProgressMonitor monitor) Writes the specified refactoring descriptor proxies to the output stream.void
writeRefactoringSession
(RefactoringSessionDescriptor descriptor, OutputStream stream, boolean time) Writes the specified refactoring session descriptor to the output stream.
-
Method Details
-
addExecutionListener
Adds the specified refactoring execution listener to this service.If the listener is already registered with the service, nothing happens.
- Parameters:
listener
- the listener to add
-
addHistoryListener
Adds the specified refactoring history listener to this service.If the listener is already registered with the service, nothing happens.
- Parameters:
listener
- the listener to add
-
connect
void connect()Connects the refactoring history service to the workbench's operation history if necessary and increments an internal counter.If the service is already connected, nothing happens.
Every call to
connect()
must be balanced with a corresponding call todisconnect()
. -
disconnect
void disconnect()Disconnects the refactoring history service from the workbench's operation history if necessary and decrements an internal counter.If the service is not connected, nothing happens. If the service is connected, all resources acquired since the corresponding call to
connect()
are released.Every call to
disconnect()
must be balanced with a corresponding call toconnect()
. -
getProjectHistory
Returns a project refactoring history for the specified project.Clients must connect to the refactoring history service first before calling this method.
- Parameters:
project
- the project, which must existmonitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the project refactoring history
-
getProjectHistory
RefactoringHistory getProjectHistory(IProject project, long start, long end, int flags, IProgressMonitor monitor) Returns a project refactoring history for the specified project.Clients must connect to the refactoring history service first before calling this method.
Note that calling this method with a flag argument unequal to
RefactoringDescriptor#NONE
may result in a performance degradation, since the actual descriptors have to be eagerly resolved. This in turn results in faster execution of any subsequent calls toRefactoringDescriptorProxy.requestDescriptor(IProgressMonitor)
which try to request a descriptor from the returned refactoring history.- Parameters:
project
- the project, which must existstart
- the start time stamp, inclusiveend
- the end time stamp, inclusiveflags
- the refactoring descriptor flags which must be present in order to be returned in the refactoring history object, orRefactoringDescriptor#NONE
monitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the project refactoring history
-
getRefactoringHistory
Returns the combined refactoring history for the specified projects.Clients must connect to the refactoring history service first before calling this method.
- Parameters:
projects
- the projects, which must existmonitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the combined refactoring history
-
getRefactoringHistory
RefactoringHistory getRefactoringHistory(IProject[] projects, long start, long end, int flags, IProgressMonitor monitor) Returns the combined refactoring history for the specified projects.Clients must connect to the refactoring history service first before calling this method.
Note that calling this method with a flag argument unequal to
RefactoringDescriptor#NONE
may result in a performance degradation, since the actual descriptors have to be eagerly resolved. This in turn results in faster execution of any subsequent calls toRefactoringDescriptorProxy.requestDescriptor(IProgressMonitor)
which try to request a descriptor from the returned refactoring history.- Parameters:
projects
- the projects, which must existstart
- the start time stamp, inclusiveend
- the end time stamp, inclusiveflags
- the refactoring descriptor flags which must be present in order to be returned in the refactoring history object, orRefactoringDescriptor#NONE
monitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the combined refactoring history
-
getWorkspaceHistory
Returns the workspace refactoring history.Clients must connect to the refactoring history service first before calling this method.
- Parameters:
monitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the workspace refactoring history
-
getWorkspaceHistory
Returns the workspace refactoring history.Clients must connect to the refactoring history service first before calling this method.
- Parameters:
start
- the start time stamp, inclusiveend
- the end time stamp, inclusivemonitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Returns:
- the workspace refactoring history
-
readRefactoringHistory
Reads a refactoring history from the input stream.The resulting refactoring history contains resolved refactoring descriptors and should not be held on to.
It is the responsibility of the caller to close the input stream.
- Parameters:
stream
- aUTF-8
input stream where to read the refactoring history fromflags
- the refactoring descriptor flags to filter the refactoring descriptors- Returns:
- a refactoring history containing the filtered refactoring descriptors
- Throws:
CoreException
- if an error occurs while reading form the input stream. Reasons include:- The input stream contains no version information for the refactoring history.
- The input stream contains an unsupported version of a refactoring history.
- An I/O error occurs while reading the refactoring history from the input stream.
- See Also:
-
removeExecutionListener
Removes the specified refactoring execution listener from this service.If the listener is not registered with the service, nothing happens.
- Parameters:
listener
- the listener to remove
-
removeHistoryListener
Removes the specified refactoring history listener from this service.If the listener is not registered with the service, nothing happens.
- Parameters:
listener
- the listener to remove
-
writeRefactoringDescriptors
void writeRefactoringDescriptors(RefactoringDescriptorProxy[] proxies, OutputStream stream, int flags, boolean time, IProgressMonitor monitor) throws CoreException Writes the specified refactoring descriptor proxies to the output stream. Refactoring descriptor proxies which cannot be resolved are automatically skipped.It is the responsibility of the caller to close the output stream.
- Parameters:
proxies
- the refactoring descriptor proxiesstream
- aUTF-8
output stream where to write the refactoring descriptors toflags
- the flags which must be present in order to be written to the output stream, orRefactoringDescriptor#NONE
time
-true
to write time information associated with the refactorings,false
otherwisemonitor
- the progress monitor to use, ornull
if no progress monitoring or cancelation is desired- Throws:
CoreException
- if an error occurs while writing to the output stream. Reasons include:- The refactoring descriptors have an illegal format, contain illegal arguments or otherwise illegal information.
- An I/O error occurs while writing the refactoring descriptors to the output stream.
- See Also:
-
writeRefactoringSession
void writeRefactoringSession(RefactoringSessionDescriptor descriptor, OutputStream stream, boolean time) throws CoreException Writes the specified refactoring session descriptor to the output stream.It is the responsibility of the caller to close the output stream.
- Parameters:
descriptor
- the refactoring session descriptor to writestream
- aUTF-8
output stream where to write the refactoring session totime
-true
to write time information associated with the refactorings,false
otherwise- Throws:
CoreException
- if an error occurs while writing to the output stream. Reasons include:- The refactoring descriptors have an illegal format, contain illegal arguments or otherwise illegal information.
- An I/O error occurs while writing the refactoring descriptors to the output stream.
- See Also:
-