|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.version.undo.UndoPageVersionManager
public class UndoPageVersionManager
A version manager implemented by recording Component changes as undo records. These
records can later be reversed to get back to a given version of the Page being
managed.
| Constructor Summary | |
|---|---|
UndoPageVersionManager(Page page,
int maxVersions)
Constructor. |
|
| Method Summary | |
|---|---|
void |
beginVersion(boolean mergeVersion)
Called when changes are immediately impending to the Page being managed. |
void |
componentAdded(Component component)
Indicates that the given Component was added. |
void |
componentModelChanging(Component component)
Indicates that the model for the given Component is about to change. |
void |
componentRemoved(Component component)
Indicates that the given Component was removed. |
void |
componentStateChanging(Change change)
Indicates an internal state for the given Component is about to change. |
void |
endVersion(boolean mergeVersion)
Called when changes to the Page have ended. |
void |
expireOldestVersion()
Expires oldest version in this page version manager. |
int |
getAjaxVersionNumber()
Retrieves the current Ajax version number. |
int |
getCurrentVersionNumber()
Retrieves the newest version number available in this page version manager. |
Page |
getVersion(int versionNumber)
Retrieves a given Page version. |
int |
getVersions()
Retrieves the number of versions stored in this page version manager. |
void |
ignoreVersionMerge()
Call this method if the current Ajax request shouldn't merge changes that are happening to the Page with the previous version. |
Page |
rollbackPage(int numberOfVersions)
Rolls back the Page by the number of versions specified, including the Ajax
versions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UndoPageVersionManager(Page page,
int maxVersions)
page - the Page that we're tracking changes tomaxVersions - the maximum number of versions to maintain before expiring old versions| Method Detail |
|---|
public void beginVersion(boolean mergeVersion)
IPageVersionManagerPage being managed. The
changes to the page between the call to this method and the call to endVersion
create a new version of the page.
In requests where a page is not changed at all, beginVersion will never be
called, nor will any of the other methods in this interface.
beginVersion in interface IPageVersionManagermergeVersion - If this is set, the version that was created is merged with the previous one.IPageVersionManager.beginVersion(boolean)public void ignoreVersionMerge()
IPageVersionManagerPage with the previous version. This is needed, for example, when you want
to redirect to this page in an Ajax request, and then you want to version normally.
This method should only be called if the beginVersion method was called with
true!
ignoreVersionMerge in interface IPageVersionManagerIPageVersionManager.ignoreVersionMerge()public void componentAdded(Component component)
IPageVersionManagerComponent was added.
componentAdded in interface IPageVersionManagercomponent - the Component that was addedIPageVersionManager.componentAdded(Component)public void componentModelChanging(Component component)
IPageVersionManagerComponent is about to change.
componentModelChanging in interface IPageVersionManagercomponent - the Component whose model is about to changeIPageVersionManager.componentModelChanging(Component)public void componentRemoved(Component component)
IPageVersionManagerComponent was removed.
componentRemoved in interface IPageVersionManagercomponent - the Component that was removedIPageVersionManager.componentRemoved(Component)public void componentStateChanging(Change change)
IPageVersionManagerComponent is about to change.
componentStateChanging in interface IPageVersionManagerchange - the Change which represents the internal stateIPageVersionManager.componentStateChanging(Change)public void endVersion(boolean mergeVersion)
IPageVersionManagerPage have ended.
endVersion in interface IPageVersionManagermergeVersion - If this is set, the version that was created is merged with the previous one.IPageVersionManager.endVersion(boolean)public void expireOldestVersion()
IPageVersionManager
expireOldestVersion in interface IPageVersionManagerIPageVersionManager.expireOldestVersion()public int getCurrentVersionNumber()
IPageVersionManager
getCurrentVersionNumber in interface IPageVersionManagerIPageVersionManagerIPageVersionManager.getCurrentVersionNumber()public int getAjaxVersionNumber()
IPageVersionManager
getAjaxVersionNumber in interface IPageVersionManagerIPageVersionManager.getAjaxVersionNumber()public Page getVersion(int versionNumber)
IPageVersionManagerPage version. This method does not include the Ajax versions.
getVersion in interface IPageVersionManagerversionNumber - the version of the page to get
Page, or null if the version requested is not availableIPageVersionManager.getVersion(int)public Page rollbackPage(int numberOfVersions)
IPageVersionManagerPage by the number of versions specified, including the Ajax
versions.
rollbackPage in interface IPageVersionManagernumberOfVersions - the number of versions to roll back
PageIPageVersionManager.rollbackPage(int)public int getVersions()
IPageVersionManager
getVersions in interface IPageVersionManagerIPageVersionManagerIPageVersionManager.getVersions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||