本文整理了Java中com.google.gwt.user.datepicker.client.DatePicker.setValue()
方法的一些代码示例,展示了DatePicker.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DatePicker.setValue()
方法的具体详情如下:
包路径:com.google.gwt.user.datepicker.client.DatePicker
类名称:DatePicker
方法名:setValue
[英]Sets the DatePicker's value.
[中]设置日期选择器的值。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the {@link DatePicker}'s value.
*
* @param newValue the new value
*/
public final void setValue(Date newValue) {
setValue(newValue, false);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) {
if (date != null) {
picker.setCurrentMonth(date);
}
picker.setValue(date, false);
if (updateText) {
format.reset(this, false);
box.setText(getFormat().format(this, date));
}
if (fireEvents) {
DateChangeEvent.fireIfNotEqualDates(this, oldDate, date);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onSelected(boolean selected) {
if (selected) {
getDatePicker().setValue(getValue(), true);
if (isFiller()) {
getDatePicker().setCurrentMonth(getValue());
}
}
updateStyle();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onEnterKeyDown(Context context, Element parent, Date value,
NativeEvent event, ValueUpdater<Date> valueUpdater) {
this.lastKey = context.getKey();
this.lastParent = parent;
this.lastValue = value;
this.lastIndex = context.getIndex();
this.lastColumn = context.getColumn();
this.valueUpdater = valueUpdater;
Date viewData = getViewData(lastKey);
Date date = (viewData == null) ? lastValue : viewData;
datePicker.setCurrentMonth(date);
datePicker.setValue(date);
panel.setPopupPositionAndShow(new PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
lastParent.getAbsoluteTop() + offsetY);
}
});
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Sets the {@link DatePicker}'s value.
*
* @param newValue the new value
*/
public final void setValue(Date newValue) {
setValue(newValue, false);
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Sets the {@link DatePicker}'s value.
*
* @param newValue the new value
*/
public final void setValue(Date newValue) {
setValue(newValue, false);
}
代码示例来源:origin: com.asayama.docs.gwt.angular.examples/GwtWidgets
private DatePicker createDatePicker() {
DatePicker datePicker = new DatePicker();
datePicker.setValue(new Date(), false);
datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
public void onValueChange(ValueChangeEvent<Date> event) {
Date date = event.getValue();
shout("You selected " + date);
}
});
return datePicker;
}
代码示例来源:origin: org.kie.guvnor/guvnor-commons-ui
public void onClick( ClickEvent event ) {
datePicker.setValue( getValue() );
panel.setPopupPositionAndShow( new PositionCallback() {
public void setPosition( int offsetWidth,
int offsetHeight ) {
panel.setPopupPosition( txtDate.getAbsoluteLeft(),
txtDate.getAbsoluteTop() + txtDate.getOffsetHeight() );
}
} );
}
代码示例来源:origin: org.kie.guvnor/guvnor-commons-ui
public void setValue( Date value,
boolean fireEvents ) {
this.date = value;
if ( value != null ) {
this.datePicker.setValue( value,
true );
this.txtDate.setText( format.format( value ) );
} else {
this.txtDate.setText( "" );
}
}
代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl
public void setDate(Date date) {
calendarWidget.setValue(date, false);
calendarWidget.setCurrentMonth(date);
if (resolution == Resolution.TIME) {
timeBox.setText(timeOnlyFormat.format(date));
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
public void setValue(Date date){
if(null==date){
dateField.setText("");
}else{
dateField.setText(df.format(date));
picker.setCurrentMonth(date);
picker.setValue(date, false);
selectedDate = date;
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) {
if (date != null) {
picker.setCurrentMonth(date);
}
picker.setValue(date, false);
if (updateText) {
format.reset(this, false);
box.setText(getFormat().format(this, date));
}
if (fireEvents) {
DateChangeEvent.fireIfNotEqualDates(this, oldDate, date);
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
public void onKeyUp(KeyUpEvent event) {
String dateText = dateField.getText();
if(!isDeleteOrBackspaceKey(event.getNativeKeyCode())){
if(dateText.length() == 2){
dateField.setText(dateText + "/");
String current = df.format(currentDate);
Date newDate = df.parse(dateField.getText()+ "01" + current.substring(5));
picker.setCurrentMonth(newDate);
}
else if(dateText.length() == 5){
dateField.setText(dateText + "/");
String current = df.format(currentDate);
Date newDate = df.parse(dateField.getText() + current.substring(6));
dateField.setText(df.format(newDate).substring(0, 6));
picker.setCurrentMonth(newDate);
picker.setValue(newDate, false);
}
else if(dateText.length() == 10){
Date newDate = df.parse(dateField.getText());
picker.setCurrentMonth(newDate);
picker.setValue(newDate, false);
selectedDate = picker.getValue();
}
}
}
代码示例来源:origin: net.wetheinter/gwt-user
private void setValue(Date oldDate, Date date, boolean fireEvents, boolean updateText) {
if (date != null) {
picker.setCurrentMonth(date);
}
picker.setValue(date, false);
if (updateText) {
format.reset(this, false);
box.setText(getFormat().format(this, date));
}
if (fireEvents) {
DateChangeEvent.fireIfNotEqualDates(this, oldDate, date);
}
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void onSelected(boolean selected) {
if (selected) {
getDatePicker().setValue(getValue(), true);
if (isFiller()) {
getDatePicker().setCurrentMonth(getValue());
}
}
updateStyle();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void onSelected(boolean selected) {
if (selected) {
getDatePicker().setValue(getValue(), true);
if (isFiller()) {
getDatePicker().setCurrentMonth(getValue());
}
}
updateStyle();
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
protected void onEnterKeyDown(Context context, Element parent, Date value,
NativeEvent event, ValueUpdater<Date> valueUpdater) {
this.lastKey = context.getKey();
this.lastParent = parent;
this.lastValue = value;
this.lastIndex = context.getIndex();
this.lastColumn = context.getColumn();
this.valueUpdater = valueUpdater;
Date viewData = getViewData(lastKey);
Date date = (viewData == null) ? lastValue : viewData;
datePicker.setCurrentMonth(date);
datePicker.setValue(date);
panel.setPopupPositionAndShow(new PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
lastParent.getAbsoluteTop() + offsetY);
}
});
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
protected void onEnterKeyDown(Context context, Element parent, Date value,
NativeEvent event, ValueUpdater<Date> valueUpdater) {
this.lastKey = context.getKey();
this.lastParent = parent;
this.lastValue = value;
this.lastIndex = context.getIndex();
this.lastColumn = context.getColumn();
this.valueUpdater = valueUpdater;
Date viewData = getViewData(lastKey);
Date date = (viewData == null) ? lastValue : viewData;
datePicker.setCurrentMonth(date);
datePicker.setValue(date);
panel.setPopupPositionAndShow(new PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
lastParent.getAbsoluteTop() + offsetY);
}
});
}
}
代码示例来源:origin: org.jboss.errai/errai-widgets
public boolean edit(WSGrid.WSCell element) {
wsCellReference = element;
editCellReference = this;
datePicker.setValue(date);
datePicker.setCurrentMonth(date);
Style s = datePicker.getElement().getStyle();
int left = (element.getAbsoluteLeft() + element.getOffsetWidth() - 20);
if ((left + datePicker.getOffsetWidth()) > Window.getClientHeight()) {
left = Window.getClientHeight() - datePicker.getOffsetHeight();
}
s.setProperty("left", left + "px");
s.setProperty("top", (element.getAbsoluteTop() + element.getOffsetHeight()) + "px");
datePicker.setVisible(true);
return true;
}
内容来源于网络,如有侵权,请联系作者删除!