本文整理汇总了Java中com.vaadin.ui.InlineDateField类的典型用法代码示例。如果您正苦于以下问题:Java InlineDateField类的具体用法?Java InlineDateField怎么用?Java InlineDateField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InlineDateField类属于com.vaadin.ui包,在下文中一共展示了InlineDateField类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DatePickerDialog
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public DatePickerDialog(boolean lightTheme) {
setPrimaryStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK);
addStyleName(Styles.Windows.NO_HEADER);
field = new InlineDateField();
field.setPrimaryStyleName(lightTheme ? Styles.DatePickers.LIGHT : Styles.DatePickers.DARK);
field.addStyleName(FlexItem.FlexGrow.GROW_1);
field.addStyleName(FlexLayout.Overflow.AUTO.getStyleName());
// Header
header = new DatePickerHeader(field, lightTheme);
// Footer
footer = new DatePickerFooter(field, lightTheme);
// Content wrapper
content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, header, field, footer);
setContent(content);
}
示例2: DatePickerFooter
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public DatePickerFooter(InlineDateField field, boolean lightTheme) {
setAlignItems(FlexLayout.AlignItems.CENTER);
setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
addStyleName(Paddings.All.SMALL);
addStyleName(Spacings.Right.SMALL);
addStyleName(FlexItem.FlexShrink.SHRINK_0);
cancel = new Button("Cancel");
cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
ok = new Button("OK");
ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
ok.setEnabled(field.getValue() != null);
this.field = field;
this.field.addValueChangeListener(event -> ok.setEnabled(this.field.getValue() != null));
addComponents(cancel, ok);
}
示例3: DatePickerHeader
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public DatePickerHeader(InlineDateField field, boolean lightTheme) {
setFlexDirection(FlexDirection.COLUMN);
setJustifyContent(JustifyContent.CENTER);
addStyleName(Paddings.Horizontal.LARGE);
addStyleName(FlexItem.FlexShrink.SHRINK_0);
this.field = field;
field.addValueChangeListener((HasValue.ValueChangeListener<LocalDate>) event -> {
year.setValue(field.getValue().format(DateTimeFormatter.ofPattern("yyyy")));
date.setValue(field.getValue().format(DateTimeFormatter.ofPattern("EEE, MMM d")));
});
setHeight(Metrics.DatePicker.HEADER_HEIGHT, Unit.PIXELS);
addStyleName(lightTheme ? MaterialColor.BLUE_500.getBackgroundColorStyle() : MaterialColor.GREY_700.getBackgroundColorStyle());
year.setPrimaryStyleName(Typography.Light.Body2.SECONDARY);
date.setPrimaryStyleName(Typography.Light.DatePicker.Title.PRIMARY);
addComponents(year, date);
}
示例4: PickersView
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public PickersView() {
setAlignItems(FlexLayout.AlignItems.FLEX_START);
setAlignSelf(AlignSelf.BASELINE);
setFlexWrap(FlexLayout.FlexWrap.WRAP);
setJustifyContent(JustifyContent.CENTER);
addStyleName(Spacings.All.LARGE);
InlineDateField idf1 = new InlineDateField();
idf1.setPrimaryStyleName(Styles.DatePickers.LIGHT);
FlexLayout c1 = new FlexLayout(FlexDirection.COLUMN, idf1);
c1.addStyleName("card");
InlineDateField idf2 = new InlineDateField();
idf2.setPrimaryStyleName(Styles.DatePickers.LIGHT);
FlexLayout c2 = new FlexLayout(FlexDirection.COLUMN, new DatePickerHeader(idf2, true), idf2, createFooter(idf2, true));
c2.addStyleName("card");
InlineDateField idf3 = new InlineDateField();
idf3.setPrimaryStyleName(Styles.DatePickers.DARK);
FlexLayout c3 = new FlexLayout(FlexDirection.COLUMN, idf3);
c3.addStyleName("card" + " " + MaterialColor.GREY_800.getBackgroundColorStyle());
InlineDateField idf4 = new InlineDateField();
idf4.setPrimaryStyleName(Styles.DatePickers.DARK);
FlexLayout c4 = new FlexLayout(FlexDirection.COLUMN, new DatePickerHeader(idf4, false), idf4, createFooter(idf4, false));
c4.addStyleName("card" + " " + MaterialColor.GREY_800.getBackgroundColorStyle());
addComponents(c1, c2, c3, c4);
}
示例5: createFooter
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public CssLayout createFooter(InlineDateField field, boolean lightTheme) {
DatePickerFooter footer = new DatePickerFooter(field, lightTheme);
if (!lightTheme) {
footer.getDismissiveActionButton().addStyleName(MaterialColor.BLUE_200.getFontColorStyle());
footer.getAffirmativeActionButton().addStyleName(MaterialColor.BLUE_200.getFontColorStyle());
}
return footer;
}
示例6: buildInternalField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
@Override
protected AbstractDateField<LocalDate, ?> buildInternalField(Class<? extends Date> type) {
AbstractLocalDateField field = isInline() ? new InlineDateField() : new com.vaadin.ui.DateField();
if (getResolution() == Resolution.MONTH) {
field.setResolution(DateResolution.MONTH);
}
if (getResolution() == Resolution.YEAR) {
field.setResolution(DateResolution.YEAR);
}
return field;
}
示例7: createInlineDateField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
/**
* Creates an inline date field.
* @param pid property name.
* @param propertyType property type.
* @return a new field to select a date.
*/
public Field createInlineDateField(String pid, Class<?> propertyType) {
Field field = null;
if(Date.class.isAssignableFrom(propertyType)) {
InlineDateField dateField = new InlineDateField();
dateField.setResolution(InlineDateField.RESOLUTION_DAY);
dateField.setDateFormat(Utils.getDateFormatPattern());
field = dateField;
}
return field;
}
示例8: buildInternalField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
@Override
protected DateField buildInternalField(Class<? extends T> type) {
DateField field = isInline() ? new InlineDateField() : new DateField();
configureDateField(field);
return field;
}
示例9: getField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public InlineDateField getField() {
return field;
}
示例10: setField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
public void setField(InlineDateField field) {
this.field = field;
}
示例11: buildInternalField
import com.vaadin.ui.InlineDateField; //导入依赖的package包/类
@Override
protected AbstractDateField<LocalDate, ?> buildInternalField(Class<? extends LocalDate> type) {
return isInline() ? new InlineDateField() : new DateField();
}