You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2015/01/11 22:06:46 UTC

[1/2] wicket git commit: Factory method for the minutes Textfield

Repository: wicket
Updated Branches:
  refs/heads/master b1f4e6a34 -> be028e0bb


Factory method for the minutes Textfield

Created new factory method for the minutes Textfield

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

Branch: refs/heads/master
Commit: 5b05b9f208e99c7d23afcd33985a746a3804bdd6
Parents: 334808b
Author: astrapi69 <as...@gmx.net>
Authored: Thu Jan 8 13:30:09 2015 +0100
Committer: astrapi69 <as...@gmx.net>
Committed: Thu Jan 8 13:30:09 2015 +0100

----------------------------------------------------------------------
 .../extensions/yui/calendar/DateTimeField.java  | 60 +++++++++++++-------
 1 file changed, 39 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5b05b9f2/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 aecf57a..5f12638 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
@@ -167,27 +167,8 @@ public class DateTimeField extends FormComponentPanel<Date>
 			Integer.class));
 
 		// Create and add the "minutes" TextField
-		add(minutesField = new TextField<Integer>(MINUTES,
-			new PropertyModel<Integer>(this, MINUTES), Integer.class)
-		{
-			private static final long serialVersionUID = 1L;
-
-			@SuppressWarnings("unchecked")
-			@Override
-			public <C> IConverter<C> getConverter(Class<C> type)
-			{
-				if (Integer.class.isAssignableFrom(type))
-				{
-					return (IConverter<C>)MINUTES_CONVERTER;
-				}
-				else
-				{
-					return super.getConverter(type);
-				}
-			}
-		});
-		minutesField.add(new RangeValidator<>(0, 59));
-		minutesField.setLabel(new Model<>(MINUTES));
+		add(minutesField = newMinutesTextField(MINUTES, new PropertyModel<Integer>(this, MINUTES),
+			Integer.class));
 
 		// Create and add the "AM/PM" Listbox
 		add(amOrPmChoice = new DropDownChoice<AM_PM>(AM_OR_PM_CHOICE, new PropertyModel<AM_PM>(
@@ -225,6 +206,43 @@ public class DateTimeField extends FormComponentPanel<Date>
 	}
 
 	/**
+	 * create a new {@link TextField} instance for minutes to be added to this panel.
+	 *
+	 * @param id
+	 *            the component id
+	 * @param model
+	 *            model that should be used by the {@link TextField}
+	 * @param type
+	 *            the type of the text field
+	 * @return a new text field instance
+	 */
+	protected TextField<Integer> newMinutesTextField(final String id, IModel<Integer> model,
+		Class<Integer> type)
+	{
+		TextField<Integer> minutesField = new TextField<Integer>(id, model, type)
+		{
+			private static final long serialVersionUID = 1L;
+
+			@SuppressWarnings("unchecked")
+			@Override
+			public <C> IConverter<C> getConverter(Class<C> type)
+			{
+				if (Integer.class.isAssignableFrom(type))
+				{
+					return (IConverter<C>)MINUTES_CONVERTER;
+				}
+				else
+				{
+					return super.getConverter(type);
+				}
+			}
+		};
+		minutesField.add(new RangeValidator<>(0, 59));
+		minutesField.setLabel(new Model<>(MINUTES));
+		return minutesField;
+	}
+
+	/**
 	 * 
 	 * @return The date TextField
 	 */


[2/2] wicket git commit: Merge branch 'patch-1' of https://github.com/astrapi69/wicket into pr-81-patch-1

Posted by mg...@apache.org.
Merge branch 'patch-1' of https://github.com/astrapi69/wicket into pr-81-patch-1


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

Branch: refs/heads/master
Commit: be028e0bb15947d49c195729a4ed8f7f35f07f41
Parents: b1f4e6a 5b05b9f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Sun Jan 11 22:04:18 2015 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Sun Jan 11 22:04:18 2015 +0100

----------------------------------------------------------------------
 .../extensions/yui/calendar/DateTimeField.java  | 60 +++++++++++++-------
 1 file changed, 39 insertions(+), 21 deletions(-)
----------------------------------------------------------------------