|
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.Change
org.eclipse.ltk.core.refactoring.TextEditBasedChange
An abstract base implementation of a change which is based on text edits.
Constructor Summary | |
---|---|
protected |
TextEditBasedChange(String name)
Creates a new abstract text edit change with the specified name. |
Method Summary | |
---|---|
void |
addChangeGroup(TextEditBasedChangeGroup group)
Adds a text edit change group .
|
void |
addTextEditGroup(TextEditGroup group)
Adds a text edit group . |
TextEditBasedChangeGroup[] |
getChangeGroups()
Returns the text edit change groups managed by this
buffer change. |
abstract String |
getCurrentContent(IProgressMonitor pm)
Returns the current content of the document this text change is associated with. |
abstract String |
getCurrentContent(IRegion region,
boolean expandRegionToFullLine,
int surroundingLines,
IProgressMonitor pm)
Returns the current content of the text edit change clipped to a specific region. |
boolean |
getKeepPreviewEdits()
Returns whether preview edits are remembered for further region tracking or not. |
String |
getName()
Returns the human readable name of this change. The name MUST not be null . |
abstract String |
getPreviewContent(IProgressMonitor pm)
Returns the preview content as a string. |
abstract String |
getPreviewContent(TextEditBasedChangeGroup[] changeGroups,
IRegion region,
boolean expandRegionToFullLine,
int surroundingLines,
IProgressMonitor pm)
Returns a preview of the text edit change clipped to a specific region. |
String |
getTextType()
Returns the text edit change's text type. |
boolean |
hasOneGroupCategory(List groupCategories)
Returns true if the change has one of the given group
categories. |
void |
setEnabled(boolean enabled)
Sets whether this change is enabled or not. |
void |
setKeepPreviewEdits(boolean keep)
Controls whether the text edit change should keep executed edits during preview generation. |
void |
setTextType(String type)
Sets the text type. |
Methods inherited from class org.eclipse.ltk.core.refactoring.Change |
---|
dispose, getAdapter, getAffectedObjects, getDescriptor, getModifiedElement, getParent, initializeValidationData, isEnabled, isValid, perform, setEnabledShallow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected TextEditBasedChange(String name)
null
.
The text type of this text edit change is set to txt
.
name
- the name of the text edit changesetTextType(String)
Method Detail |
public void addChangeGroup(TextEditBasedChangeGroup group)
text edit change group
.
The edits managed by the given text edit change group must be part of
the change's root edit.
group
- the text edit change group to addpublic void addTextEditGroup(TextEditGroup group)
text edit group
. This method is a convenience
method for calling change.addChangeGroup(new
TextEditBasedChangeGroup(change, group));
.
group
- the text edit group to addpublic boolean hasOneGroupCategory(List groupCategories)
true
if the change has one of the given group
categories. Otherwise false
is returned.
groupCategories
- the group categories to check
public final TextEditBasedChangeGroup[] getChangeGroups()
text edit change groups
managed by this
buffer change.
public abstract String getCurrentContent(IProgressMonitor pm) throws CoreException
pm
- a progress monitor to report progress or null
if no progress reporting is desired
CoreException
- if the content can't be accessedpublic abstract String getCurrentContent(IRegion region, boolean expandRegionToFullLine, int surroundingLines, IProgressMonitor pm) throws CoreException
expandRegionToFullLine
is false
then the parameter region
determines the clipping.
expandRegionToFullLine
is true
then the region determined by the parameter region
is extended to cover full lines.
surroundingLines
> 0 then the given number
of surrounding lines is added. The value of surroundingLines
is only considered if expandRegionToFullLine
is true
region
- the starting region for the text to be returnedexpandRegionToFullLine
- if true
is passed the region
is extended to cover full linessurroundingLines
- the number of surrounding lines to be added to
the clipping region. Is only considered if expandRegionToFullLine
is true
pm
- a progress monitor to report progress or null
if no progress reporting is desired
CoreException
- if an exception occurs while accessing the current contentpublic boolean getKeepPreviewEdits()
true
if executed text edits are remembered
during preview generation; otherwise false
public String getName()
null
.
getName
in class Change
public abstract String getPreviewContent(TextEditBasedChangeGroup[] changeGroups, IRegion region, boolean expandRegionToFullLine, int surroundingLines, IProgressMonitor pm) throws CoreException
text edit change groups
.
The region is determined as follows:
expandRegionToFullLine
is false
then the parameter region
determines the clipping.
expandRegionToFullLine
is true
then the region determined by the parameter region
is extended to cover full lines.
surroundingLines
> 0 then the given number
of surrounding lines is added. The value of surroundingLines
is only considered if expandRegionToFullLine
is true
changeGroups
- a set of change groups for which a preview is to be
generatedregion
- the starting region for the clippingexpandRegionToFullLine
- if true
is passed the region
is extended to cover full linessurroundingLines
- the number of surrounding lines to be added to
the clipping region. Is only considered if expandRegionToFullLine
is true
pm
- a progress monitor to report progress or null
if no progress reporting is desired
CoreException
- if an exception occurs while generating the previewgetCurrentContent(IRegion, boolean, int, IProgressMonitor)
public abstract String getPreviewContent(IProgressMonitor pm) throws CoreException
pm
- a progress monitor to report progress or null
if no progress reporting is desired
CoreException
- if the preview can't be createdpublic String getTextType()
public void setEnabled(boolean enabled)
setEnabled
in class Change
enabled
- true
to enable this change;
false
otherwisepublic void setKeepPreviewEdits(boolean keep)
keep
- if true
executed preview edits are keptpublic void setTextType(String type)
org.eclipse.compare.contentMergeViewers
.
The default text type is txt
.
type
- the text type. If null
is passed the text type is
reseted to the default text type txt
.
|
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.