You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2015/10/19 14:46:34 UTC

[1/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - removed deprecated ZeroPaddingIntegerConverter

Repository: wicket
Updated Branches:
  refs/heads/master 6c30740cd -> 4d18b76a6


WICKET-6004 Wicket 8 cleanup - removed deprecated ZeroPaddingIntegerConverter


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4d18b76a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4d18b76a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4d18b76a

Branch: refs/heads/master
Commit: 4d18b76a6d8500c9b9047997b46ee8f55dd0fc9d
Parents: 3d03435
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 14:37:34 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../extensions/yui/calendar/DateTimeField.java  | 10 +++-
 .../converter/ZeroPaddingIntegerConverter.java  | 63 --------------------
 2 files changed, 8 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/4d18b76a/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
----------------------------------------------------------------------
diff --git a/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java b/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
index 25e15f2..83c7a60 100644
--- a/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
+++ b/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
@@ -16,6 +16,8 @@
  */
 package org.apache.wicket.extensions.yui.calendar;
 
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
@@ -37,7 +39,7 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.protocol.http.request.WebClientInfo;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.converter.ZeroPaddingIntegerConverter;
+import org.apache.wicket.util.convert.converter.IntegerConverter;
 import org.apache.wicket.validation.validator.RangeValidator;
 import org.joda.time.DateTimeFieldType;
 import org.joda.time.DateTimeZone;
@@ -113,7 +115,11 @@ public class DateTimeField extends FormComponentPanel<Date>
 	// PropertyModel string to access getAmOrPm
 	private static final String AM_OR_PM = "amOrPm";
 
-	private static final IConverter<Integer> MINUTES_CONVERTER = new ZeroPaddingIntegerConverter(2);
+	private static final IConverter<Integer> MINUTES_CONVERTER = new IntegerConverter() {
+		protected NumberFormat newNumberFormat(Locale locale) {
+			return new DecimalFormat("00");
+		}
+	};
 
 	// The dropdown list for AM/PM and it's associated model object
 	private DropDownChoice<AM_PM> amOrPmChoice;

http://git-wip-us.apache.org/repos/asf/wicket/blob/4d18b76a/wicket-util/src/main/java/org/apache/wicket/util/convert/converter/ZeroPaddingIntegerConverter.java
----------------------------------------------------------------------
diff --git a/wicket-util/src/main/java/org/apache/wicket/util/convert/converter/ZeroPaddingIntegerConverter.java b/wicket-util/src/main/java/org/apache/wicket/util/convert/converter/ZeroPaddingIntegerConverter.java
deleted file mode 100644
index 181be0b..0000000
--- a/wicket-util/src/main/java/org/apache/wicket/util/convert/converter/ZeroPaddingIntegerConverter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.
- */
-package org.apache.wicket.util.convert.converter;
-
-import java.util.Locale;
-
-/**
- * Converts from Object to Integer, adding zero-padding.
- * 
- * @author Eelco Hillenius
- * @author Jonathan Locke
- * @author Al Maw
- * 
- * @deprecated use an {@link IntegerConverter} with suitable format string instead
- */
-public class ZeroPaddingIntegerConverter extends IntegerConverter
-{
-	private static final long serialVersionUID = 1L;
-
-	private final int zeroPadLength;
-
-	/**
-	 * Constructs this converter.
-	 * 
-	 * @param zeroPadLength
-	 *            Minimum length of String to be outputted (will be zero-padded).
-	 */
-	public ZeroPaddingIntegerConverter(final int zeroPadLength)
-	{
-		this.zeroPadLength = zeroPadLength;
-	}
-
-	/**
-	 * @see org.apache.wicket.util.convert.converter.AbstractNumberConverter#convertToString(java.lang.Object,
-	 *      java.util.Locale)
-	 */
-	@Override
-	public String convertToString(final Integer value, final Locale locale)
-	{
-		String result = super.convertToString(value, locale);
-
-		while (result.length() < zeroPadLength)
-		{
-			result = "0" + result;
-		}
-
-		return result;
-	}
-}
\ No newline at end of file


[2/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - remove deprecated methods in MarkupContainer relating to hierarchy iterator and indices

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - remove deprecated methods in MarkupContainer relating to hierarchy iterator and indices


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e1741df3
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e1741df3
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e1741df3

Branch: refs/heads/master
Commit: e1741df37fea65c0e920eab4e4b70b6d7d4e669d
Parents: 32f1eff
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 14:22:26 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/wicket/MarkupContainer.java | 107 -------------------
 .../org/apache/wicket/MarkupContainerTest.java  |  91 ----------------
 2 files changed, 198 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/e1741df3/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
index b739d47..0c04a54 100644
--- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
+++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
@@ -23,7 +23,6 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 
 import org.apache.wicket.core.util.string.ComponentStrings;
 import org.apache.wicket.markup.ComponentTag;
@@ -42,7 +41,6 @@ import org.apache.wicket.model.IComponentInheritedModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.IWrapModel;
 import org.apache.wicket.settings.DebugSettings;
-import org.apache.wicket.util.iterator.ComponentHierarchyIterator;
 import org.apache.wicket.util.lang.Args;
 import org.apache.wicket.util.lang.Classes;
 import org.apache.wicket.util.lang.Generics;
@@ -892,31 +890,6 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp
 	}
 
 	/**
-	 * @return A iterator which iterators over all children and grand-children the Component
-	 * @deprecated ComponentHierarchyIterator is deprecated.
-	 *      Use {@link #visitChildren(org.apache.wicket.util.visit.IVisitor)} instead
-	 */
-	@Deprecated
-	public final ComponentHierarchyIterator visitChildren()
-	{
-		return new ComponentHierarchyIterator(this);
-	}
-
-	/**
-	 * @param clazz
-	 *            Filter condition
-	 * @return A iterator which iterators over all children and grand-children the Component,
-	 *         returning only components which implement (instanceof) the provided clazz.
-	 * @deprecated ComponentHierarchyIterator is deprecated.
-	 *      Use {@link #visitChildren(Class, org.apache.wicket.util.visit.IVisitor)} instead.
-	 */
-	@Deprecated
-	public final ComponentHierarchyIterator visitChildren(final Class<?> clazz)
-	{
-		return new ComponentHierarchyIterator(this).filterByClass(clazz);
-	}
-
-	/**
 	 * @param child
 	 *            Component being added
 	 */
@@ -1003,35 +976,6 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp
 	}
 
 	/**
-	 * Returns child component at the specified index. Note that this method has O(n) complexity on
-	 * the number of children.
-	 * 
-	 * @param index
-	 *            the index of the child in this container
-	 * @throws ArrayIndexOutOfBoundsException
-	 *             when {@code index} exceeds {@code size()}
-	 * @return child component at the specified index
-	 * @deprecated this method is marked for deletion for WICKET8
-	 */
-	@Deprecated
-	public final Component get(int index)
-	{
-		final int requestedIndex = index;
-		Component childAtIndex = null;
-		Iterator<Component> childIterator = iterator();
-		while (index >= 0 && childIterator.hasNext())
-		{
-			childAtIndex = childIterator.next();
-			index--;
-		}
-		if(index >= 0 || childAtIndex == null)
-		{
-			throw new ArrayIndexOutOfBoundsException(Integer.toString(requestedIndex));
-		}
-		return childAtIndex;
-	}
-
-	/**
 	 * 
 	 * @param id
 	 * @return The child component
@@ -1622,57 +1566,6 @@ public abstract class MarkupContainer extends Component implements Iterable<Comp
 		super.onAfterRenderChildren();
 	}
 
-	/**
-	 * Swaps position of children. This method is particularly useful for adjusting positions of
-	 * repeater's items without rebuilding the component hierarchy
-	 * 
-	 * @param idx1
-	 *            index of first component to be swapped
-	 * @param idx2
-	 *            index of second component to be swapped
-	 * @deprecated this method is marked for deletion for WICKET8
-	 */
-	@Deprecated
-	public final void swap(int idx1, int idx2)
-	{
-		int size = children_size();
-		if (idx1 < 0 || idx1 >= size)
-		{
-			throw new IndexOutOfBoundsException(
-				"Argument idx is out of bounds: " + idx1 + "<>[0," + size + ")");
-		}
-
-		if (idx2 < 0 || idx2 >= size)
-		{
-			throw new IndexOutOfBoundsException(
-				"Argument idx is out of bounds: " + idx2 + "<>[0," + size + ")");
-		}
-
-		if (idx1 == idx2)
-		{
-			return;
-		}
-
-		if (children instanceof List)
-		{
-			@SuppressWarnings("unchecked")
-			List<Component> childrenList = (List<Component>)children;
-			childrenList.set(idx1, childrenList.set(idx2, childrenList.get(idx1)));
-		}
-		else
-		{
-			@SuppressWarnings("unchecked")
-			Map<String, Component> childrenMap = (Map<String, Component>)children;
-			List<Component> childrenList = copyChildren();
-			childrenList.set(idx1, childrenList.set(idx2, childrenList.get(idx1)));
-			childrenMap.clear();
-			for (Component child : childrenList)
-			{
-				childrenMap.put(child.getId(), child);
-			}
-		}
-	}
-
 	@Override
 	protected void onDetach()
 	{

http://git-wip-us.apache.org/repos/asf/wicket/blob/e1741df3/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java b/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
index 1a5698e..4c24c02 100644
--- a/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/MarkupContainerTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.wicket;
 
-import static org.hamcrest.CoreMatchers.is;
-
 import org.apache.wicket.markup.IMarkupResourceStreamProvider;
 import org.apache.wicket.markup.html.WebComponent;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -111,95 +109,6 @@ public class MarkupContainerTest extends WicketTestCase
 	}
 
 	/**
-	 * Tests the get(int) method of MarkupContainer.
-	 */
-	@Test
-	public void getIndexed() 
-	{
-		MarkupContainer c = new WebMarkupContainer("parent");
-		Component c1 = new WebComponent("c1");
-		Component c2 = new WebComponent("c2");
-
-		c.add(c1);
-		c.add(c2);
-
-		assertThat(c.get(0), is(c1));
-		assertThat(c.get(1), is(c2));
-	}
-
-	/**
-	 * Tests the get(int) method of MarkupContainer with non-existing index.
-	 */
-	@Test(expected = ArrayIndexOutOfBoundsException.class)
-	public void getIndexedOutOfBounds()
-	{
-		MarkupContainer c = new WebMarkupContainer("parent");
-		Component c1 = new WebComponent("c1");
-
-		c.add(c1);
-
-		assertThat(c.get(0), is(c1));
-		c.get(1);
-	}
-
-	/**
-	 * Tests the get(int) method of MarkupContainer with negative index.
-	 */
-	@Test(expected = ArrayIndexOutOfBoundsException.class)
-	public void getIndexedNegative()
-	{
-		MarkupContainer c = new WebMarkupContainer("parent");
-		Component c1 = new WebComponent("c1");
-
-		c.add(c1);
-
-		assertThat(c.get(0), is(c1));
-		c.get(-1);
-	}
-
-	/**
-	 * Tests the get(int) method of MarkupContainer when the index exceeds the number of children.
-	 */
-	@Test(expected = ArrayIndexOutOfBoundsException.class)
-	public void getIndexedArrayIndexOutOfBoundsException() 
-	{
-		MarkupContainer c = new WebMarkupContainer("parent");
-		c.get(0);
-	}
-
-	/**
-	 * Tests the swap method.
-	 */
-	@Test
-	public void swap() 
-	{
-		MarkupContainer c = new WebMarkupContainer("parent");
-		Component c1 = new WebComponent("c1");
-		Component c2 = new WebComponent("c2");
-		Component c3 = new WebComponent("c3");
-
-		c.add(c1);
-		c.add(c2);
-		c.add(c3);
-
-		assertThat(c.get(0), is(c1));
-		assertThat(c.get(1), is(c2));
-		assertThat(c.get(2), is(c3));
-
-		c.swap(0, 1);
-		
-		assertThat(c.get(0), is(c2));
-		assertThat(c.get(1), is(c1));
-		assertThat(c.get(2), is(c3));
-
-		c.swap(0, 2);
-
-		assertThat(c.get(0), is(c3));
-		assertThat(c.get(1), is(c1));
-		assertThat(c.get(2), is(c2));
-	}
-
-	/**
 	 * https://issues.apache.org/jira/browse/WICKET-4006
 	 */
 	@Test(expected = IllegalArgumentException.class)


[6/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - removed deprecated css keys

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - removed deprecated css keys


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/3d03435f
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/3d03435f
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/3d03435f

Branch: refs/heads/master
Commit: 3d03435f4bb7f6124be04e15e07f3036603d5718
Parents: e1741df
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 14:28:10 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../html/repeater/data/sort/OrderByLink.java    | 25 --------------------
 1 file changed, 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/3d03435f/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/sort/OrderByLink.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/sort/OrderByLink.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/sort/OrderByLink.java
index 1d77eba..6eaadfe 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/sort/OrderByLink.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/sort/OrderByLink.java
@@ -16,7 +16,6 @@
  */
 package org.apache.wicket.extensions.markup.html.repeater.data.sort;
 
-import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.util.lang.Args;
 
@@ -33,21 +32,6 @@ public class OrderByLink<S> extends Link<Void>
 {
 	private static final long serialVersionUID = 1L;
 
-	/**
-	 * @deprecated use {@link OrderByBorder#SORT_ASCENDING_CSS_CLASS_KEY} instead
-	 */
-	public static final String SORT_ASCENDING_CSS_CLASS_KEY = OrderByBorder.SORT_ASCENDING_CSS_CLASS_KEY;
-
-	/**
-	 * @deprecated use {@link OrderByBorder#SORT_DESCENDING_CSS_CLASS_KEY} instead
-	 */
-	public static final String SORT_DESCENDING_CSS_CLASS_KEY = OrderByBorder.SORT_DESCENDING_CSS_CLASS_KEY;
-
-	/**
-	 * @deprecated use {@link OrderByBorder#SORT_NONE_CSS_CLASS_KEY} instead
-	 */
-	public static final String SORT_NONE_CSS_CLASS_KEY = OrderByBorder.SORT_NONE_CSS_CLASS_KEY;
-
 	/** sortable property */
 	private final S property;
 
@@ -139,13 +123,4 @@ public class OrderByLink<S> extends Link<Void>
 			return order == SortOrder.ASCENDING ? SortOrder.DESCENDING : SortOrder.ASCENDING;
 		}
 	}
-
-	/**
-	 * @deprecated delegates to super implementation only
-	 */
-	@Override
-	public void onComponentTag(final ComponentTag tag)
-	{
-		super.onComponentTag(tag);
-	}
 }
\ No newline at end of file


[3/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - removed deprecated behavior to tweak disabled links

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - removed deprecated behavior to tweak disabled links


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/937f2d73
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/937f2d73
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/937f2d73

Branch: refs/heads/master
Commit: 937f2d73a442d09cfa71060c3a8946c746cded54
Parents: 8c3f916
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 13:28:58 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../markup/html/link/DisabledLinkBehavior.java  | 180 -------------------
 .../navomatic/NavomaticApplication.java         |   9 -
 2 files changed, 189 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/937f2d73/wicket-core/src/main/java/org/apache/wicket/markup/html/link/DisabledLinkBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/link/DisabledLinkBehavior.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/link/DisabledLinkBehavior.java
deleted file mode 100644
index 7bb2a3a..0000000
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/link/DisabledLinkBehavior.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * 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.
- */
-package org.apache.wicket.markup.html.link;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.application.IComponentInstantiationListener;
-import org.apache.wicket.behavior.Behavior;
-import org.apache.wicket.markup.ComponentTag;
-
-/**
- * A behavior to change the representation of <em>disabled</em> links to that of Wicket 6.x:
- * <p>
- * Markup tags {@code <a>}, {@code <link>} and {@code <area>} are replaced with a {@code <span>}. By
- * default tags are enclosed in an {@code <em>} tag.
- * 
- * @deprecated altering the markup tag of disabled links is no longer recommended, thus clients
- *             should move to other solutions
- */
-@Deprecated
-public final class DisabledLinkBehavior extends Behavior
-{
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Simple insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 */
-	private String beforeDisabledLink;
-
-	/**
-	 * Simple insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 */
-	private String afterDisabledLink;
-
-	/**
-	 * Enclose each disabled link in {@code <em>}.
-	 */
-	public DisabledLinkBehavior()
-	{
-		this("<em>", "</em>");
-	}
-
-	/**
-	 * Enclose each disabled link in the given markup.
-	 * 
-	 * @param beforeDisabledLink
-	 *            markup to write before the link
-	 * @param afterDisabledLink
-	 *            markup to write after the link
-	 */
-	public DisabledLinkBehavior(String beforeDisabledLink, String afterDisabledLink)
-	{
-		this.beforeDisabledLink = beforeDisabledLink;
-		this.afterDisabledLink = afterDisabledLink;
-	}
-
-	/**
-	 * Sets the insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 * 
-	 * @param afterDisabledLink
-	 *            The insertion string
-	 * @return this
-	 */
-	public DisabledLinkBehavior setAfterDisabledLink(final String afterDisabledLink)
-	{
-		if (afterDisabledLink == null)
-		{
-			throw new IllegalArgumentException(
-				"Value cannot be null.  For no text, specify an empty String instead.");
-		}
-		this.afterDisabledLink = afterDisabledLink;
-		return this;
-	}
-
-	/**
-	 * Gets the insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 * 
-	 * @return The insertion string
-	 */
-	public String getAfterDisabledLink()
-	{
-		return afterDisabledLink;
-	}
-
-	/**
-	 * Sets the insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 * 
-	 * @param beforeDisabledLink
-	 *            The insertion string
-	 * @return this
-	 */
-	public DisabledLinkBehavior setBeforeDisabledLink(final String beforeDisabledLink)
-	{
-		if (beforeDisabledLink == null)
-		{
-			throw new IllegalArgumentException(
-				"Value cannot be null.  For no text, specify an empty String instead.");
-		}
-		this.beforeDisabledLink = beforeDisabledLink;
-		return this;
-	}
-
-	/**
-	 * Gets the insertion string to allow disabled links to look like <i>Disabled link </i>.
-	 * 
-	 * @return The insertion string
-	 */
-	public String getBeforeDisabledLink()
-	{
-		return beforeDisabledLink;
-	}
-
-	@Override
-	public void beforeRender(Component component)
-	{
-		// Draw anything before the body?
-		if (!component.isEnabledInHierarchy() && getBeforeDisabledLink() != null)
-		{
-			component.getResponse().write(getBeforeDisabledLink());
-		}
-	}
-
-	@Override
-	public void onComponentTag(Component component, ComponentTag tag)
-	{
-		if (!component.isEnabledInHierarchy())
-		{
-			// if the tag is an anchor proper
-			if (tag.getName().equalsIgnoreCase("a") || tag.getName().equalsIgnoreCase("link") ||
-				tag.getName().equalsIgnoreCase("area"))
-			{
-				// Change anchor link to span tag
-				tag.setName("span");
-			}
-		}
-	}
-
-	@Override
-	public void afterRender(Component component)
-	{
-		// Draw anything after the body?
-		if (!component.isEnabledInHierarchy() && getAfterDisabledLink() != null)
-		{
-			component.getResponse().write(getAfterDisabledLink());
-		}
-	}
-
-	/**
-	 * A listener for instantiations of {@link AbstractLink} to restore the disabled representation
-	 * to that of Wicket 6.x.
-	 */
-	@Deprecated
-	public static class LinkInstantiationListener implements IComponentInstantiationListener
-	{
-		/**
-		 * Adds an {@link DisabledLinkBehavior} to all {@link AbstractLink}s.
-		 */
-		@Override
-		public void onInstantiation(Component component)
-		{
-			if (component instanceof AbstractLink)
-			{
-				component.add(new DisabledLinkBehavior());
-			}
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/937f2d73/wicket-examples/src/main/java/org/apache/wicket/examples/navomatic/NavomaticApplication.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/navomatic/NavomaticApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/navomatic/NavomaticApplication.java
index 2656575..5e21939 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/navomatic/NavomaticApplication.java
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/navomatic/NavomaticApplication.java
@@ -18,7 +18,6 @@ package org.apache.wicket.examples.navomatic;
 
 import org.apache.wicket.Page;
 import org.apache.wicket.examples.WicketExampleApplication;
-import org.apache.wicket.markup.html.link.DisabledLinkBehavior;
 
 /**
  * Application class.
@@ -34,14 +33,6 @@ public class NavomaticApplication extends WicketExampleApplication
 	{
 	}
 
-	@Override
-	protected void init()
-	{
-		super.init();
-
-		getComponentInstantiationListeners().add(new DisabledLinkBehavior.LinkInstantiationListener());
-	}
-
 	/**
 	 * @see org.apache.wicket.Application#getHomePage()
 	 */


[7/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - component path attribute

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - component path attribute


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/32f1effc
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/32f1effc
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/32f1effc

Branch: refs/heads/master
Commit: 32f1effce607121fe1bd6ba1e330561ee6ec4644
Parents: af4c62a
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 13:52:38 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/wicket/Component.java  |  5 ----
 .../html/form/CheckBoxMultipleChoice.java       |  5 ----
 .../wicket/markup/html/form/RadioChoice.java    |  5 ----
 .../apache/wicket/settings/DebugSettings.java   | 29 --------------------
 .../wicket/settings/DebugSettingsTest.java      | 25 +----------------
 .../apache/wicket/jmx/DebugSettingsMBean.java   | 14 +++++-----
 .../wicket/jmx/wrapper/DebugSettings.java       | 10 +++----
 7 files changed, 13 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java
index 2c22cee..f244488 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3899,11 +3899,6 @@ public abstract class Component
 
 		DebugSettings debugSettings = getApplication().getDebugSettings();
 		String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-		if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-		{
-			// fallback to the old 'wicketpath'
-			componentPathAttributeName = "wicketpath";
-		}
 		if (Strings.isEmpty(componentPathAttributeName) == false)
 		{
 			String path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
index c13c40b..73c5e9e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoice.java
@@ -474,11 +474,6 @@ public class CheckBoxMultipleChoice<T> extends ListMultipleChoice<T>
 
 			DebugSettings debugSettings = getApplication().getDebugSettings();
 			String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-			if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-			{
-				// fallback to the old 'wicketpath'
-				componentPathAttributeName = "wicketpath";
-			}
 			if (Strings.isEmpty(componentPathAttributeName) == false)
 			{
 				CharSequence path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
index c55f446..2ab3b89 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RadioChoice.java
@@ -567,11 +567,6 @@ public class RadioChoice<T> extends AbstractSingleSelectChoice<T> implements IOn
 
 			DebugSettings debugSettings = getApplication().getDebugSettings();
 			String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
-			if (Strings.isEmpty(componentPathAttributeName) && debugSettings.isOutputComponentPath())
-			{
-				// fallback to the old 'wicketpath'
-				componentPathAttributeName = "wicketpath";
-			}
 			if (Strings.isEmpty(componentPathAttributeName) == false)
 			{
 				CharSequence path = getPageRelativePath();

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
index 8aa8782..35b3128 100644
--- a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
+++ b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
@@ -56,8 +56,6 @@ public class DebugSettings
 	 */
 	private boolean outputMarkupContainerClassName = false;
 
-	private boolean outputComponentPath = false;
-
 	private String componentPathAttributeName = null;
 
 	private boolean developmentUtilitiesEnabled = false;
@@ -183,33 +181,6 @@ public class DebugSettings
 	}
 
 	/**
-	 * @see #setOutputComponentPath(boolean)
-	 * @return <code>true</code> if output component path feature is enabled, <code>false</code>
-	 *         otherwise
-	 * @deprecated Use #getComponentPathAttributeName() instead
-	 */
-	@Deprecated
-	public boolean isOutputComponentPath()
-	{
-		return outputComponentPath;
-	}
-
-	/**
-	 * If set to <code>true</code> wicket will output component path in a <code>wicketpath</code>
-	 * attribute of the component tag. This can be useful for debugging and automating tests.
-	 *
-	 * @param outputComponentPath
-	 * @return {@code this} object for chaining
-	 * @deprecated Use #setComponentPathAttributeName() with a non-empty value
-	 */
-	@Deprecated
-	public DebugSettings setOutputComponentPath(boolean outputComponentPath)
-	{
-		this.outputComponentPath = outputComponentPath;
-		return this;
-	}
-
-	/**
 	 * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the
 	 * component tag to print the {@link org.apache.wicket.Component}'s path.
 	 * This can be useful for debugging and automating tests.

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
index 2dff670..a81a981 100644
--- a/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
@@ -51,27 +51,4 @@ public class DebugSettingsTest extends WicketTestCase
 		String wicketPath = tagTester.getAttribute(attributeName);
 		assertEquals(link.getPageRelativePath(), wicketPath);
 	}
-
-	/**
-	 * https://issues.apache.org/jira/browse/WICKET-5498
-	 */
-	@Test
-	public void setComponentPathAttributeNameDeprected()
-	{
-		tester.getApplication().getDebugSettings().setOutputComponentPath(true);
-		MockPageWithLink page = new MockPageWithLink();
-		Component link = new Link(MockPageWithLink.LINK_ID)
-		{
-			@Override
-			public void onClick()
-			{
-			}
-		}.setMarkupId(MockPageWithLink.LINK_ID);
-		page.add(link);
-		tester.startPage(page);
-
-		TagTester tagTester = tester.getTagById(MockPageWithLink.LINK_ID);
-		String wicketPath = tagTester.getAttribute("wicketpath");
-		assertEquals(link.getPageRelativePath(), wicketPath);
-	}
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java
----------------------------------------------------------------------
diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java
index a9e21db..b65cafd 100644
--- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java
+++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java
@@ -53,19 +53,19 @@ public interface DebugSettingsMBean
 
 
 	/**
-	 * If set to <code>true</code> wicket will output component path in a <code>wicket:path</code>
-	 * attribute of the component tag. This can be useful for debugging and automating tests.
+	 * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the
+	 * component tag to print the {@link org.apache.wicket.Component}'s path.
 	 * 
 	 * @param enabled
 	 */
-	public void setOutputComponentPath(boolean enabled);
+	public void setComponentPathAttributeName(String name);
 
 	/**
-	 * @see #setOutputComponentPath(boolean)
-	 * @return <code>true</code> if output component path feature is enabled, <code>false</code>
-	 *         otherwise
+	 * @see #setComponentPathAttributeName(String)
+	 * @return The name of the attribute for the {@link org.apache.wicket.markup.ComponentTag}.
+	 *         If {@code null} or empty then the attribute won't be rendered
 	 */
-	public boolean isOutputComponentPath();
+	public String getComponentPathAttributeName();
 
 	/**
 	 * Enables wrapping output of markup container in html comments that contain markup container's

http://git-wip-us.apache.org/repos/asf/wicket/blob/32f1effc/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
----------------------------------------------------------------------
diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
index fcd073a..8f80816 100644
--- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
+++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java
@@ -75,21 +75,21 @@ public class DebugSettings implements DebugSettingsMBean
 	}
 
 	/**
-	 * @see org.apache.wicket.jmx.DebugSettingsMBean#setOutputComponentPath(boolean)
+	 * @see org.apache.wicket.jmx.DebugSettingsMBean#setComponentPathAttributeName(boolean)
 	 */
 	@Override
-	public void setOutputComponentPath(final boolean enabled)
+	public void setComponentPathAttributeName(final String name)
 	{
-		application.getDebugSettings().setOutputComponentPath(enabled);
+		application.getDebugSettings().setComponentPathAttributeName(name);
 	}
 
 	/**
 	 * @see org.apache.wicket.jmx.DebugSettingsMBean#isOutputComponentPath()
 	 */
 	@Override
-	public boolean isOutputComponentPath()
+	public String getComponentPathAttributeName()
 	{
-		return application.getDebugSettings().isOutputComponentPath();
+		return application.getDebugSettings().getComponentPathAttributeName();
 	}
 
 


[4/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - removed deprecated allowDefault

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - removed deprecated allowDefault


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8c3f9163
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8c3f9163
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8c3f9163

Branch: refs/heads/master
Commit: 8c3f91632bc42ac038a0f9b7baddba09db120191
Parents: 6c30740
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 13:13:57 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../ajax/attributes/AjaxRequestAttributes.java  | 20 --------------------
 1 file changed, 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/8c3f9163/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java
index fea733d..f39fdf8 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxRequestAttributes.java
@@ -348,26 +348,6 @@ public final class AjaxRequestAttributes
 	}
 
 	/**
-	 * @return {@code this} object for chaining
-	 * @deprecated Use #setPreventDefault() instead
-	 */
-	@Deprecated
-	public AjaxRequestAttributes setAllowDefault(boolean allowDefault)
-	{
-		this.preventDefault = !allowDefault;
-		return this;
-	}
-
-	/**
-	 * @deprecated Use #isPreventDefault() instead
-	 */
-	@Deprecated
-	public boolean isAllowDefault()
-	{
-		return !preventDefault;
-	}
-
-	/**
 	 * Only applies for event behaviors. Returns whether the behavior should allow the JavaScript
 	 * event to propagate to the parent of its target.
 	 */


[5/7] wicket git commit: WICKET-6004 Wicket 8 cleanup - ListItemModel is read-only

Posted by sv...@apache.org.
WICKET-6004 Wicket 8 cleanup - ListItemModel is read-only


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/af4c62aa
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/af4c62aa
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/af4c62aa

Branch: refs/heads/master
Commit: af4c62aab1f059818cb11a8db921d3f2516cb00a
Parents: 937f2d7
Author: Sven Meier <sv...@apache.org>
Authored: Mon Oct 19 13:31:02 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Oct 19 14:45:11 2015 +0200

----------------------------------------------------------------------
 .../wicket/markup/html/list/ListItemModel.java  | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/af4c62aa/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListItemModel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListItemModel.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListItemModel.java
index a66492f..0b8192b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListItemModel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListItemModel.java
@@ -16,9 +16,7 @@
  */
 package org.apache.wicket.markup.html.list;
 
-import java.util.List;
-
-import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
 
 /**
  * Model for list items.
@@ -28,7 +26,7 @@ import org.apache.wicket.model.IModel;
  *            Model object type
  * 
  */
-public class ListItemModel<T> implements IModel<T>
+public class ListItemModel<T> extends AbstractReadOnlyModel<T>
 {
 	private static final long serialVersionUID = 1L;
 
@@ -62,20 +60,6 @@ public class ListItemModel<T> implements IModel<T>
 	}
 
 	/**
-	 * @deprecated this method inserts a {@code T} into a {@code List<? extends T>}, which might
-	 *             fail in cases where {@code ?} is not {@code T}
-	 * 
-	 * @see ListView#ListView(String, IModel)
-	 */
-	@Deprecated
-	@SuppressWarnings("unchecked")
-	@Override
-	public void setObject(T object)
-	{
-		((List<T>)listView.getModelObject()).set(index, object);
-	}
-
-	/**
 	 * @see org.apache.wicket.model.IDetachable#detach()
 	 */
 	@Override