|
||||||||||
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 versionsMethod Detail |
---|
public void beginVersion(boolean mergeVersion)
IPageVersionManager
Page
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 IPageVersionManager
mergeVersion
- If this is set, the version that was created is merged with the previous one.IPageVersionManager.beginVersion(boolean)
public void ignoreVersionMerge()
IPageVersionManager
Page
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 IPageVersionManager
IPageVersionManager.ignoreVersionMerge()
public void componentAdded(Component component)
IPageVersionManager
Component
was added.
componentAdded
in interface IPageVersionManager
component
- the Component
that was addedIPageVersionManager.componentAdded(Component)
public void componentModelChanging(Component component)
IPageVersionManager
Component
is about to change.
componentModelChanging
in interface IPageVersionManager
component
- the Component
whose model is about to changeIPageVersionManager.componentModelChanging(Component)
public void componentRemoved(Component component)
IPageVersionManager
Component
was removed.
componentRemoved
in interface IPageVersionManager
component
- the Component
that was removedIPageVersionManager.componentRemoved(Component)
public void componentStateChanging(Change change)
IPageVersionManager
Component
is about to change.
componentStateChanging
in interface IPageVersionManager
change
- the Change
which represents the internal stateIPageVersionManager.componentStateChanging(Change)
public void endVersion(boolean mergeVersion)
IPageVersionManager
Page
have ended.
endVersion
in interface IPageVersionManager
mergeVersion
- 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 IPageVersionManager
IPageVersionManager.expireOldestVersion()
public int getCurrentVersionNumber()
IPageVersionManager
getCurrentVersionNumber
in interface IPageVersionManager
IPageVersionManager
IPageVersionManager.getCurrentVersionNumber()
public int getAjaxVersionNumber()
IPageVersionManager
getAjaxVersionNumber
in interface IPageVersionManager
IPageVersionManager.getAjaxVersionNumber()
public Page getVersion(int versionNumber)
IPageVersionManager
Page
version. This method does not include the Ajax versions.
getVersion
in interface IPageVersionManager
versionNumber
- the version of the page to get
Page
, or null
if the version requested is not availableIPageVersionManager.getVersion(int)
public Page rollbackPage(int numberOfVersions)
IPageVersionManager
Page
by the number of versions specified, including the Ajax
versions.
rollbackPage
in interface IPageVersionManager
numberOfVersions
- the number of versions to roll back
Page
IPageVersionManager.rollbackPage(int)
public int getVersions()
IPageVersionManager
getVersions
in interface IPageVersionManager
IPageVersionManager
IPageVersionManager.getVersions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |