|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RegionManager<R extends IDocumentRegion>
Interface for a region manager. Region ordering (as in DocumentRegion) is not required, but it facilitates efficient implementation.
Method Summary | |
---|---|
void |
addListener(RegionManagerListener<R> listener)
Adds a listener to the notifier. |
void |
addRegion(R region)
Add the supplied DocumentRegion to the manager. |
void |
changeRegion(R region,
Lambda<R,Object> cmd)
Apply the given command to the specified region to change it. |
void |
clearRegions()
Tells the manager to remove all regions. |
boolean |
contains(R r)
Tests if specified region r is contained in this manager. |
Set<OpenDefinitionsDocument> |
getDocuments()
|
R |
getRegionAt(OpenDefinitionsDocument odd,
int offset)
Returns the unique region [start,end), if any, containing the specified offset. |
Pair<R,R> |
getRegionInterval(OpenDefinitionsDocument odd,
int offset)
Returns the first and last region r where r.getLineStart() <= offset < r.getLineEnd(). |
ArrayList<R> |
getRegions()
|
SortedSet<R> |
getRegions(OpenDefinitionsDocument odd)
|
Collection<R> |
getRegionsOverlapping(OpenDefinitionsDocument odd,
int startOffset,
int endOffset)
Returns the rightmost region starting on the same line containing the specified selection |
SortedSet<R> |
getTailSet(R r)
Gets the sorted set of regions greater than or equal to r. |
void |
removeAllListeners()
Removes all listeners from this notifier. |
void |
removeListener(RegionManagerListener<R> listener)
Removes a listener from the notifier. |
void |
removeRegion(R region)
Remove the given DocumentRegion from the manager. |
void |
removeRegions(Iterable<? extends R> regions)
Remove the given DocumentRegions from the manager. |
void |
removeRegions(OpenDefinitionsDocument odd)
Remove the given OpenDefinitionsDocument and all of its regions from the manager. |
void |
updateLines(R firstRegion,
R lastRegion)
Updates _lineStartPos, _lineEndPos of regions in the interval [firstRegion, lastRegion] using total ordering on regions. |
Method Detail |
---|
R getRegionAt(OpenDefinitionsDocument odd, int offset)
odd
- the documentoffset
- the offset in the document
Pair<R,R> getRegionInterval(OpenDefinitionsDocument odd, int offset)
odd
- the documentoffset
- the offset in the document
Collection<R> getRegionsOverlapping(OpenDefinitionsDocument odd, int startOffset, int endOffset)
boolean contains(R r)
r
- The region
void addRegion(R region)
region
- the DocumentRegion to be inserted into the managervoid removeRegion(R region)
region
- the DocumentRegion to be removed.void removeRegions(Iterable<? extends R> regions)
regions
- the DocumentRegions to be removed.void removeRegions(OpenDefinitionsDocument odd)
void changeRegion(R region, Lambda<R,Object> cmd)
region
- the region to find and changecmd
- command that mutates the region.SortedSet<R> getRegions(OpenDefinitionsDocument odd)
ArrayList<R> getRegions()
SortedSet<R> getTailSet(R r)
void clearRegions()
Set<OpenDefinitionsDocument> getDocuments()
void updateLines(R firstRegion, R lastRegion)
void addListener(RegionManagerListener<R> listener)
listener
- a listener that reacts on eventsvoid removeListener(RegionManagerListener<R> listener)
listener
- a listener that reacts on eventsvoid removeAllListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |