当前位置: 首页>>代码示例>>Java>>正文


Java DatePicker类代码示例

本文整理汇总了Java中com.google.gwt.user.datepicker.client.DatePicker的典型用法代码示例。如果您正苦于以下问题:Java DatePicker类的具体用法?Java DatePicker怎么用?Java DatePicker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatePicker类属于com.google.gwt.user.datepicker.client包,在下文中一共展示了DatePicker类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFieldWidget

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
@Override
	protected boolean createFieldWidget() {
		field = new DateBox(new DatePicker(), null, new DefaultFormat(DateTimeFormat.getFormat("dd.MM.yyyy")));
		field.getDatePicker().getElement().getStyle().setZIndex(40);
		// new DatePicker(), null, GWT.create(DefaultFormat.class)

//		field.addValueChangeHandler(getVCHandler());
		field.getTextBox().addValueChangeHandler(getVCHandler());

		Style fieldStyle = field.getElement().getStyle();
		fieldStyle.setWidth(100, Unit.PCT);
		fieldStyle.setHeight(26, Unit.PX);

		fieldStyle.setPaddingLeft(3, Unit.PX);
		fieldStyle.setColor("#575A5F !important");
		fieldStyle.setFontSize(11, Unit.PX);
		fieldStyle.setProperty("fontFamily", "Verdana, Arial, Helvetica, sans-serif");

		fieldStyle.setProperty("borderTop", "1px solid #CCC");
		fieldStyle.setProperty("borderRight", "1px solid #999");
		fieldStyle.setProperty("borderBottom", "1px solid #999");
		fieldStyle.setProperty("borderLeft", "1px solid #999");

		// fieldStyle.setProperty("border", "2px #C9D5E0 inset");
		fieldStyle.setProperty("boxSizing", "border-box");
		fieldStyle.setProperty("WebkitBoxSizing", "border-box");
		fieldStyle.setProperty("MozBoxSizing", "border-box");

		return true;
		// field.getFormat()

		// field.setStylePrimaryName("StringViewTextBox");
	}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:34,代码来源:DateView.java

示例2: create

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
@Override
public Widget create()
{
   DatePicker datePicker = new DatePicker();
   DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat(this.dmDateBox.format);
   DateBox dateBox = new DateBox(datePicker,
                                 new Date(this.dmDateBox.timestamp),
                                 new DateBox.DefaultFormat(dateTimeFormat));
   this.dmDateBox.dateBox = dateBox;
   this.dmDateBox.timestamp = 0;
   return dateBox;
}
 
开发者ID:davidebz,项目名称:DMWeb,代码行数:13,代码来源:DMDateBoxFactory.java

示例3: PurgeUpToDatePopup

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
public PurgeUpToDatePopup(FormSummary formSummary) {
  super();

  this.summary = formSummary;

  confirm = new AggregateButton(BUTTON_TXT, TOOLTIP_TXT, HELP_BALLOON_TXT);
  confirm.addClickHandler(new PurgeHandler());
  confirm.setEnabled(false);

  picker = new DatePicker();
  picker.addValueChangeHandler(new ValueChangeHandler<Date>() {

    @Override
    public void onValueChange(ValueChangeEvent<Date> event) {
      if ( selectedDate != null ) {
        picker.removeStyleFromDates("datePickerDayIsSelectedAndHighlighted", selectedDate);
      }
      selectedDate = event.getValue();
      if ( selectedDate != null ) {
        picker.addTransientStyleToDates("datePickerDayIsSelectedAndHighlighted", selectedDate);
      }
      confirm.setEnabled(selectedDate != null);
    }});

  FlexTable layout = new FlexTable();
  layout.setWidget(0, 0, new HTML("Purge submissions data for:<br>"
      + formSummary.getTitle() + " [" + formSummary.getId() + "]<br>up to the chosen GMT date.<br>Incomplete submissions will<br>not be deleted."));
  layout.setWidget(0, 1, picker);
  layout.setWidget(0, 2, confirm);
  layout.setWidget(0, 3, new ClosePopupButton(this));
  setWidget(layout);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:33,代码来源:PurgeUpToDatePopup.java

示例4: CustomDateBox

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
public CustomDateBox(DateTimePicker aPicker, Date date, Format format) {
	super(new DatePicker(), date, format);
	picker = aPicker;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:5,代码来源:CustomDateBox.java

示例5: onInitialize

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
/**
 * Initialize this example.
 */
@SuppressWarnings("deprecation")
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a basic date picker
  DatePicker datePicker = new DatePicker();
  final Label text = new Label();

  // Set the value in the text box when the user selects a date
  datePicker.addValueChangeHandler(new MyDateValueChangeHandler(text));

  // create a date picker where years and months are selectable with drop down lists and where we
  // can navigate trough the years
  DatePicker advancedDatePicker = new DatePicker();
  advancedDatePicker.setYearArrowsVisible(true);
  advancedDatePicker.setYearAndMonthDropdownVisible(true);
  // show 51 years in the years dropdown. The range of years is centered on the selected date
  advancedDatePicker.setVisibleYearCount(51);

  final Label text2 = new Label();
  text2.getElement().getStyle().setMarginTop(15, Unit.PX);

  // Set the value in the text box when the user selects a date
  advancedDatePicker.addValueChangeHandler(new MyDateValueChangeHandler(text2));

  // Set the default value
  datePicker.setValue(new Date(), true);
  advancedDatePicker.setValue(new Date(), true);

  // Create a DateBox
  DateTimeFormat dateFormat = DateTimeFormat.getLongDateFormat();
  DateBox dateBox = new DateBox();
  dateBox.setFormat(new DateBox.DefaultFormat(dateFormat));
  dateBox.getDatePicker().setYearArrowsVisible(true);

  // Combine the widgets into a panel and return them
  VerticalPanel vPanel = new VerticalPanel();
  vPanel.add(new HTML(constants.cwDatePickerLabel()));
  vPanel.add(text);
  vPanel.add(datePicker);
  vPanel.add(text2);
  vPanel.add(advancedDatePicker);
  vPanel.add(new HTML(constants.cwDatePickerBoxLabel()));
  vPanel.add(dateBox);
  return vPanel;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:50,代码来源:CwDatePicker.java

示例6: shouldBeAbleToInstantiateDatePicker

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
@Test
public void shouldBeAbleToInstantiateDatePicker() {
  assertNotNull(new DatePicker());
}
 
开发者ID:google,项目名称:gwtmockito,代码行数:5,代码来源:GwtMockitoTest.java

示例7: UTCDateBox

import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
/**
 * Creates a new UTCDateBox
 * 
 * @deprecated Use {@link UTCDateBox#UTCDateBox(DateTimeFormat)}
 *             instead. DatePicker and DateBox.Format are now
 *             ignored.
 */
@Deprecated
public UTCDateBox(DatePicker picker, long date, DateBox.Format format) {
    this();
    impl.setValue(date);
}
 
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:13,代码来源:UTCDateBox.java


注:本文中的com.google.gwt.user.datepicker.client.DatePicker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。