|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.EventNotifier<RegionManagerListener<BrowserDocumentRegion>>
edu.rice.cs.drjava.model.BrowserHistoryManager
public class BrowserHistoryManager
Browser history manager for the entire model. Follows readers/writers locking protocol of EventNotifier. This history is simply a list together with a current pointer. TODO: Use a simple stack rather than a TreeSet to represent the collection; a browser region should simply be a position in a document.
| Field Summary |
|---|
| Fields inherited from class edu.rice.cs.drjava.model.EventNotifier |
|---|
_listeners, _lock |
| Constructor Summary | |
|---|---|
BrowserHistoryManager()
Create a new ConcreteRegionManager without maximum size. |
|
BrowserHistoryManager(int size)
Create a new ConcreteRegionManager with the specified maximum size. |
|
| Method Summary | |
|---|---|
void |
addBrowserRegion(BrowserDocumentRegion r,
GlobalEventNotifier notifier)
Add the supplied DocumentRegion r to the manager just above _current and set _current to refer to r. |
void |
changeRegion(BrowserDocumentRegion region,
Lambda<BrowserDocumentRegion,Object> cmd)
Apply the given command to the specified region to change it. |
void |
clearBrowserRegions()
Tells the manager to remove all regions. |
BrowserDocumentRegion |
getCurrentRegion()
|
int |
getMaximumSize()
|
SortedSet<BrowserDocumentRegion> |
getRegions()
|
boolean |
isCurrentRegionFirst()
|
boolean |
isCurrentRegionLast()
|
BrowserDocumentRegion |
nextCurrentRegion(GlobalEventNotifier notifier)
Make the region that is more recent the current region. |
BrowserDocumentRegion |
prevCurrentRegion(GlobalEventNotifier notifier)
Make the region that is less recent the current region. |
void |
remove(BrowserDocumentRegion r)
Remove the given DocumentRegion from the manager. |
void |
setCurrentRegion(BrowserDocumentRegion r)
Set the current region. |
void |
setMaximumSize(int size)
Set the maximum number of regions that can be stored in this manager. |
| Methods inherited from class edu.rice.cs.drjava.model.EventNotifier |
|---|
addListener, removeAllListeners, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BrowserHistoryManager(int size)
size - maximum number of regions that can be stored in this manager.public BrowserHistoryManager()
| Method Detail |
|---|
public void addBrowserRegion(BrowserDocumentRegion r,
GlobalEventNotifier notifier)
r - the DocumentRegion to be inserted into the managerpublic void remove(BrowserDocumentRegion r)
r - the DocumentRegion to be removed.public SortedSet<BrowserDocumentRegion> getRegions()
public void clearBrowserRegions()
public BrowserDocumentRegion getCurrentRegion()
public boolean isCurrentRegionFirst()
public boolean isCurrentRegionLast()
public void setCurrentRegion(BrowserDocumentRegion r)
public BrowserDocumentRegion nextCurrentRegion(GlobalEventNotifier notifier)
public BrowserDocumentRegion prevCurrentRegion(GlobalEventNotifier notifier)
public void setMaximumSize(int size)
size - maximum number of regions, or 0 if no maximumpublic int getMaximumSize()
public void changeRegion(BrowserDocumentRegion region,
Lambda<BrowserDocumentRegion,Object> cmd)
region - the region to find and changecmd - command that mutates the region.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||