本文整理汇总了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");
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例6: shouldBeAbleToInstantiateDatePicker
import com.google.gwt.user.datepicker.client.DatePicker; //导入依赖的package包/类
@Test
public void shouldBeAbleToInstantiateDatePicker() {
assertNotNull(new DatePicker());
}
示例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);
}