@Editor.Ignore @UiField DateBox dateField; LeafValueEditor<Long> longField = new LeafValueEditor<Long>() { @Override public Long getValue() { Date date = dateField.getValue(); return date == null ? null : date.getTime(); } @Override public void setValue(Long value) { Date date = value == null ? null : new Date(value.longValue()); dateField.setValue(date); } }
/** * Sets the format used to control formatting and parsing of dates in this * {@link DateBox}. If this {@link DateBox} is not empty, the contents of date * box will be replaced with current contents in the new format. * * @param format the new date format */ public void setFormat(Format format) { assert format != null : "A Date box may not have a null format"; if (this.format != format) { Date date = getValue(); // This call lets the formatter do whatever other clean up is required to // switch formatters. // this.format.reset(this, true); // Now update the format and show the current date using the new format. this.format = format; setValue(date); } }
protected Date getValue(DateBox datebox) { return datebox.getValue(); }
final DateBox dateBox = new DateBox(); dateBox.getTextBox().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { if (dateBox.getValue() == null) { System.out.println("date value is empty"); // your code here } } });
ListBox assembler = (ListBox) currentInfoTable.getWidget(2, 1); DateBox date = (DateBox) currentInfoTable.getWidget(3, 1); while (currentAssemblyLineRow < (rowSpan + currentRow)) { AssemblyLine al = new AssemblyLine(); al.setAssemblerName(assembler.getValue(assembler.getSelectedIndex())); al.setDate(date.getValue()); al.setAssemblyID(Integer.parseInt(fTable.getHTML(currentRow, 0))); // rest of loop body goes here (current code) }
/** * Sets the format used to control formatting and parsing of dates in this * {@link DateBox}. If this {@link DateBox} is not empty, the contents of date * box will be replaced with current contents in the new format. * * @param format the new date format */ public void setFormat(Format format) { assert format != null : "A Date box may not have a null format"; if (this.format != format) { Date date = getValue(); // This call lets the formatter do whatever other clean up is required to // switch formatters. // this.format.reset(this, true); // Now update the format and show the current date using the new format. this.format = format; setValue(date); } }
/** * Sets the format used to control formatting and parsing of dates in this * {@link DateBox}. If this {@link DateBox} is not empty, the contents of date * box will be replaced with current contents in the new format. * * @param format the new date format */ public void setFormat(Format format) { assert format != null : "A Date box may not have a null format"; if (this.format != format) { Date date = getValue(); // This call lets the formatter do whatever other clean up is required to // switch formatters. // this.format.reset(this, true); // Now update the format and show the current date using the new format. this.format = format; setValue(date); } }
Date rDate = ((DateBox) rValueWidget).getValue();
hide(); if (opener!=null) opener.dialogBoxValidated(myDateBox.getValue());