You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/09/13 06:46:29 UTC
svn commit: r575165 - in
/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version: ./
undo/
Author: ivaynberg
Date: Wed Sep 12 21:46:27 2007
New Revision: 575165
URL: http://svn.apache.org/viewvc?rev=575165&view=rev
Log:
WICKET-966: Wicket Javadoc Standardization: org.apache.wicket.version.*
Added:
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html (with props)
Modified:
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/IPageVersionManager.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Add.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Change.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ChangeList.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ModelChange.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Remove.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/UndoPageVersionManager.java
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/package.html
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/IPageVersionManager.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/IPageVersionManager.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/IPageVersionManager.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/IPageVersionManager.java Wed Sep 12 21:46:27 2007
@@ -22,132 +22,155 @@
import org.apache.wicket.version.undo.Change;
/**
- * Interface to code that manages versions of a Page. Initially a page has a
- * version number of 0, indicating that it is in its original state. When one or
- * more changes are made to the page, we arrive at version 1.
+ * An interface that manages versions of a <code>Page</code>. Initially
+ * a page has a version number of 0, indicating that it is in its original
+ * state. When one or more changes are made to the page, we arrive at version 1.
* <p>
- * During a request cycle, just before a change is about to occur,
- * beginVersion() is called, followed by one or more calls to componentAdded(),
- * componentRemoved() or componentModelChanging(). If beginVersion() is called
- * by the framework during a given request cycle, a balancing endVersion() call
- * will occur at the end of the request cycle. However, if no changes occur to a
- * page during a request cycle, none of these methods will be called.
+ * During a <code>RequestCycle</code>, just before a change is about to
+ * occur, the <code>beginVersion</code> method is called, followed by one or
+ * more calls to <code>componentAdded</code>, <code>componentRemoved</code>
+ * or <code>componentModelChanging</code>. If <code>beginVersion</code> is
+ * called by the framework during a given request cycle, a balancing call to
+ * <code>endVersion</code> will occur at the end of the request cycle.
+ * However, if no changes occur to a page during a request cycle, none of these
+ * methods will be called.
* <p>
- * Once version information has been added to a version manager, versions can be
- * retrieved by number using getVersion(int). Since version 0 is the first
- * version of a page, calling getVersion(0) will retrieve that version.
+ * Once version information has been added to a page version manager
+ * (<code>IPageVersionManager</code>), versions can be retrieved by number
+ * using the <code>getVersion(int)</code> method. Since version 0 is the first
+ * version of a page, calling <code>getVersion(0)</code> will retrieve that
+ * version.
* <p>
- * The current version number (the number of the newest available version) of a
- * page can be retrieved by calling getCurrentVersionNumber().
+ * The current version number of a page (that is, the number of the newest
+ * available version) can be retrieved by calling
+ * <code>getCurrentVersionNumber</code>.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
public interface IPageVersionManager extends IClusterable
{
/**
- * Called when changes are immediately impending to the 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.
+ * Called when changes are immediately impending to the <code>Page</code>
+ * being managed. The changes to the page between the call to this method
+ * and the call to <code>endVersion</code> create a new version of the
+ * page.
* <p>
- * 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.
+ * In requests where a page is not changed at all, <code>beginVersion</code>
+ * will never be called, nor will any of the other methods in this
+ * interface.
*
* @param mergeVersion
- * If this is set the version that was created is merged with the previous one.
+ * If this is set, the version that was created is merged with
+ * the previous one.
*/
void beginVersion(boolean mergeVersion);
/**
- * Indicates that the given component was added.
+ * Indicates that the given <code>Component</code> was added.
*
* @param component
- * The component that was added.
+ * the <code>Component</code> that was added
*/
void componentAdded(Component component);
/**
- * Indicates that the model for the given component is about to change.
+ * Indicates that the model for the given <code>Component</code> is about
+ * to change.
*
* @param component
- * The component whose model is about to change
+ * the <code>Component</code> whose model is about to change
*/
void componentModelChanging(Component component);
/**
- * Indicates an internal state for the given component is about to change.
+ * Indicates an internal state for the given <code>Component</code> is
+ * about to change.
*
* @param change
- * The change which represents the internal state
+ * the <code>Change</code> which represents the internal state
*/
void componentStateChanging(Change change);
/**
- * Indicates that the given component was removed.
+ * Indicates that the given <code>Component</code> was removed.
*
* @param component
- * The component that was removed.
+ * the <code>Component</code> that was removed
*/
void componentRemoved(Component component);
/**
- * Called when changes to the page have ended.
+ * Called when changes to the <code>Page</code> have ended.
*
* @param mergeVersion
- * If this is set the version that was created is merged with the previous one.
- *
+ * If this is set, the version that was created is merged with
+ * the previous one.
* @see IPageVersionManager#beginVersion(boolean)
*/
void endVersion(boolean mergeVersion);
/**
- * Expires oldest version
+ * Expires oldest version in this page version manager.
*/
void expireOldestVersion();
/**
- * Retrieves a given Page version.
- * This method does not take use the ajax versions.
+ * Retrieves a given <code>Page</code> version. This method does not
+ * include the Ajax versions.
*
* @param versionNumber
- * The version of the page to get
- * @return The page or null if the version requested is not available
+ * the version of the page to get
+ * @return the <code>Page</code>, or <code>null</code> if the version
+ * requested is not available
*/
Page getVersion(int versionNumber);
/**
- * This method rollbacks the page the number of versions specified
- * Including the ajax versions.
+ * Rolls back the <code>Page</code> by the number of versions
+ * specified, including the Ajax versions.
*
- * @param numberOfVersions the number of versions to rollback
- * @return the rolled-back page
+ * @param numberOfVersions
+ * the number of versions to roll back
+ * @return the rolled-back <code>Page</code>
*/
Page rollbackPage(int numberOfVersions);
/**
- * @return The number of versions stored in this version manager
+ * Retrieves the number of versions stored in this page version manager.
+ *
+ * @return the number of versions stored in this
+ * <code>IPageVersionManager</code>
*/
int getVersions();
/**
- * @return Returns the current (newest) version number available through
- * this version manager.
+ * Retrieves the newest version number available in this page version
+ * manager.
+ *
+ * @return the current (newest) version number available in this
+ * <code>IPageVersionManager</code>
*/
int getCurrentVersionNumber();
/**
- * @return Returns the current ajax version number.
+ * Retrieves the current Ajax version number.
+ *
+ * @return the current Ajax version number.
*/
int getAjaxVersionNumber();
/**
- * Call this method when the current (ajax) request
- * shouldn't merge the changes that are happening to the page
- * with the previous version. This is for example needed
- * when you want to redirect to this page in an ajax request
- * and then you do want to version normally..
+ * Call this method if the current Ajax request shouldn't merge changes that
+ * are happening to the <code>Page</code> 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.
+ * <p>
+ * This method should only be called if the <code>beginVersion</code>
+ * method was called with <code>true</code>!
*
- * This method should only be called if the beginVersion was called with true!
+ * @see IPageVersionManager#beginVersion(boolean)
*/
void ignoreVersionMerge();
}
Added: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html?rev=575165&view=auto
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html (added)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html Wed Sep 12 21:46:27 2007
@@ -0,0 +1,30 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 3.2 Final//NL">
+<html>
+ <head>
+ <title>
+ org.apache.wicket.version package
+ </title>
+ </head>
+ <body>
+ <p>
+ This package contains Wicket's <code>IPageVersionManager</code>
+ interface. This interface manages versions of a <code>Page</code>.
+ </p>
+ </body>
+</html>
Propchange: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/package.html
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Add.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Add.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Add.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Add.java Wed Sep 12 21:46:27 2007
@@ -26,22 +26,23 @@
* An add change operation.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
class Add extends Change
{
private static final long serialVersionUID = 1L;
- /** log. */
+ /** logger */
private static final Logger log = LoggerFactory.getLogger(Add.class);
- /** subject. */
+ /** the subject <code>Component</code> */
private final Component component;
/**
- * Construct.
+ * Constructor.
*
* @param component
- * subject
+ * the subject <code>Component</code>
*/
Add(final Component component)
{
@@ -66,7 +67,7 @@
}
/**
- * @see org.apache.wicket.version.undo.Change#undo()
+ * @see Change#undo()
*/
public void undo()
{
@@ -77,7 +78,7 @@
+ ") from parent");
}
- // check if somehow the component isn't already removed.
+ // Check if somehow the Component isn't already removed.
if (component.getParent() != null)
{
component.remove();
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Change.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Change.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Change.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Change.java Wed Sep 12 21:46:27 2007
@@ -19,9 +19,11 @@
import org.apache.wicket.IClusterable;
/**
- * Undo information for a change to the page.
+ * A <code>Change</code> contains undo information for a change to the
+ * <code>Page</code>.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
public abstract class Change implements IClusterable
{
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ChangeList.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ChangeList.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ChangeList.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ChangeList.java Wed Sep 12 21:46:27 2007
@@ -26,23 +26,26 @@
/**
- * A ChangeList is a sequence of changes that can be undone.
+ * A <code>ChangeList</code> is a sequence of changes that can be undone.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
class ChangeList implements IClusterable
{
private static final long serialVersionUID = 1L;
- /** log. */
+ /** logger */
private static final Logger log = LoggerFactory.getLogger(ChangeList.class);
- /** the changes. */
+ /** the list of changes */
private final List changes = new ArrayList();
/**
- * A component was added.
- * @param component the added component
+ * A <code>Component</code> was added.
+ *
+ * @param component
+ * the <code>Component</code> that was added
*/
void componentAdded(Component component)
{
@@ -50,8 +53,11 @@
}
/**
- * A model is about to change.
- * @param component the component of which the model changed
+ * An <code>IModel</code> is about to change.
+ *
+ * @param component
+ * the <code>Component</code> for which the <code>IModel</code>
+ * changed
*/
void componentModelChanging(Component component)
{
@@ -59,8 +65,10 @@
}
/**
- * The state of a component is about to change.
- * @param change the change object
+ * The state of a <code>Component</code> is about to change.
+ *
+ * @param change
+ * the <code>Change</code> object
*/
void componentStateChanging(Change change)
{
@@ -73,25 +81,33 @@
}
/**
- * A component was removed from its parent.
- * @param component the component that was removed
+ * A <code>Component</code> was removed from its parent.
+ *
+ * @param component
+ * the <code>Component</code> that was removed
*/
void componentRemoved(Component component)
{
changes.add(new Remove(component));
}
-
+
+ /**
+ * Adds the given <code>ChangeList</code> to this <code>ChangeList</code>.
+ *
+ * @param component
+ * the <code>ChangeList</code> to add
+ */
void add(ChangeList list)
{
changes.addAll(list.changes);
}
/**
- * Undo changes (rollback).
+ * Undo changes (roll back).
*/
void undo()
{
- // Go through changes in reverse time order to undo
+ // Go through changes in reverse time order to undo.
for (int i = changes.size() - 1; i >= 0; i--)
{
((Change)changes.get(i)).undo();
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ModelChange.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ModelChange.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ModelChange.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/ModelChange.java Wed Sep 12 21:46:27 2007
@@ -27,28 +27,29 @@
/**
- * A model change operation.
+ * An <code>IModel</code> change operation.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
class ModelChange extends Change
{
private static final long serialVersionUID = 1L;
- /** log. */
+ /** logger */
private static final Logger log = LoggerFactory.getLogger(ModelChange.class);
- /** subject. */
+ /** the subject <code>Component</code> */
private final Component component;
- /** original model. */
+ /** the original <code>IModel</code> */
private IModel originalModel;
/**
- * Construct.
+ * Constructor.
*
* @param component
- * subject of the change
+ * the subject <code>Component</code>
*/
ModelChange(final Component component)
{
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Remove.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Remove.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Remove.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/Remove.java Wed Sep 12 21:46:27 2007
@@ -27,25 +27,26 @@
* A remove change operation.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
class Remove extends Change
{
private static final long serialVersionUID = 1L;
- /** log. */
+ /** logger */
private static final Logger log = LoggerFactory.getLogger(Remove.class);
- /** subject. */
+ /** the subject <code>Component</code> */
private final Component component;
- /** parent. */
+ /** the parent <code>MarkupContainer</code> */
private final MarkupContainer container;
/**
- * Construct.
+ * Constructor.
*
* @param component
- * subject component
+ * the subject <code>Component</code>
*/
Remove(final Component component)
{
@@ -71,7 +72,7 @@
}
/**
- * @see org.apache.wicket.version.undo.Change#undo()
+ * @see Change#undo()
*/
public void undo()
{
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/UndoPageVersionManager.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/UndoPageVersionManager.java?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/UndoPageVersionManager.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/UndoPageVersionManager.java Wed Sep 12 21:46:27 2007
@@ -25,46 +25,51 @@
/**
- * A version manager implemented by recording component changes as undo records
- * which can later be reversed to get back to a given version of the page being
- * managed.
+ * A version manager implemented by recording <code>Component</code> changes
+ * as undo records. These records can later be reversed to get back to a given
+ * version of the <code>Page</code> being managed.
*
* @author Jonathan Locke
+ * @since 1.2.6
*/
public class UndoPageVersionManager implements IPageVersionManager
{
- /** log. */
+ /** logger */
private static final Logger log = LoggerFactory.getLogger(UndoPageVersionManager.class);
private static final long serialVersionUID = 1L;
- /** The current list of changes */
+ /** the current list of changes */
private ChangeList changeList;
- /** Stack of change lists for undoing */
+ /** the stack of change lists for undoing */
private final ArrayListStack changeListStack = new ArrayListStack();
- /** The current version number */
+ /** the current version number */
private int currentVersionNumber = 0;
- /** The current version number */
+ /** the current Ajax version number */
private int currentAjaxVersionNumber = 0;
- /** Maximum number of most-recent versions to keep */
+ /** maximum number of most-recent versions to keep */
private final int maxVersions;
- /** The page being managed */
+ /** the <code>Page</code> being managed */
private final Page page;
+ /**
+ * If this is true, the version that was created is not merged with the
+ * previous one.
+ */
private transient boolean ignoreMerge = false;
/**
- * Constructor
+ * Constructor.
*
* @param page
- * The page that we're tracking changes to
+ * the <code>Page</code> that we're tracking changes to
* @param maxVersions
- * The maximum number of versions to maintain before expiring the
+ * the maximum number of versions to maintain before expiring
* old versions
*/
public UndoPageVersionManager(final Page page, final int maxVersions)
@@ -74,17 +79,17 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#beginVersion(boolean)
+ * @see IPageVersionManager#beginVersion(boolean)
*/
public void beginVersion(boolean mergeVersion)
{
- // Create new change list
+ // Create new change list.
changeList = new ChangeList();
- // if we merge then the version number shouldn't be upgraded.
+ // If we merge, then the version number shouldn't be upgraded.
if(!mergeVersion)
{
- // We are working on the next version now
+ // We are working on the next version now.
currentVersionNumber++;
currentAjaxVersionNumber = 0;
}
@@ -95,7 +100,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#ignoreVersionMerge()
+ * @see IPageVersionManager#ignoreVersionMerge()
*/
public void ignoreVersionMerge()
{
@@ -105,7 +110,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#componentAdded(org.apache.wicket.Component)
+ * @see IPageVersionManager#componentAdded(Component)
*/
public void componentAdded(Component component)
{
@@ -113,7 +118,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#componentModelChanging(org.apache.wicket.Component)
+ * @see IPageVersionManager#componentModelChanging(Component)
*/
public void componentModelChanging(Component component)
{
@@ -121,7 +126,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#componentRemoved(org.apache.wicket.Component)
+ * @see IPageVersionManager#componentRemoved(Component)
*/
public void componentRemoved(Component component)
{
@@ -129,7 +134,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#componentStateChanging(org.apache.wicket.version.undo.Change)
+ * @see IPageVersionManager#componentStateChanging(Change)
*/
public void componentStateChanging(Change change)
{
@@ -137,7 +142,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#endVersion(boolean)
+ * @see IPageVersionManager#endVersion(boolean)
*/
public void endVersion(boolean mergeVersion)
{
@@ -152,16 +157,17 @@
else
{
ignoreMerge = false;
- // Push change list onto stack
+
+ // Push change list onto stack.
changeListStack.push(changeList);
- // If stack is overfull, remove oldest entry
+ // If stack is overfull, remove oldest entry.
if (getVersions() > maxVersions)
{
expireOldestVersion();
}
- // Make memory efficient for replication
+ // Make memory efficient for replication.
changeListStack.trimToSize();
if (log.isDebugEnabled())
@@ -172,7 +178,7 @@
}
/**
- * Expires an old version
+ * @see IPageVersionManager#expireOldestVersion()
*/
public void expireOldestVersion()
{
@@ -180,7 +186,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#getCurrentVersionNumber()
+ * @see IPageVersionManager#getCurrentVersionNumber()
*/
public int getCurrentVersionNumber()
{
@@ -188,7 +194,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#getAjaxVersionNumber()
+ * @see IPageVersionManager#getAjaxVersionNumber()
*/
public int getAjaxVersionNumber()
{
@@ -196,35 +202,35 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#getVersion(int)
+ * @see IPageVersionManager#getVersion(int)
*/
public Page getVersion(final int versionNumber)
{
- // If the requested version is at or before the current version
+ // If the requested version is at or before the current version,
if (versionNumber <= getCurrentVersionNumber())
{
- // Loop until we reach the right version
+ // loop until we reach the right version.
while (getCurrentVersionNumber() > versionNumber)
{
- // Go back one version
+ // Go back one version.
if (!undo())
{
return null;
}
}
- // Return modified page
+ // Return modified page.
return page;
}
else
{
- // The version is not available
+ // The version is not available.
return null;
}
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#rollbackPage(int)
+ * @see IPageVersionManager#rollbackPage(int)
*/
public Page rollbackPage(int numberOfVersions)
{
@@ -233,7 +239,7 @@
}
/**
- * @see org.apache.wicket.version.IPageVersionManager#getVersions()
+ * @see IPageVersionManager#getVersions()
*/
public int getVersions()
{
@@ -241,10 +247,10 @@
}
/**
- * Goes back a version from the current version
+ * Goes back a <code>Page</code> version from the current version.
*
- * @return True if the page was successfully reverted to its previous
- * version
+ * @return <code>true</code> if the page was successfully reverted to its
+ * previous version
*/
private boolean undo()
{
@@ -258,17 +264,17 @@
return false;
}
- // Pop off top change list
+ // Pop off the top change list.
final ChangeList changeList = (ChangeList)changeListStack.pop();
if (changeList == null)
{
return false;
}
- // Undo changes made to previous version to get to this version
+ // Undo changes made to the previous version to get to this version.
changeList.undo();
- // One less version around
+ // There is now one less version around.
currentVersionNumber--;
return true;
}
Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/package.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/package.html?rev=575165&r1=575164&r2=575165&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/package.html (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/version/undo/package.html Wed Sep 12 21:46:27 2007
@@ -18,14 +18,16 @@
<html>
<head>
<title>
- wicket.version.undo package
+ org.apache.wicket.version.undo package
</title>
</head>
<body>
<p>
- This packages provides the default implementation of Wicket's back button support in
- the form of the ability to record and 'undo' changes to component composition structure,
- model changes and user specific (such as the current page of pageable lists) changes.
+ This package provides the default implementation of Wicket's back
+ button support in the form of the ability to record and 'undo'
+ changes to <code>Component</code> composition structure,
+ <code>IModel</code> changes, and user-specific changes
+ (such as the current page of pageable lists).
</p>
</body>
</html>