Package org.eclipse.text.edits
Class TextEditGroup
- java.lang.Object
-
- org.eclipse.text.edits.TextEditGroup
-
- Direct Known Subclasses:
CategorizedTextEditGroup
public class TextEditGroup extends Object
A text edit group combines a list ofTextEdit
s and a name into a single object. The name must be a human readable string use to present the text edit group in the user interface.Clients may extend this class to add extra information to a text edit group.
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description TextEditGroup(String name)
Creates a new text edit group with the given name.TextEditGroup(String name, TextEdit edit)
Creates a new text edit group with a name and a singleTextEdit
.TextEditGroup(String name, TextEdit[] edits)
Creates a new text edit group with the given name and array of edits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTextEdit(TextEdit edit)
Adds the givenTextEdit
to this group.void
clearTextEdits()
Removes all text edits from this group.String
getName()
Returns the edit group's name.IRegion
getRegion()
Returns the text region covered by the edits managed via this edit group.TextEdit[]
getTextEdits()
Returns an array ofTextEdit
s containing the edits managed by this group.boolean
isEmpty()
boolean
removeTextEdit(TextEdit edit)
Removes the givenTextEdit
from this group.
-
-
-
Constructor Detail
-
TextEditGroup
public TextEditGroup(String name)
Creates a new text edit group with the given name.- Parameters:
name
- the name of the text edit group. Must be a human readable string
-
TextEditGroup
public TextEditGroup(String name, TextEdit edit)
Creates a new text edit group with a name and a singleTextEdit
.- Parameters:
name
- the name of the text edit group. Must be a human readable stringedit
- the edit to manage
-
-
Method Detail
-
getName
public String getName()
Returns the edit group's name.- Returns:
- the edit group's name
-
addTextEdit
public void addTextEdit(TextEdit edit)
Adds the givenTextEdit
to this group.- Parameters:
edit
- the edit to add
-
removeTextEdit
public boolean removeTextEdit(TextEdit edit)
Removes the givenTextEdit
from this group.- Parameters:
edit
- the edit to remove- Returns:
true
if this group contained the specified edit.- Since:
- 3.3
-
clearTextEdits
public void clearTextEdits()
Removes all text edits from this group.- Since:
- 3.3
-
isEmpty
public boolean isEmpty()
- Returns:
- whether the list of managed text edits is empty or not
-
getTextEdits
public TextEdit[] getTextEdits()
Returns an array ofTextEdit
s containing the edits managed by this group.- Returns:
- the managed text edits
-
getRegion
public IRegion getRegion()
Returns the text region covered by the edits managed via this edit group. If the group doesn't manage any editsnull
is returned.- Returns:
- the text region covered by this edit group or
null
if no edits are managed
-
-