|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a refactoring history service. A refactoring history service provides methods to register refactoring history listeners, refactoring execution listeners and facilities to query the global refactoring history index for specific refactoring histories. Additionally, methods are provided which read or write refactoring information. The refactoring history service only returns refactorings which have contributed a refactoring descriptor via their change object.
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.
RefactoringCore
,
IRefactoringHistoryListener
,
IRefactoringExecutionListener
,
RefactoringHistory
,
RefactoringDescriptorProxy
Method Summary | |
---|---|
void |
addExecutionListener(IRefactoringExecutionListener listener)
Adds the specified refactoring execution listener to this service. |
void |
addHistoryListener(IRefactoringHistoryListener listener)
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 |
disconnect()
Disconnects the refactoring history service from the workbench's operation history if necessary and decrements an internal counter. |
RefactoringHistory |
getProjectHistory(IProject project,
IProgressMonitor monitor)
Returns a project refactoring history for the specified project. |
RefactoringHistory |
getProjectHistory(IProject project,
long start,
long end,
int flags,
IProgressMonitor monitor)
Returns a project refactoring history for the specified project. |
RefactoringHistory |
getRefactoringHistory(IProject[] projects,
IProgressMonitor monitor)
Returns the combined refactoring history for the specified projects. |
RefactoringHistory |
getRefactoringHistory(IProject[] projects,
long start,
long end,
int flags,
IProgressMonitor monitor)
Returns the combined refactoring history for the specified projects. |
RefactoringHistory |
getWorkspaceHistory(IProgressMonitor monitor)
Returns the workspace refactoring history. |
RefactoringHistory |
getWorkspaceHistory(long start,
long end,
IProgressMonitor monitor)
Returns the workspace refactoring history. |
RefactoringHistory |
readRefactoringHistory(InputStream stream,
int flags)
Reads a refactoring history from the input stream. |
void |
removeExecutionListener(IRefactoringExecutionListener listener)
Removes the specified refactoring execution listener from this service. |
void |
removeHistoryListener(IRefactoringHistoryListener listener)
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 Detail |
public void addExecutionListener(IRefactoringExecutionListener listener)
If the listener is already registered with the service, nothing happens.
listener
- the listener to addpublic void addHistoryListener(IRefactoringHistoryListener listener)
If the listener is already registered with the service, nothing happens.
listener
- the listener to addpublic void connect()
If the service is already connected, nothing happens.
Every call to connect()
must be balanced with a corresponding
call to disconnect()
.
public void disconnect()
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 to connect()
.
public RefactoringHistory getProjectHistory(IProject project, IProgressMonitor monitor)
Clients must connect to the refactoring history service first before calling this method.
project
- the project, which must existmonitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory getProjectHistory(IProject project, long start, long end, int flags, IProgressMonitor monitor)
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 to
RefactoringDescriptorProxy.requestDescriptor(IProgressMonitor)
which try to request a descriptor from the returned refactoring history.
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, or
RefactoringDescriptor#NONE
monitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory getRefactoringHistory(IProject[] projects, IProgressMonitor monitor)
Clients must connect to the refactoring history service first before calling this method.
projects
- the projects, which must existmonitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory getRefactoringHistory(IProject[] projects, long start, long end, int flags, IProgressMonitor monitor)
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 to
RefactoringDescriptorProxy.requestDescriptor(IProgressMonitor)
which try to request a descriptor from the returned refactoring history.
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, or
RefactoringDescriptor#NONE
monitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory getWorkspaceHistory(IProgressMonitor monitor)
Clients must connect to the refactoring history service first before calling this method.
monitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory getWorkspaceHistory(long start, long end, IProgressMonitor monitor)
Clients must connect to the refactoring history service first before calling this method.
start
- the start time stamp, inclusiveend
- the end time stamp, inclusivemonitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
public RefactoringHistory readRefactoringHistory(InputStream stream, int flags) throws CoreException
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.
stream
- a UTF-8
input stream where to read the
refactoring history fromflags
- the refactoring descriptor flags to filter the refactoring
descriptors
CoreException
- if an error occurs while reading form the input stream.
Reasons include:
RefactoringDescriptor.NONE
,
RefactoringDescriptor.STRUCTURAL_CHANGE
,
RefactoringDescriptor.BREAKING_CHANGE
,
IRefactoringCoreStatusCodes.REFACTORING_HISTORY_IO_ERROR
,
IRefactoringCoreStatusCodes.UNSUPPORTED_REFACTORING_HISTORY_VERSION
,
IRefactoringCoreStatusCodes.MISSING_REFACTORING_HISTORY_VERSION
public void removeExecutionListener(IRefactoringExecutionListener listener)
If the listener is not registered with the service, nothing happens.
listener
- the listener to removepublic void removeHistoryListener(IRefactoringHistoryListener listener)
If the listener is not registered with the service, nothing happens.
listener
- the listener to removepublic void writeRefactoringDescriptors(RefactoringDescriptorProxy[] proxies, OutputStream stream, int flags, boolean time, IProgressMonitor monitor) throws CoreException
It is the responsibility of the caller to close the output stream.
proxies
- the refactoring descriptor proxiesstream
- a UTF-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, or RefactoringDescriptor#NONE
time
- true
to write time information associated with
the refactorings, false
otherwisemonitor
- the progress monitor to use, or null
if no
progress monitoring or cancelation is desired
CoreException
- if an error occurs while writing to the output stream.
Reasons include:
RefactoringDescriptor.NONE
,
RefactoringDescriptor.STRUCTURAL_CHANGE
,
RefactoringDescriptor.BREAKING_CHANGE
,
IRefactoringCoreStatusCodes.REFACTORING_HISTORY_FORMAT_ERROR
,
IRefactoringCoreStatusCodes.REFACTORING_HISTORY_IO_ERROR
public void writeRefactoringSession(RefactoringSessionDescriptor descriptor, OutputStream stream, boolean time) throws CoreException
It is the responsibility of the caller to close the output stream.
descriptor
- the refactoring session descriptor to writestream
- a UTF-8
output stream where to write the
refactoring session totime
- true
to write time information associated with
the refactorings, false
otherwise
CoreException
- if an error occurs while writing to the output stream.
Reasons include:
IRefactoringCoreStatusCodes.REFACTORING_HISTORY_FORMAT_ERROR
,
IRefactoringCoreStatusCodes.REFACTORING_HISTORY_IO_ERROR
|
Eclipse Platform Release 3.3 |
|||||||||||
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, 2007. All rights reserved.