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/03/22 19:33:48 UTC

svn commit: r521398 - in /incubator/wicket/branches/wicket-1.x/jdk-1.4: wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/ wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ wicket-extensions/src/main/java/wicket...

Author: ivaynberg
Date: Thu Mar 22 11:33:44 2007
New Revision: 521398

URL: http://svn.apache.org/viewvc?view=rev&rev=521398
Log:
attach/detach refactor/backport from trunk

Modified:
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/breadcrumb/BreadCrumbBar.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/tree/AbstractTree.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/NextButton.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/WizardStep.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/MarkupContainer.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/ajax/AjaxRequestTarget.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/Form.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/FileUploadField.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/MultiFileUploadField.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/Link.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/ListView.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/Loop.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/navigation/paging/PagingNavigation.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/tree/Tree.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/AbstractPageableView.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/RefreshingView.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/BookmarkablePageRequestTarget.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/ComponentRequestTarget.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/PageRequestTarget.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/resource/ComponentResourceRequestTarget.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/TestDetachPage.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/upload/FileUploadFieldTest.java

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java Thu Mar 22 11:33:44 2007
@@ -327,10 +327,11 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
 		// if tempModel - set on construction - is not-null, the label and
 		// editor components have not yet been set.
 		if (tempModel != null)

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ModalWindow.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ModalWindow.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/ModalWindow.java Thu Mar 22 11:33:44 2007
@@ -700,6 +700,7 @@
 	 */
 	protected void onAttach()
 	{
+		super.onAttach();
 		getContent().setOutputMarkupId(true);
 		getContent().setVisible(shown);
 	}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/breadcrumb/BreadCrumbBar.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/breadcrumb/BreadCrumbBar.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/breadcrumb/BreadCrumbBar.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/breadcrumb/BreadCrumbBar.java Thu Mar 22 11:33:44 2007
@@ -107,10 +107,11 @@
 		}
 
 		/**
-		 * @see wicket.markup.html.list.ListView#internalOnAttach()
+		 * @see wicket.markup.html.list.ListView#onAttach()
 		 */
-		protected void internalOnAttach()
+		protected void onAttach()
 		{
+			super.onAttach();
 			if (dirty)
 			{
 				super.internalOnAttach();

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/form/palette/Palette.java Thu Mar 22 11:33:44 2007
@@ -96,7 +96,7 @@
 	/** reference to the palette's javascript resource */
 	private static final ResourceReference JAVASCRIPT = new ResourceReference(Palette.class,
 			"palette.js");
-	
+
 	/** reference to the palette's css resource */
 	private static final ResourceReference CSS = new ResourceReference(Palette.class, "palette.css");
 
@@ -183,10 +183,10 @@
 			add(HeaderContributor.forCss(css));
 		}
 	}
-	
+
 	/**
-	 * Returns the resource reference of the default stylesheet.
-	 * You may return null to avoid using any stylesheet.
+	 * Returns the resource reference of the default stylesheet. You may return
+	 * null to avoid using any stylesheet.
 	 * 
 	 * @return A resource reference
 	 */
@@ -194,12 +194,14 @@
 	{
 		return CSS;
 	}
-	
+
 	/**
 	 * Can be overriden by clients for custom style sheet
+	 * 
 	 * @return the style sheet reference
 	 */
-	protected StyleSheetReference getStyleSheet() {
+	protected StyleSheetReference getStyleSheet()
+	{
 		return new StyleSheetReference("paletteCSS", getClass(), "palette.css");
 	}
 
@@ -512,13 +514,14 @@
 		return buildJSCall("paletteMoveDown");
 	}
 
-	protected void internalOnDetach()
+	protected void onDetach()
 	{
-		super.internalOnDetach();
 		// we need to manually detach the choices model since it is not attached
 		// to a component
 		// an alternative might be to attach it to one of the subcomponents
 		choicesModel.detach();
+
+		super.onDetach();
 	}
 
 	private class PaletteButton extends WebMarkupContainer

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/tree/AbstractTree.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/tree/AbstractTree.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/tree/AbstractTree.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/markup/html/tree/AbstractTree.java Thu Mar 22 11:33:44 2007
@@ -223,12 +223,13 @@
 		{
 			setFlag(FLAG_RENDER_CHILDREN, value);
 		}
-		
+
 		protected void onDetach()
 		{
 			super.onDetach();
 			Object object = getModelObject();
-			if(object instanceof IDetachable) {
+			if (object instanceof IDetachable)
+			{
 				((IDetachable)object).detach();
 			}
 		}
@@ -454,22 +455,23 @@
 
 	/**
 	 * This method is called before the onAttach is called. Code here gets
-	 * executed before the items have been populated. 
+	 * executed before the items have been populated.
 	 */
-	protected void onBeforeAttach() 
-	{	
+	protected void onBeforeAttach()
+	{
 	}
-	
+
 	/**
 	 * Called at the beginning of the request (not ajax request, unless we are
 	 * rendering the entire component)
 	 */
-	public void internalAttach()
+	public void onAttach()
 	{
+		super.onAttach();
 		if (attached == false)
 		{
 			onBeforeAttach();
-			
+
 			checkModel();
 
 			// Do we have to rebuld the whole tree?
@@ -507,16 +509,15 @@
 			attached = true;
 		}
 
-		super.internalAttach();
 	}
 
 	/**
-	 * @see wicket.MarkupContainer#internalDetach()
+	 * @see wicket.MarkupContainer#onDetach()
 	 */
-	public void internalDetach()
+	public void onDetach()
 	{
-		super.internalDetach();
 		attached = false;
+		super.onDetach();
 	}
 
 	/**
@@ -632,14 +633,14 @@
 				}
 		}
 	};
-	
+
 	/**
-	 * Marks the last but one visible child node of the given item as dirty,
-	 * if give child is the last item of parent.
+	 * Marks the last but one visible child node of the given item as dirty, if
+	 * give child is the last item of parent.
 	 * 
-	 * We need this to refresh the previous visible item in case the 
-	 * inserted / deleteditem was last. The reason is that  the line 
-	 * shape of previous item chages from L to |- .
+	 * We need this to refresh the previous visible item in case the inserted /
+	 * deleteditem was last. The reason is that the line shape of previous item
+	 * chages from L to |- .
 	 * 
 	 * @param parent
 	 * @param child
@@ -654,13 +655,14 @@
 			{
 				TreeItem item = (TreeItem)parent.getChildren().get(i);
 
-				// invalidate the node and it's children, so that they are redrawn
+				// invalidate the node and it's children, so that they are
+				// redrawn
 				invalidateNodeWithChildren((TreeNode)item.getModelObject());
-					
+
 			}
 		}
 	}
-	
+
 	/**
 	 * @see javax.swing.event.TreeModelListener#treeNodesInserted(javax.swing.event.TreeModelEvent)
 	 */
@@ -668,7 +670,7 @@
 	{
 		// get the parent node of inserted nodes
 		TreeNode parent = (TreeNode)e.getTreePath().getLastPathComponent();
-		
+
 		if (isNodeVisible(parent) && isNodeExpanded(parent))
 		{
 			TreeItem parentItem = (TreeItem)nodeToItemMap.get(parent);
@@ -679,8 +681,8 @@
 				TreeItem item = newTreeItem(node, parentItem.getLevel() + 1);
 				itemContainer.add(item);
 				parentItem.getChildren().add(index, item);
-				
-				markTheLastButOneChildDirty(parentItem, item);				
+
+				markTheLastButOneChildDirty(parentItem, item);
 
 				dirtyItems.add(item);
 				dirtyItemsCreateDOM.add(item);
@@ -708,7 +710,7 @@
 				if (item != null)
 				{
 					markTheLastButOneChildDirty(parentItem, item);
-					
+
 					parentItem.getChildren().remove(item);
 
 					// go though item children and remove every one of them
@@ -721,7 +723,7 @@
 							// unselect the node
 							getTreeState().selectNode((TreeNode)item.getModelObject(), false);
 						}
-					});										
+					});
 
 					removeItem(item);
 				}
@@ -784,10 +786,14 @@
 				target.prependJavascript(js);
 			}
 
-			// We have to repeat this as long as there are any dirty items to be created.
-			// The reason why we can't do this in one pass is that some of the items
-			// may need to be inserted after items that has not been inserted yet, so we have
-			// to detect those and wait until the items they depend on are inserted.
+			// We have to repeat this as long as there are any dirty items to be
+			// created.
+			// The reason why we can't do this in one pass is that some of the
+			// items
+			// may need to be inserted after items that has not been inserted
+			// yet, so we have
+			// to detect those and wait until the items they depend on are
+			// inserted.
 			while (dirtyItemsCreateDOM.isEmpty() == false)
 			{
 				for (Iterator i = dirtyItemsCreateDOM.iterator(); i.hasNext();)
@@ -797,7 +803,7 @@
 					int index = parent.getChildren().indexOf(item);
 					TreeItem previous;
 					// we need item before this (in dom structure)
-					
+
 					if (index == 0)
 					{
 						previous = parent;
@@ -815,17 +821,20 @@
 					// check if the previous item isn't waiting to be inserted
 					if (dirtyItemsCreateDOM.contains(previous) == false)
 					{
-						// it's already in dom, so we can use it as point of insertion
-						target.prependJavascript("Wicket.Tree.createElement(\"" + item.getMarkupId()
-								+ "\"," + "\"" + previous.getMarkupId() + "\")");
-						
+						// it's already in dom, so we can use it as point of
+						// insertion
+						target.prependJavascript("Wicket.Tree.createElement(\""
+								+ item.getMarkupId() + "\"," + "\"" + previous.getMarkupId()
+								+ "\")");
+
 						// remove the item so we don't process it again
 						i.remove();
 					}
 					else
 					{
-						// we don't do anything here, inserting this item will have to wait 
-						// until the previous item gets inserted 
+						// we don't do anything here, inserting this item will
+						// have to wait
+						// until the previous item gets inserted
 					}
 				}
 			}
@@ -1056,8 +1065,9 @@
 		return item.getMarkupId().substring(skip);
 	}
 
-	private final static ResourceReference JAVASCRIPT = new JavascriptResourceReference(AbstractTree.class, "res/tree.js");
-	
+	private final static ResourceReference JAVASCRIPT = new JavascriptResourceReference(
+			AbstractTree.class, "res/tree.js");
+
 	/**
 	 * Initialize the component.
 	 */
@@ -1093,32 +1103,32 @@
 			if (item != null)
 			{
 				boolean createDOM = false;
-				
+
 				if (forceRebuild)
 				{
 					// recreate the item
 					int level = item.getLevel();
 					List children = item.getChildren();
 					String id = item.getId();
-	
+
 					// store the parent of old item
 					TreeItem parent = item.getParentItem();
-	
+
 					// if the old item has a parent, store it's index
 					int index = parent != null ? parent.getChildren().indexOf(item) : -1;
-					
+
 					createDOM = dirtyItemsCreateDOM.contains(item);
-					
+
 					dirtyItems.remove(item);
 					dirtyItemsCreateDOM.remove(item);
-					
+
 					item.remove();
-	
+
 					item = newTreeItem(node, level, id);
 					itemContainer.add(item);
-	
+
 					item.setChildren(children);
-	
+
 					// was the item an root item?
 					if (parent == null)
 					{
@@ -1129,7 +1139,7 @@
 						parent.getChildren().set(index, item);
 					}
 				}
-				
+
 				dirtyItems.add(item);
 				if (createDOM)
 					dirtyItemsCreateDOM.add(item);
@@ -1267,13 +1277,14 @@
 
 		// if the item was about to be created
 		if (dirtyItemsCreateDOM.contains(item))
-		{		
+		{
 			// we needed to create DOM element, we no longer do
 			dirtyItemsCreateDOM.remove(item);
 		}
 		else
 		{
-			// add items id (it's short version) to ids of DOM elements that will be
+			// add items id (it's short version) to ids of DOM elements that
+			// will be
 			// removed
 			deleteIds.append(getShortItemId(item));
 			deleteIds.append(",");
@@ -1342,6 +1353,6 @@
 	 */
 	public Component getNodeComponent(TreeNode node)
 	{
-		return (Component) nodeToItemMap.get(node);
+		return (Component)nodeToItemMap.get(node);
 	}
 }

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/NextButton.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/NextButton.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/NextButton.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/NextButton.java Thu Mar 22 11:33:44 2007
@@ -77,6 +77,7 @@
 	 */
 	protected final void onAttach()
 	{
+		super.onAttach();
 		// TODO after the constructor change we can do this in the constructor
 		// of either this class or the button form
 		getForm().setDefaultButton(this);

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/WizardStep.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/WizardStep.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/WizardStep.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-extensions/src/main/java/wicket/extensions/wizard/WizardStep.java Thu Mar 22 11:33:44 2007
@@ -460,6 +460,7 @@
 	 */
 	protected void onAttach()
 	{
+		super.onAttach();
 		if (onAttachAction != null)
 		{
 			onAttachAction.execute();

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java Thu Mar 22 11:33:44 2007
@@ -452,6 +452,11 @@
 	/** Reserved subclass-definable flag bit */
 	protected static final int FLAG_RESERVED8 = 0x80000;
 
+	private static final int FLAG_ATTACHED = 0x20000000;
+	private static final int FLAG_ATTACHING = 0x40000000;
+	private static final int FLAG_DETACHING = 0x80000000;
+
+
 	/** Basic model IModelComparator implementation for normal object models */
 	private static final IModelComparator defaultModelComparator = new IModelComparator()
 	{
@@ -482,8 +487,7 @@
 	private static final int FLAG_ESCAPE_MODEL_STRINGS = 0x0002;
 
 	/** Flag for Component holding root compound model */
-//	private static final int FLAG_HAS_ROOT_MODEL = 0x0004;
-
+	// private static final int FLAG_HAS_ROOT_MODEL = 0x0004;
 	/** Ignore attribute modifiers */
 	private static final int FLAG_IGNORE_ATTRIBUTE_MODIFIER = 0x0040;
 
@@ -2546,12 +2550,11 @@
 	 * OVERRIDE.
 	 * 
 	 * Called when a request begins.
+	 * 
+	 * @Deprecated use {@link #onAttach()} instead
 	 */
-	public void internalAttach()
+	protected final void internalOnAttach()
 	{
-		onBeginRequest();
-		onAttach();
-		internalOnAttach();
 	}
 
 	/**
@@ -2559,31 +2562,11 @@
 	 * OVERRIDE.
 	 * 
 	 * Called when a request ends.
-	 */
-	public void internalDetach()
-	{
-		internalOnDetach();
-		onDetach();
-		onEndRequest();
-	}
-
-	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
 	 * 
-	 * Called when a request begins.
-	 */
-	protected void internalOnAttach()
-	{
-	}
-
-	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
+	 * @Deprecated use {@link #onAttach()} instead
 	 * 
-	 * Called when a request ends.
 	 */
-	protected void internalOnDetach()
+	protected final void internalOnDetach()
 	{
 	}
 
@@ -2671,14 +2654,105 @@
 	{
 	}
 
+
+	/**
+	 * Attaches any child components
+	 * 
+	 * This method is here only for {@link MarkupContainer}. It is broken out
+	 * of {@link #onAttach()} so we can guarantee that it executes as the last
+	 * in onAttach() chain no matter where user places the
+	 * <code>super.onAttach()</code> call
+	 */
+	void attachChildren()
+	{
+		// noop
+	}
+
 	/**
-	 * Called to allow a component to attach resources for use. The semantics of
-	 * this will be tightened in Wicket 1.3 when we will add the guarantee that
-	 * onAttach() be called before any framework use of a Component (in the
-	 * implementation of request targets).
+	 * @deprecated
+	 * 
+	 */
+	private void internalAttach()
+	{
+
+	}
+
+	/**
+	 * @deprecated
+	 * 
+	 */
+	private void internalDetach()
+	{
+
+	}
+
+
+	/**
+	 * Attaches the component.
+	 */
+	public final void attach()
+	{
+		if (!getFlag(FLAG_ATTACHED))
+		{
+			setFlag(FLAG_ATTACHING, true);
+			onAttach();
+			if (getFlag(FLAG_ATTACHING))
+			{
+				throw new IllegalStateException(Component.class.getName()
+						+ " has not been properly attached. Something in the hierarchy of "
+						+ getClass().getName()
+						+ " has not called super.onAtach() in the override of onAttach() method");
+			}
+			setFlag(FLAG_ATTACHED, true);
+		}
+
+		attachChildren();
+	}
+
+	/**
+	 * Detaches any child components
+	 * 
+	 * @see {@link #attachChildren()}
+	 */
+	void detachChildren()
+	{
+
+	}
+
+	/**
+	 * Detaches the component.
+	 */
+	public final void detach()
+	{
+		if (getFlag(FLAG_ATTACHED))
+		{
+			setFlag(FLAG_DETACHING, true);
+			onDetach();
+			if (getFlag(FLAG_DETACHING))
+			{
+				throw new IllegalStateException(Component.class.getName()
+						+ " has not been properly detached. Something in the hierarchy of "
+						+ getClass().getName()
+						+ " has not called super.onDetach() in the override of onDetach() method");
+			}
+			setFlag(FLAG_ATTACHED, false);
+		}
+
+		detachChildren();
+	}
+
+
+	/**
+	 * Called to allow a component to attach resources for use.
+	 * 
+	 * Overrides of this method MUST call the super implementation, the most
+	 * logical place to do this is the first line of the override method.
+	 * 
 	 */
 	protected void onAttach()
 	{
+		setFlag(FLAG_ATTACHING, false);
+
 	}
 
 	/**
@@ -2724,13 +2798,17 @@
 	}
 
 	/**
-	 * Called to allow a component to detach resources after use. The semantics
-	 * of this will be tightened in Wicket 1.3 when we will add the guarantee
-	 * that onDetach() be called after all framework use of a Component (in the
-	 * implementation of request targets).
+	 * Called to allow a component to detach resources after use.
+	 * 
+	 * Overrides of this method MUST call the super implementation, the most
+	 * logical place to do this is the last line of the override method.
+	 * 
+	 * 
 	 */
 	protected void onDetach()
 	{
+		setFlag(FLAG_DETACHING, false);
+
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/MarkupContainer.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/MarkupContainer.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/MarkupContainer.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/MarkupContainer.java Thu Mar 22 11:33:44 2007
@@ -188,7 +188,7 @@
 		}
 		component.setAuto(true);
 		add(component);
-		component.internalAttach();
+		component.attach();
 		component.render();
 		return true;
 	}
@@ -324,19 +324,12 @@
 		put(child);
 	}
 
-	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
-	 * 
-	 * Called when a request begins.
-	 */
-	public void internalAttach()
+
+	void attachChildren()
 	{
-		// Handle begin request for the container itself
+		super.attachChildren();
 		try
 		{
-			super.internalAttach();
-
 			// Loop through child components
 			final int size = children_size();
 			for (int i = 0; i < size; i++)
@@ -348,7 +341,7 @@
 				if (!(child instanceof IFeedback))
 				{
 					// Call begin request on the child
-					child.internalAttach();
+					child.attach();
 				}
 			}
 		}
@@ -362,17 +355,9 @@
 		}
 	}
 
-	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
-	 * 
-	 * Called when a request ends.
-	 */
-	public void internalDetach()
-	{
-		// Handle end request for the container itself
-		super.internalDetach();
 
+	void detachChildren()
+	{
 		// Loop through child components
 		final Iterator iter = iterator();
 		while (iter.hasNext())
@@ -381,8 +366,9 @@
 			final Component child = (Component)iter.next();
 
 			// Call end request on the child
-			child.internalDetach();
+			child.detach();
 		}
+		super.detachChildren();
 	}
 
 	/**
@@ -853,10 +839,13 @@
 	}
 
 	/**
-	 * NOT USED ANYMORE; it's here for helping people migrate from Wicket 1.2 to Wicket 1.3
+	 * NOT USED ANYMORE; it's here for helping people migrate from Wicket 1.2 to
+	 * Wicket 1.3
+	 * 
 	 * @param containerClass
 	 * @return nothing
-	 * @throws always throws an {@link IllegalStateException}
+	 * @throws always
+	 *             throws an {@link IllegalStateException}
 	 */
 	// TODO remove after release 1.3.0
 	public final IResourceStream newMarkupResourceStream(Class containerClass)

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java Thu Mar 22 11:33:44 2007
@@ -189,8 +189,6 @@
 	/** Version manager for this page */
 	private IPageVersionManager versionManager;
 
-	private transient boolean attached = false;
-
 	/**
 	 * Constructor.
 	 */
@@ -284,27 +282,6 @@
 	{
 	}
 
-	/**
-	 * @see wicket.MarkupContainer#internalDetach()
-	 */
-	public void internalDetach()
-	{
-		super.internalDetach();
-		endVersion();
-		attached = false;
-	}
-
-	/**
-	 * @see wicket.MarkupContainer#internalAttach()
-	 */
-	public void internalAttach()
-	{
-		if (!attached)
-		{
-			super.internalAttach();
-			attached = true;
-		}
-	}
 
 	/**
 	 * Detaches any attached models referenced by this page.
@@ -372,7 +349,7 @@
 			public Object component(Component component)
 			{
 				((IFeedback)component).updateFeedback();
-				component.internalAttach();
+				component.attach();
 				return IVisitor.CONTINUE_TRAVERSAL;
 			}
 		});
@@ -383,7 +360,7 @@
 		}
 
 		// Now, do the initialization for the other components
-		internalAttach();
+		attach();
 
 		// Visit all this page's children to reset markup streams and check
 		// rendering authorization, as appropriate. We set any result; positive
@@ -941,12 +918,9 @@
 	}
 
 	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
-	 * 
-	 * @see wicket.Component#internalOnDetach()
+	 * @see wicket.Component#onDetach()
 	 */
-	protected final void internalOnDetach()
+	protected void onDetach()
 	{
 		if (log.isDebugEnabled())
 		{
@@ -954,6 +928,10 @@
 		}
 
 		detachModels();
+		
+		endVersion();
+		
+		super.onDetach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/ajax/AjaxRequestTarget.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/ajax/AjaxRequestTarget.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/ajax/AjaxRequestTarget.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/ajax/AjaxRequestTarget.java Thu Mar 22 11:33:44 2007
@@ -574,7 +574,7 @@
 			while (it.hasNext())
 			{
 				final Component component = (Component)((Entry)it.next()).getValue();
-				component.internalAttach();
+				component.attach();
 			}
 
 			// process component markup
@@ -596,7 +596,7 @@
 			if (it.hasNext())
 			{
 				final Component component = (Component)((Entry)it.next()).getValue();
-				component.getPage().internalDetach();
+				component.getPage().detach();
 			}
 		}
 	}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/Form.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/Form.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/Form.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/Form.java Thu Mar 22 11:33:44 2007
@@ -400,12 +400,14 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnDetach()
+	 * @see wicket.Component#onDetach()
 	 */
-	protected void internalOnDetach()
+	protected void onDetach()
 	{
 		super.internalOnDetach();
 		setFlag(FLAG_SUBMITTED, false);
+		
+		super.onDetach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/FileUploadField.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/FileUploadField.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/FileUploadField.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/FileUploadField.java Thu Mar 22 11:33:44 2007
@@ -29,8 +29,7 @@
  * Form component that corresponds to a &lt;input type=&quot;file&quot;&gt;.
  * When a FileInput component is nested in a
  * {@link wicket.markup.html.form.Form}, that has multipart == true, its model
- * is updated with the {@link wicket.util.upload.FileItem}for this
- * component.
+ * is updated with the {@link wicket.util.upload.FileItem}for this component.
  * 
  * @author Eelco Hillenius
  */
@@ -40,7 +39,7 @@
 
 	/** True if a model has been set explicitly */
 	private boolean hasExplicitModel;
-	
+
 	private transient FileUpload fileUpload;
 
 	/**
@@ -70,7 +69,7 @@
 	{
 		// Get request
 		final Request request = getRequest();
-		
+
 		// If we successfully installed a multipart request
 		if (request instanceof IMultipartWebRequest)
 		{
@@ -81,16 +80,17 @@
 			// bytes)
 			if (item != null && item.getSize() > 0)
 			{
-				if (fileUpload == null) {
+				if (fileUpload == null)
+				{
 					fileUpload = new FileUpload(item);
 				}
-				
+
 				return fileUpload;
 			}
 		}
 		return null;
 	}
-	
+
 	/**
 	 * @see wicket.Component#setModel(wicket.model.IModel)
 	 */
@@ -111,17 +111,19 @@
 			setModelObject(getFileUpload());
 		}
 	}
-	
-	
+
+
 	/**
 	 * @see wicket.markup.html.form.FormComponent#getInputAsArray()
 	 */
 	public String[] getInputAsArray()
 	{
 		FileUpload fu = getFileUpload();
-		if(fu != null) return new String[] {fu.getClientFileName()};
+		if (fu != null)
+			return new String[] { fu.getClientFileName() };
 		return null;
 	}
+
 	/**
 	 * @see wicket.markup.html.form.FormComponent#isMultiPart()
 	 */
@@ -129,7 +131,7 @@
 	{
 		return true;
 	}
-	
+
 	/**
 	 * @see wicket.Component#onComponentTag(wicket.markup.ComponentTag)
 	 */
@@ -156,22 +158,18 @@
 	}
 
 	/**
-	 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR
-	 * OVERRIDE.
-	 * 
 	 * Clean up at the end of the request. This means closing all inputstreams
 	 * which might have been opened from the fileUpload.
 	 * 
-	 * @see wicket.Component#internalOnDetach()
+	 * @see wicket.Component#onDetach()
 	 */
-	protected void internalOnDetach()
+	protected void onDetach()
 	{
-		super.internalOnDetach();
-		
 		if (fileUpload != null)
 		{
 			fileUpload.closeStreams();
 			fileUpload = null;
 		}
+		super.onDetach();
 	}
 }

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/MultiFileUploadField.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/MultiFileUploadField.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/MultiFileUploadField.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/form/upload/MultiFileUploadField.java Thu Mar 22 11:33:44 2007
@@ -181,11 +181,11 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
-		super.internalOnAttach();
+		super.onAttach();
 
 		// auto toggle form's multipart property
 		Form form = (Form)findParent(Form.class);
@@ -329,9 +329,9 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnDetach()
+	 * @see wicket.Component#onDetach()
 	 */
-	protected void internalOnDetach()
+	protected void onDetach()
 	{
 		// cleanup any opened filestreams
 		Collection uploads = (Collection)getConvertedInput();
@@ -355,7 +355,7 @@
 			((Collection)modelObject).clear();
 		}
 
-		super.internalOnDetach();
+		super.onDetach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/Link.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/Link.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/Link.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/Link.java Thu Mar 22 11:33:44 2007
@@ -448,10 +448,12 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
+
 		// Set default for before/after link text
 		if (beforeDisabledLink == null)
 		{
@@ -534,7 +536,8 @@
 					tag.put("onclick", popupSettings.getPopupJavaScript());
 				}
 			}
-			else if (tag.getName().equalsIgnoreCase("script") || tag.getName().equalsIgnoreCase("style"))
+			else if (tag.getName().equalsIgnoreCase("script")
+					|| tag.getName().equalsIgnoreCase("style"))
 			{
 				tag.put("src", Strings.replaceAll(url, "&", "&amp;"));
 			}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/ListView.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/ListView.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/ListView.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/ListView.java Thu Mar 22 11:33:44 2007
@@ -280,6 +280,7 @@
 			 */
 			protected void onAttach()
 			{
+				super.onAttach();
 				setAutoEnable(false);
 				if (getList().indexOf(item.getModelObject()) == (getList().size() - 1))
 				{
@@ -336,6 +337,7 @@
 			 */
 			protected void onAttach()
 			{
+				super.onAttach();
 				setAutoEnable(false);
 				if (getList().indexOf(item.getModelObject()) == 0)
 				{
@@ -551,10 +553,12 @@
 	}
 
 	/**
-	 * @see wicket.MarkupContainer#internalOnAttach()
+	 * @see wicket.MarkupContainer#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
+
 		if (isVisibleInHierarchy())
 		{
 			// Get number of items to be displayed
@@ -585,23 +589,23 @@
 					// list view
 					removeAll();
 				}
-	
+
 				// Loop through the markup in this container for each item
 				for (int i = 0; i < size; i++)
 				{
 					// Get index
 					final int index = firstIndex + i;
-	
+
 					// If this component does not already exist, populate it
 					ListItem item = (ListItem)get(Integer.toString(index));
 					if (item == null)
 					{
 						// Create item for index
 						item = newItem(index);
-	
+
 						// Add list item
 						add(item);
-	
+
 						// Populate the list item
 						onBeginPopulateItem(item);
 						populateItem(item);

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/Loop.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/Loop.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/Loop.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/list/Loop.java Thu Mar 22 11:33:44 2007
@@ -106,10 +106,12 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
+		
 		// Remove any previous loop contents
 		removeAll();
 

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/navigation/paging/PagingNavigation.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/navigation/paging/PagingNavigation.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/navigation/paging/PagingNavigation.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/navigation/paging/PagingNavigation.java Thu Mar 22 11:33:44 2007
@@ -276,18 +276,17 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
 		// PagingNavigation itself (as well as the PageableListView)
 		// may have pages.
 
 		// The index of the first page link depends on the PageableListView's
 		// page currently printed.
 		this.setStartIndex();
-
-		super.internalOnAttach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/tree/Tree.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/tree/Tree.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/tree/Tree.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/tree/Tree.java Thu Mar 22 11:33:44 2007
@@ -294,8 +294,7 @@
 	public static final String NODE_IMAGE_NAME = "nodeImage";
 
 	/** Blank image. */
-	private static final ResourceReference BLANK = new ResourceReference(Tree.class,
-			"blank.gif");
+	private static final ResourceReference BLANK = new ResourceReference(Tree.class, "blank.gif");
 
 	/**
 	 * Reference to the css file.
@@ -304,12 +303,10 @@
 			"tree.css");
 
 	/** Minus sign image. */
-	private static final ResourceReference MINUS = new ResourceReference(Tree.class,
-			"minus.gif");
+	private static final ResourceReference MINUS = new ResourceReference(Tree.class, "minus.gif");
 
 	/** Plus sign image. */
-	private static final ResourceReference PLUS = new ResourceReference(Tree.class,
-			"plus.gif");
+	private static final ResourceReference PLUS = new ResourceReference(Tree.class, "plus.gif");
 
 	private static final long serialVersionUID = 1L;
 
@@ -686,10 +683,11 @@
 	}
 
 	/**
-	 * @see wicket.Component#internalOnAttach()
+	 * @see wicket.Component#onAttach()
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
+		super.onAttach();
 		// if we don't optimize, rebuild the paths on every request
 		if (!getOptimizeItemRemoval())
 		{

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/AbstractPageableView.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/AbstractPageableView.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/AbstractPageableView.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/AbstractPageableView.java Thu Mar 22 11:33:44 2007
@@ -102,10 +102,10 @@
 	}
 
 
-	protected void internalOnDetach()
+	protected void onDetach()
 	{
-		super.internalOnDetach();
 		clearCachedItemCount();
+		super.onDetach();
 	}
 
 	/**
@@ -267,22 +267,23 @@
 
 		if (currentPage != page)
 		{
-			if (isVersioned()) {
+			if (isVersioned())
+			{
 				addStateChange(new Change()
 				{
 					private static final long serialVersionUID = 1L;
-	
+
 					private final int old = currentPage;
-	
+
 					public void undo()
 					{
 						currentPage = old;
 					}
-	
+
 					public String toString()
 					{
-						return "CurrentPageChange[component: " + getPath() + ", currentPage: " + old
-								+ "]";
+						return "CurrentPageChange[component: " + getPath() + ", currentPage: "
+								+ old + "]";
 					}
 				});
 

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/RefreshingView.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/RefreshingView.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/RefreshingView.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/repeater/RefreshingView.java Thu Mar 22 11:33:44 2007
@@ -88,9 +88,9 @@
 	 * Refresh the items in the view. Delegates the creation of items to the
 	 * selected item reuse strategy
 	 */
-	protected void internalOnAttach()
+	protected void onAttach()
 	{
-		super.internalOnAttach();
+		super.onAttach();
 
 		if (isVisibleInHierarchy())
 		{

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/BookmarkablePageRequestTarget.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/BookmarkablePageRequestTarget.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/BookmarkablePageRequestTarget.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/BookmarkablePageRequestTarget.java Thu Mar 22 11:33:44 2007
@@ -117,7 +117,7 @@
 	{
 		if (page != null)
 		{
-			page.internalDetach();
+			page.detach();
 		}
 	}
 

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/ComponentRequestTarget.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/ComponentRequestTarget.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/ComponentRequestTarget.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/ComponentRequestTarget.java Thu Mar 22 11:33:44 2007
@@ -94,14 +94,14 @@
 				}
 
 				// attach
-				component.internalAttach();
+				component.attach();
 
 				// Render the component
 				component.renderComponent();
 			}
 			finally
 			{
-				component.getPage().internalDetach();
+				component.getPage().detach();
 			}
 		}
 

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/PageRequestTarget.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/PageRequestTarget.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/PageRequestTarget.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/component/PageRequestTarget.java Thu Mar 22 11:33:44 2007
@@ -80,7 +80,7 @@
 	 */
 	public void detach(RequestCycle requestCycle)
 	{
-		page.internalDetach();
+		page.detach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/resource/ComponentResourceRequestTarget.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/resource/ComponentResourceRequestTarget.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/resource/ComponentResourceRequestTarget.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/request/target/resource/ComponentResourceRequestTarget.java Thu Mar 22 11:33:44 2007
@@ -95,7 +95,7 @@
 	 */
 	public void detach(RequestCycle requestCycle)
 	{
-		page.internalDetach();
+		page.detach();
 	}
 
 	/**

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/TestDetachPage.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/TestDetachPage.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/TestDetachPage.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/TestDetachPage.java Thu Mar 22 11:33:44 2007
@@ -86,7 +86,7 @@
 			public void internalDetach()
 			{
 				nrComponentInternalDetachCalls++;
-				super.internalDetach();
+				super.detach();
 			}
 
 			protected void onDetach()
@@ -131,7 +131,7 @@
 	public void internalDetach()
 	{
 		nrPageInternalDetachCalls++;
-		super.internalDetach();
+		super.detach();
 	}
 
 	protected void onDetach()

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/upload/FileUploadFieldTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/upload/FileUploadFieldTest.java?view=diff&rev=521398&r1=521397&r2=521398
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/upload/FileUploadFieldTest.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/upload/FileUploadFieldTest.java Thu Mar 22 11:33:44 2007
@@ -110,7 +110,7 @@
 			// We should be able to read a byte
 			assertTrue(is.read() != -1);
 			
-			field.internalOnDetach();
+			field.detach();
 			
 			// The input stream should be closed so we shouldn't be able to read any more bytes
 			try