本文整理汇总了Java中com.google.gwt.user.datepicker.client.DateBox类的典型用法代码示例。如果您正苦于以下问题:Java DateBox类的具体用法?Java DateBox怎么用?Java DateBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DateBox类属于com.google.gwt.user.datepicker.client包,在下文中一共展示了DateBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
private void init(String value, int maxLength) {
if (maxLength > 0) {
addErrorValidator(new StringMaxLengthValidator(maxLength));
}
addWarningValidator(new StringDateLocalValidator());
try {
dateBox.setValue(onmsFormater.parseStrict(value));
} catch (IllegalArgumentException e) {
dateBox.getTextBox().setText(value);
}
inititalValue = value;
dateBox.setFormat(new DateBox.DefaultFormat(localFormater));
dateBox.getTextBox().addFocusHandler(this);
dateBox.getTextBox().addChangeHandler(this);
dateBox.getTextBox().addMouseUpHandler(this);
dateBox.getTextBox().addKeyUpHandler(this);
dateBox.addValueChangeHandler(this);
dateBox.setStyleName("dateBox");
dateBox.setSize("300px", "18px");
panel.add(dateBox);
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:26,代码来源:FieldSetDateBox.java
示例2: setDateBoxFormat
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
/**
* Sets the date format in multiple date-picker widgets
* @param fmt the date format as a {@link DefaultFormat} instance
* @param boxes the {@link DateBox} widgets
*/
public static void setDateBoxFormat(final DateBox.Format fmt,final DateBox... boxes) {
DateBox.Format theFmt = fmt == null ? new DateBox.DefaultFormat() : fmt;
if (boxes != null) {
for (DateBox box : boxes) {
box.setFormat(theFmt);
}
}
}
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:14,代码来源:GWTWidgets.java
示例3: setFormatPattern
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public void setFormatPattern(String aValue) {
formatPattern = aValue;
if (formatPattern != null)
formatPattern = WidgetsUtils.convertDateFormatString(formatPattern);
DateTimeFormat dtFormat = formatPattern != null ? DateTimeFormat.getFormat(formatPattern) : DateTimeFormat.getFormat("dd.MM.yyyy");
setFormat(new DateBox.DefaultFormat(dtFormat));
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:8,代码来源:PlatypusDateField.java
示例4: setFormat
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public void setFormat(String aValue) {
format = aValue;
if (format != null)
format = WidgetsUtils.convertDateFormatString(format);
DateTimeFormat dtFormat = format != null ? DateTimeFormat.getFormat(format) : DateTimeFormat.getFormat("dd.MM.yyyy");
((DateTimeBox) decorated).setFormat(new DateBox.DefaultFormat(dtFormat));
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:8,代码来源:ModelDate.java
示例5: UTCDateBoxImplHtml4
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public UTCDateBoxImplHtml4() {
handlerManager = new HandlerManager(this);
datebox = new DateBox();
datebox.addValueChangeHandler(new ValueChangeHandler<Date>() {
@Override
public void onValueChange(ValueChangeEvent<Date> event) {
// pass this event onto our handlers after converting
// the value
fireValueChangeEvent(UTCDateBox.date2utc(event.getValue()));
}
});
}
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:14,代码来源:UTCDateBoxImplHtml4.java
示例6: createFieldWidget
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的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
示例7: create
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
@Override
public Widget create(Session session, Column column) {
DateBox dateBox = new DateBox();
String pattern = (String) column.getEditor().getAttribute(DateEditor.FORMAT);
if (pattern != null) {
dateBox.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat(pattern)));
}
return dateBox;
}
开发者ID:salk31,项目名称:RedQueryBuilder,代码行数:11,代码来源:EditorWidgetFactory.java
示例8: parse
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
/** Adds support for some human readable dates ("1d ago", "10:30"). */
@Override
public Date parse(final DateBox box,
final String text,
final boolean report_error) {
if (text.endsWith(" ago")) { // "1d ago" and such
int interval;
final int lastchar = text.length() - 5;
try {
interval = Integer.parseInt(text.substring(0, lastchar));
} catch (NumberFormatException e) {
setError(box);
return null;
}
if (interval <= 0) {
setError(box);
return null;
}
switch (text.charAt(lastchar)) {
case 's': break; // seconds
case 'm': interval *= 60; break; // minutes
case 'h': interval *= 3600; break; // hours
case 'd': interval *= 3600 * 24; break; // days
case 'w': interval *= 3600 * 24 * 7; break; // weeks
case 'y': interval *= 3600 * 24 * 365; break; // years
}
final Date d = new Date();
d.setTime(d.getTime() - interval * 1000);
return d;
} else if (text.length() == 5) { // "HH:MM"
try {
return HHMM_FORMAT.parse(text);
} catch (IllegalArgumentException ignored) {
setError(box);
return null;
}
}
return super.parse(box, text, report_error);
}
开发者ID:tsuna,项目名称:droopy,代码行数:40,代码来源:DateTimeBox.java
示例9: DateLocalizationExample
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateLocalizationExample()
{
super( "Date Localization" );
DateLocalizationStrings strings = GWT.create( DateLocalizationStrings.class );
this.label = new Label();
this.label.setText( strings.defaultDaysMessage() );
this.add(new Label(strings.selectString()));
final DateLocalizationMessages messages = GWT.create( DateLocalizationMessages.class );
DateBox dateBox = new DateBox();
dateBox.setFormat( new DateBox.DefaultFormat( DateTimeFormat.getLongDateFormat()) );
Date date = new Date();
CalendarUtil.addMonthsToDate( date, -29 * 12 );
dateBox.setValue( date );
dateBox.addValueChangeHandler( new ValueChangeHandler<Date>() {
public void onValueChange( ValueChangeEvent<Date> e )
{
long days = CalendarUtil.getDaysBetween(e.getValue(), new Date() );
label.setText( messages.daysMessage( days ) );
}
});
this.add( dateBox );
this.add( label );
}
开发者ID:DavidWhitlock,项目名称:PortlandStateJava,代码行数:30,代码来源:DateLocalizationExample.java
示例10: create
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的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
示例11: getProgStartDate
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateBox getProgStartDate(){
return progStartDate;
}
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:4,代码来源:AdminView.java
示例12: getProgEndDate
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateBox getProgEndDate(){
return progEndDate;
}
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:4,代码来源:AdminView.java
示例13: getDataStartDate
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateBox getDataStartDate(){
return dataStartDate;
}
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:4,代码来源:AdminView.java
示例14: getDataEndDate
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateBox getDataEndDate(){
return dataEndDate;
}
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:4,代码来源:AdminView.java
示例15: init
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
/**
* UI Initialization
*/
protected void init() {
this.setSize("850px", "400px");
this.setGlassEnabled(true);
this.setModal(true);
desc.setText(desc.getText()+" Job Id - "+bdaJobId);
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
VerticalPanel topPanel = new VerticalPanel(); //Outermost vertical panel
topPanel.add(closeButton);
topPanel.setCellHeight(closeButton, "13px");
topPanel.setStyleName("vpanel");
desc.setStyleName("popupTitle");
topPanel.add(desc);
topPanel.setCellHeight(desc, "30px");
HorizontalPanel optPanel = new HorizontalPanel(); //Operation panel(include search, batch delete.etc)
optPanel.addStyleName("run-history-optPanel");
DateTimeFormat pickerFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
startTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
startTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
endTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
endTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
searchBtn.removeStyleName("gwt-Button");
searchBtn.addStyleName("run-history-search-button");
//The initial time is set to 2016-1-1
endTime = new Date();
DateTimeFormat tmpFormatter = DateTimeFormat.getFormat("yyyy-MM-dd");
startTime = tmpFormatter.parse("2016-01-01");
selectAllChkBox.setVisible(false);
batchDelBtn.removeStyleName("gwt-Button");
batchDelBtn.addStyleName("run-history-batch-del-button");
optPanel.add(startTimeLabel);
optPanel.add(startTimeBox);
optPanel.add(endTimeLabel);
optPanel.add(endTimeBox);
optPanel.add(searchBtn);
if(isExample && !AppController.power.equals("111")) //Example job only can be deleted by administrator privileges
{}
else
optPanel.add(batchDelBtn);
optPanel.add(selectAllChkBox);
runHistoryGrid.addStyleName("run-history-table"); //Data view
runHistoryGrid.addStyleName("table-striped");
runHistoryGrid.addStyleName("table-hover");
runHistoryGrid.resize(rowNum, colNum);
for(int i=0;i<colNum;i++)
{
runHistoryGrid.setText(0, i, columns[i]);
}
initGridData();
topPanel.add(optPanel);
topPanel.add(runHistoryGrid);
VerticalPanel bottomPanel = new VerticalPanel(); //Paging control
bottomPanel.add(pageGrid);
bottomPanel.addStyleName("run-history-bottomPanel");
VerticalPanel panel = new VerticalPanel();
panel.add(topPanel);
panel.add(bottomPanel);
this.add(panel);
this.setStyleName("loading_container");
}
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:73,代码来源:HistoryPopupPanel.java
示例16: getDateBox
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
public DateBox getDateBox() {
return impl.getDateBox();
}
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:4,代码来源:UTCDateBox.java
示例17: setDateFormat
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
@Override
public void setDateFormat(DateTimeFormat dateFormat) {
datebox.setFormat(new DateBox.DefaultFormat(dateFormat));
}
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:5,代码来源:UTCDateBoxImplHtml4.java
示例18: getDateBox
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
@Override
public DateBox getDateBox() {
return datebox;
}
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:5,代码来源:UTCDateBoxImplHtml4.java
示例19: getDateBox
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
@Override
public DateBox getDateBox() {
return null;
}
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:5,代码来源:UTCDateBoxImplHtml5.java
示例20: initDetailsTable
import com.google.gwt.user.datepicker.client.DateBox; //导入依赖的package包/类
@Override
protected void initDetailsTable() {
int row = 0;
Label label = new Label(Utils.constants.notificationSchema());
label.addStyleName(Utils.avroUiStyle.requiredField());
notificationSchemaInfo = new SchemaInfoListBox();
detailsTable.setWidget(row, 0, label);
detailsTable.setWidget(row, 1, notificationSchemaInfo);
notificationSchemaInfo.addValueChangeHandler(new ValueChangeHandler<SchemaInfoDto>() {
@Override
public void onValueChange(ValueChangeEvent<SchemaInfoDto> event) {
updateNotificationData(event.getValue());
}
});
row++;
label = new Label(Utils.constants.expiresAt());
expiredAt = new DateBox();
expiredAt.setWidth("200px");
detailsTable.setWidget(row, 0, label);
detailsTable.setWidget(row, 1, expiredAt);
row++;
label = new Label(Utils.constants.endpointKeyHash());
endpointKeyHashTextBox = new TextBox();
endpointKeyHashTextBox.setWidth("200px");
detailsTable.setWidget(row, 0, label);
detailsTable.setWidget(row, 1, endpointKeyHashTextBox);
getFooter().addStyleName(Utils.kaaAdminStyle.bAppContentDetailsTable());
notificationData = new RecordPanel(new AvroWidgetsConfig.Builder()
.recordPanelWidth(900).gridHeight(250).tableHeight(230).createConfig(),
Utils.constants.notificationBody(), this, false, false);
notificationData.addValueChangeHandler(this);
getFooter().setWidth("1000px");
getFooter().add(notificationData);
}
开发者ID:kaaproject,项目名称:kaa,代码行数:42,代码来源:SendNotificationViewImpl.java
注:本文中的com.google.gwt.user.datepicker.client.DateBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论