• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DateTextField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.wicket.extensions.markup.html.form.DateTextField的典型用法代码示例。如果您正苦于以下问题:Java DateTextField类的具体用法?Java DateTextField怎么用?Java DateTextField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DateTextField类属于org.apache.wicket.extensions.markup.html.form包,在下文中一共展示了DateTextField类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDateTextField

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
/**
 * Gets the DateTextField inside this datepicker wrapper.
 *
 * @return the date field
 */
public DateTextField getDateTextField()
{
	DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
		@Override
		public void component(DateTextField arg0, IVisit<DateTextField> arg1) {
			arg1.stop(arg0);
		}
	});

	if (component == null) {
		
		throw new WicketRuntimeException("BootstrapDateTimepicker didn't have any DateTextField child!");
	}
	
	return component;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:22,代码来源:BootstrapDateTimePicker.java


示例2: testTagInjection

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testTagInjection() {
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour());
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester elem = TagTester.createTagByAttribute(doc, "wicket:id", "field");
	assertEquals("en", elem.getAttribute("data-date-language"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:18,代码来源:BootstrapDatePickerBehaviourTest.java


示例3: testCSSInjection

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testCSSInjection() {
	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour());
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> css = TagTester.createTagsByAttribute(head.getValue(), "type", "text/css", false);
	assertEquals(1, css.size());
	assertEquals("link", css.get(0).getName());
	assertTrue(css.get(0).getAttribute("href").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/datepicker(.*)\\.css"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:21,代码来源:BootstrapDatePickerBehaviourTest.java


示例4: testNonInjectionInDisabledComponent

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testNonInjectionInDisabledComponent() {
	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour());
		}};
	field.setEnabled(false);
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	assertNull(TagTester.createTagByAttribute(doc, "head"));

	TagTester elem = TagTester.createTagByAttribute(doc, "wicket:id", "field");
	assertNull(elem.getAttribute("data-date-language"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:19,代码来源:BootstrapDatePickerBehaviourTest.java


示例5: testCSSInjection

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testCSSInjection() 
{
	DateTextField field = new DateTextField("field") {
		
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDateTimePickerBehaviour());
		}
	};
	
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> css = TagTester.createTagsByAttribute(head.getValue(), "type", "text/css", false);
	assertEquals(1, css.size());
	assertEquals("link", css.get(0).getName());
	assertTrue(css.get(0).getAttribute("href").matches("(.*)" + BootstrapDateTimePickerBehaviour.class.getName() + "/bootstrap-datetimepicker(.*)\\.css"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:25,代码来源:BootstrapDateTimePickerBehaviourTest.java


示例6: testJSInjection

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testJSInjection() 
{
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDateTimePickerBehaviour());
		}
	};

	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDateTimePickerBehaviour.class.getName() + "/moment-with-locales(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDateTimePickerBehaviour.class.getName() + "/bootstrap-datetimepicker(.*)\\.js"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:27,代码来源:BootstrapDateTimePickerBehaviourTest.java


示例7: getDateTextField

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
/**
 * Gets the DateTextField inside this datepicker wrapper.
 *
 * @return the date field
 */
public DateTextField getDateTextField(){
	DateTextField component = visitChildren(DateTextField.class, new IVisitor<DateTextField, DateTextField>() {
		@Override
		public void component(DateTextField arg0, IVisit<DateTextField> arg1) {
			arg1.stop(arg0);
		}
	});

	if (component == null)
		throw new WicketRuntimeException("BootstrapDatepicker didn't have any DateTextField child!");

	return component;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:19,代码来源:BootstrapDatepicker.java


示例8: testDatepickerLifecycle

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testDatepickerLifecycle() {
	TestBootstrapDatepicker picker = new TestBootstrapDatepicker("picker");

	startTest(picker);

	getTester().assertComponent(picker.getPageRelativePath(), TestBootstrapDatepicker.class);
	getTester().assertComponent(picker.getInnerField().getPageRelativePath(), DateTextField.class);
	assertEquals(picker.getInnerField(), picker.getDateTextField());
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:11,代码来源:BootstrapDatepickerTest.java


示例9: testJSInjection

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testJSInjection() {
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour());
		}};

	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	assertEquals(5, scripts.size());
	for (int i = 0; i < 5; i++) {
		assertEquals("script", scripts.get(i).getName());
	}
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker-extension(.*)\\.js"));
	assertTrue(scripts.get(2).getAttribute("src").matches("(.*)" + JQueryResourceReference.class.getName() + "(.*)/jquery(.*)\\.js"));
	assertTrue(scripts.get(3).getAttribute("src").matches("(.*)" + AbstractDefaultAjaxBehavior.class.getName() + "(.*)/wicket-event-jquery(.*)\\.js"));
	assertTrue(scripts.get(4).getValue().matches("(?s)(.*)Wicket.Event.add\\(window, \\\"domready\\\", function\\(event\\) \\{(.*)\\$\\(\"#" +
			field.getMarkupId() + "\"\\).datepicker\\(\\);(.*);\\}\\);(.*)"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:31,代码来源:BootstrapDatePickerBehaviourTest.java


示例10: testJSInjectionNonEnglishLocale

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testJSInjectionNonEnglishLocale() {
	getTester().getSession().setLocale(Locale.FRENCH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour());
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	assertEquals(6, scripts.size());
	for (int i = 0; i < 6; i++) {
		assertEquals("script", scripts.get(i).getName());
	}
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker-extension(.*)\\.js"));
	assertTrue(scripts.get(2).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/locales/bootstrap-datepicker.fr(.*)\\.js"));
	assertTrue(scripts.get(3).getAttribute("src").matches("(.*)" + JQueryResourceReference.class.getName() + "(.*)/jquery(.*)\\.js"));
	assertTrue(scripts.get(4).getAttribute("src").matches("(.*)" + AbstractDefaultAjaxBehavior.class.getName() + "(.*)/wicket-event-jquery(.*)\\.js"));
	assertTrue(scripts.get(5).getValue().matches("(?s)(.*)Wicket.Event.add\\(window, \\\"domready\\\", function\\(event\\) \\{(.*)\\$\\(\"#" +
			field.getMarkupId() + "\"\\).datepicker\\(\\);(.*);\\}\\);(.*)"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:31,代码来源:BootstrapDatePickerBehaviourTest.java


示例11: testJSInjectionOneSpecialDate

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testJSInjectionOneSpecialDate() {
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour() {
				private static final long serialVersionUID = 1L;

				@SuppressWarnings("deprecation")
				@Override
				public java.util.Collection<SpecialDate> getSpecialDates() {
					return Arrays.asList(new SpecialDate(new Date(110, 11, 25), "holiday", "Christmas"));
				};
			});
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	assertEquals(5, scripts.size());
	for (int i = 0; i < 5; i++) {
		assertEquals("script", scripts.get(i).getName());
	}
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker-extension(.*)\\.js"));
	assertTrue(scripts.get(2).getAttribute("src").matches("(.*)" + JQueryResourceReference.class.getName() + "(.*)/jquery(.*)\\.js"));
	assertTrue(scripts.get(3).getAttribute("src").matches("(.*)" + AbstractDefaultAjaxBehavior.class.getName() + "(.*)/wicket-event-jquery(.*)\\.js"));
	assertTrue(scripts.get(4).getValue().matches("(?s)(.*)Wicket.Event.add\\(window, \\\"domready\\\", function\\(event\\) \\{(.*)\\$\\(\"#" +
			field.getMarkupId() + "\"\\).datepicker\\(null, \\[" +
			"\\{dt:new Date\\('2010-12-25'\\), css:'holiday', tooltip:'Christmas'\\}" +
			"\\]\\);(.*);\\}\\);(.*)"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:40,代码来源:BootstrapDatePickerBehaviourTest.java


示例12: testBehaviorEmptySpecialDates

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testBehaviorEmptySpecialDates() {
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour() {
				private static final long serialVersionUID = 1L;

				@Override
				public java.util.Collection<SpecialDate> getSpecialDates() {
					return new ArrayList<SpecialDate>();
				};
			});
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	assertEquals(5, scripts.size());
	for (int i = 0; i < 5; i++) {
		assertEquals("script", scripts.get(i).getName());
	}
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker-extension(.*)\\.js"));
	assertTrue(scripts.get(2).getAttribute("src").matches("(.*)" + JQueryResourceReference.class.getName() + "(.*)/jquery(.*)\\.js"));
	assertTrue(scripts.get(3).getAttribute("src").matches("(.*)" + AbstractDefaultAjaxBehavior.class.getName() + "(.*)/wicket-event-jquery(.*)\\.js"));
	assertTrue(scripts.get(4).getValue().matches("(?s)(.*)Wicket.Event.add\\(window, \\\"domready\\\", function\\(event\\) \\{(.*)\\$\\(\"#" +
			field.getMarkupId() + "\"\\).datepicker\\(\\);(.*);\\}\\);(.*)"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:37,代码来源:BootstrapDatePickerBehaviourTest.java


示例13: TestBootstrapDatepicker

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
public TestBootstrapDatepicker(String id) {
	super(id);

	field = new DateTextField("input");
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:6,代码来源:BootstrapDatepickerTest.java


示例14: testBehaviorManySpecialDates

import org.apache.wicket.extensions.markup.html.form.DateTextField; //导入依赖的package包/类
@Test
public void testBehaviorManySpecialDates() {
	getTester().getSession().setLocale(Locale.ENGLISH);

	DateTextField field = new DateTextField("field") {
		private static final long serialVersionUID = 1L;

		{
			add(new BootstrapDatePickerBehaviour() {
				private static final long serialVersionUID = 1L;

				@SuppressWarnings("deprecation")
				@Override
				public java.util.Collection<SpecialDate> getSpecialDates() {
					return Arrays.asList(
							new SpecialDate(new Date(110, 11, 25), "holiday", "Christmas"),
							new SpecialDate(new Date(110, 0, 1), "holiday", "New Year"));
				};
			});
		}};
	startFormComponentTest(field, "text");

	String doc = getTester().getLastResponse().getDocument();

	TagTester head = TagTester.createTagByAttribute(doc, "head");
	assertNotNull(head);

	List<TagTester> scripts = TagTester.createTagsByAttribute(head.getValue(), "type", "text/javascript", false);
	assertEquals(5, scripts.size());
	for (int i = 0; i < 5; i++) {
		assertEquals("script", scripts.get(i).getName());
	}
	assertTrue(scripts.get(0).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker(.*)\\.js"));
	assertTrue(scripts.get(1).getAttribute("src").matches("(.*)" + BootstrapDatePickerBehaviour.class.getName() + "/bootstrap-datepicker-extension(.*)\\.js"));
	assertTrue(scripts.get(2).getAttribute("src").matches("(.*)" + JQueryResourceReference.class.getName() + "(.*)/jquery(.*)\\.js"));
	assertTrue(scripts.get(3).getAttribute("src").matches("(.*)" + AbstractDefaultAjaxBehavior.class.getName() + "(.*)/wicket-event-jquery(.*)\\.js"));
	assertTrue(scripts.get(4).getValue().matches("(?s)(.*)Wicket.Event.add\\(window, \\\"domready\\\", function\\(event\\) \\{(.*)\\$\\(\"#" +
			field.getMarkupId() + "\"\\).datepicker\\(null, \\[" +
			"\\{dt:new Date\\('2010-12-25'\\), css:'holiday', tooltip:'Christmas'\\}," +
			"\\{dt:new Date\\('2010-01-01'\\), css:'holiday', tooltip:'New Year'\\}" +
			"\\]\\);(.*);\\}\\);(.*)"));
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:43,代码来源:BootstrapDatePickerBehaviourTest.java



注:本文中的org.apache.wicket.extensions.markup.html.form.DateTextField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResultFactory类代码示例发布时间:2022-05-22
下一篇:
Java Selector类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap