当前位置: 首页>>代码示例>>Java>>正文


Java DateField.setResolution方法代码示例

本文整理汇总了Java中com.vaadin.ui.DateField.setResolution方法的典型用法代码示例。如果您正苦于以下问题:Java DateField.setResolution方法的具体用法?Java DateField.setResolution怎么用?Java DateField.setResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.DateField的用法示例。


在下文中一共展示了DateField.setResolution方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: genDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
public static <T> DateField genDateField(Binder<T> binder, String propertyId, final java.text.SimpleDateFormat dateFormat) {
    DateField dateField = new DateField();

    binder.bind(dateField, propertyId);
    if (dateFormat != null) {
        dateField.setDateFormat(dateFormat.toPattern());
    }
    dateField.setWidth("100%");

    dateField.setResolution(DateResolution.DAY);
    dateField.addStyleName(STYLENAME_GRIDCELLFILTER);
    dateField.addStyleName(ValoTheme.DATEFIELD_TINY);
    dateField.addValueChangeListener(e -> {
        if (binder.isValid()) {
            dateField.setComponentError(null);
        }
    });
    return dateField;
}
 
开发者ID:melistik,项目名称:vaadin-grid-util,代码行数:20,代码来源:FieldFactory.java

示例2: ReportParameterDateTimeRange

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
public ReportParameterDateTimeRange(String caption, String startParameterName, String endParameterName)
{
	super(caption, new String[] { startParameterName, endParameterName });
	Preconditions.checkNotNull(startParameterName);
	Preconditions.checkNotNull(endParameterName);
	this.startParameterName = startParameterName;
	this.endParameterName = endParameterName;
	startfield = new DateField(caption, new DateTime().withTimeAtStartOfDay().toDate());
	startfield.setResolution(Resolution.DAY);
	startfield.setDateFormat("yyyy/MM/dd");

	startfield.setValidationVisible(true);

	endfield = new DateField("To", new DateTime().withTimeAtStartOfDay().toDate());
	endfield.setResolution(Resolution.DAY);
	endfield.setDateFormat("yyyy/MM/dd");

	endfield.setValidationVisible(true);
	createValidators();

	endAdjustment = -1;

}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:24,代码来源:ReportParameterDateTimeRange.java

示例3: initForm

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
protected void initForm() {
  form = new Form();
  form.setValidationVisibleOnCommit(true);
  form.setImmediate(true);
  addComponent(form);
  
  // name
  nameField = new TextField(i18nManager.getMessage(Messages.TASK_NAME));
  nameField.focus();
  nameField.setRequired(true);
  nameField.setRequiredError(i18nManager.getMessage(Messages.TASK_NAME_REQUIRED));
  form.addField("name", nameField);
  
  // description
  descriptionArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION));
  descriptionArea.setColumns(25);
  form.addField("description", descriptionArea);
  
  // duedate
  dueDateField = new DateField(i18nManager.getMessage(Messages.TASK_DUEDATE));
  dueDateField.setResolution(DateField.RESOLUTION_DAY);
  form.addField("duedate", dueDateField);
  
  // priority
  priorityComboBox = new PriorityComboBox(i18nManager);
  form.addField("priority", priorityComboBox);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:28,代码来源:NewCasePopupWindow.java

示例4: initDueDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
protected void initDueDateField() {
  dueDateField = new DateField();
  if (task.getDueDate() != null) {
    dueDateField.setValue(task.getDueDate());
  } else {
    dueDateField.setValue(new Date());
  }
  dueDateField.setWidth(125, UNITS_PIXELS);
  dueDateField.setResolution(DateField.RESOLUTION_DAY);
  dueDateField.setImmediate(true);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:DueDateComponent.java

示例5: createDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
/**
 * Creates a date field.
 * @param pid property name.
 * @param propertyType property type.
 * @return a new field to select a date.
 */
public Field createDateField(String pid, Class<?> propertyType) {
	Field field = null;
	if(Date.class.isAssignableFrom(propertyType)) {
		DateField dateField = new DateField();
		dateField.setResolution(DateField.RESOLUTION_DAY);
		dateField.setDateFormat(Utils.getDateFormatPattern());
		field = dateField;
	}
       
       return field;
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:18,代码来源:DefaultCrudFieldFactory.java

示例6: bindDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
public DateField bindDateField(AbstractLayout form, ValidatingFieldGroup<E> group, String fieldLabel,
		String fieldName, String dateFormat, Resolution resolution)
{
	DateField field = new SplitDateField(fieldLabel);
	field.setDateFormat(dateFormat);
	field.setResolution(resolution);

	field.setImmediate(true);
	field.setWidth("100%");
	addValueChangeListeners(field);
	doBinding(group, fieldName, field);
	form.addComponent(field);
	return field;
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:15,代码来源:FormHelper.java

示例7: configureDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
@Override
protected void configureDateField(DateField field) {
	field.setResolution(Resolution.DAY);
	field.setConverter(new DateToLocalDateConverter());
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:LocalDateField.java

示例8: configureDateField

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
@Override
protected void configureDateField(DateField field) {
	field.setResolution(Resolution.MINUTE);
	field.setConverter(new DateToLocalDateTimeConverter());
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:LocalDateTimeField.java

示例9: createOptionGroup

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
private void createOptionGroup() {
    autoStartOptionGroup = new FlexibleOptionGroup();
    autoStartOptionGroup.addItem(AutoStartOption.MANUAL);
    autoStartOptionGroup.addItem(AutoStartOption.AUTO_START);
    autoStartOptionGroup.addItem(AutoStartOption.SCHEDULED);
    selectDefaultOption();

    final FlexibleOptionGroupItemComponent manualItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.MANUAL);
    manualItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    // set Id for Forced radio button.
    manualItem.setId(UIComponentIdProvider.ROLLOUT_START_MANUAL_ID);
    addComponent(manualItem);
    final Label manualLabel = new Label();
    manualLabel.setStyleName("statusIconPending");
    manualLabel.setIcon(FontAwesome.HAND_PAPER_O);
    manualLabel.setCaption(i18n.getMessage("caption.rollout.start.manual"));
    manualLabel.setDescription(i18n.getMessage("caption.rollout.start.manual.desc"));
    manualLabel.setStyleName("padding-right-style");
    addComponent(manualLabel);

    final FlexibleOptionGroupItemComponent autoStartItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.AUTO_START);
    autoStartItem.setId(UIComponentIdProvider.ROLLOUT_START_AUTO_ID);
    autoStartItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    addComponent(autoStartItem);
    final Label autoStartLabel = new Label();
    autoStartLabel.setSizeFull();
    autoStartLabel.setIcon(FontAwesome.PLAY);
    autoStartLabel.setCaption(i18n.getMessage("caption.rollout.start.auto"));
    autoStartLabel.setDescription(i18n.getMessage("caption.rollout.start.auto.desc"));
    autoStartLabel.setStyleName("padding-right-style");
    addComponent(autoStartLabel);

    final FlexibleOptionGroupItemComponent scheduledItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.SCHEDULED);
    scheduledItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    // setted Id for Time Forced radio button.
    scheduledItem.setId(UIComponentIdProvider.ROLLOUT_START_SCHEDULED_ID);
    addComponent(scheduledItem);
    final Label scheduledLabel = new Label();
    scheduledLabel.setStyleName("statusIconPending");
    scheduledLabel.setIcon(FontAwesome.CLOCK_O);
    scheduledLabel.setCaption(i18n.getMessage("caption.rollout.start.scheduled"));
    scheduledLabel.setDescription(i18n.getMessage("caption.rollout.start.scheduled.desc"));
    scheduledLabel.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    addComponent(scheduledLabel);

    startAtDateField = new DateField();
    startAtDateField.setInvalidAllowed(false);
    startAtDateField.setInvalidCommitted(false);
    startAtDateField.setEnabled(false);
    startAtDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    startAtDateField.setValue(
            Date.from(LocalDateTime.now().plusMinutes(30).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    startAtDateField.setImmediate(true);
    startAtDateField.setTimeZone(tz);
    startAtDateField.setLocale(HawkbitCommonUtil.getLocale());
    startAtDateField.setResolution(Resolution.MINUTE);
    startAtDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(startAtDateField);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:65,代码来源:AutoStartOptionGroupLayout.java

示例10: createOptionGroup

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
private void createOptionGroup() {
    actionTypeOptionGroup = new FlexibleOptionGroup();
    actionTypeOptionGroup.addItem(ActionTypeOption.SOFT);
    actionTypeOptionGroup.addItem(ActionTypeOption.FORCED);
    actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED);
    selectDefaultOption();

    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // set Id for Forced radio button.
    forceItem.setId("save.action.radio.forced");
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption("Forced");
    forceLabel.setDescription(i18n.getMessage("tooltip.forced.item"));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);

    final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup.getItemComponent(ActionTypeOption.SOFT);
    softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID);
    softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(softItem);
    final Label softLabel = new Label();
    softLabel.setSizeFull();
    softLabel.setCaption("Soft");
    softLabel.setDescription(i18n.getMessage("tooltip.soft.item"));
    softLabel.setStyleName("padding-right-style");
    addComponent(softLabel);

    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // setted Id for Time Forced radio button.
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption("Time Forced");
    autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item"));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:63,代码来源:ActionTypeOptionGroupLayout.java

示例11: initAboutSection

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
protected void initAboutSection() {
  // Header
  HorizontalLayout header = new HorizontalLayout();
  header.setWidth(100, UNITS_PERCENTAGE);
  header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
  infoPanelLayout.addComponent(header);
  
  Label aboutLabel = createProfileHeader(infoPanelLayout, i18nManager.getMessage(Messages.PROFILE_ABOUT));
  header.addComponent(aboutLabel);
  header.setExpandRatio(aboutLabel, 1.0f);
  
  // only show edit/save buttons if current user matches
  if (isCurrentLoggedInUser) {
    Button actionButton = null;
    if (!editable) {
      actionButton = initEditProfileButton();
    } else {
      actionButton = initSaveProfileButton();
    }
    header.addComponent(actionButton);
    header.setComponentAlignment(actionButton, Alignment.MIDDLE_RIGHT);
  }
  
  // 'About' fields
  GridLayout aboutLayout = createInfoSectionLayout(2, 4); 
  
  // Name
  if (!editable && (isDefined(user.getFirstName()) || isDefined(user.getLastName()) )) {
    addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_NAME), user.getFirstName() + " " + user.getLastName());
  } else if (editable) {
    firstNameField = new TextField();
    firstNameField.focus();
    addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_FIRST_NAME), firstNameField, user.getFirstName());
    lastNameField = new TextField();
    addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LAST_NAME), lastNameField, user.getLastName());
  }
  
  // Job title
  if (!editable && isDefined(jobTitle)) {
    addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_JOBTITLE), jobTitle);
  } else if (editable) {
    jobTitleField = new TextField();
    addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_JOBTITLE), jobTitleField, jobTitle);
  }
  
  // Birthdate
  if (!editable && isDefined(birthDate)) {
    addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_BIRTHDATE), birthDate);
  } else if (editable) {
    birthDateField = new DateField();
    birthDateField.setDateFormat(Constants.DEFAULT_DATE_FORMAT);
    birthDateField.setResolution(DateField.RESOLUTION_DAY);
    try {
      birthDateField.setValue(new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).parse(birthDate));
    } catch (Exception e) {} // do nothing
    addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_BIRTHDATE), birthDateField, null);
  }
  
  // Location
  if (!editable && isDefined(location)) {
    addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LOCATION), location);
  } else if (editable) {
    locationField = new TextField();
    addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LOCATION), locationField, location);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:67,代码来源:ProfilePanel.java

示例12: buildMainLayout

import com.vaadin.ui.DateField; //导入方法依赖的package包/类
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("520px");
	mainLayout.setHeight("280px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("520px");
	setHeight("280px");
	
	// alarmDateField
	alarmDateField = new DateField();
	alarmDateField.setCaption("Fecha alarma");
	alarmDateField.setImmediate(false);
	alarmDateField.setWidth("120px");
	alarmDateField.setHeight("-1px");
	alarmDateField.setInvalidAllowed(false);
	alarmDateField.setResolution(DateField.RESOLUTION_SEC);
	mainLayout.addComponent(alarmDateField, "top:17.0px;left:380.0px;");
	
	// areaField
	areaField = new TextField();
	areaField.setCaption("Area trabajo");
	areaField.setImmediate(false);
	areaField.setWidth("160px");
	areaField.setHeight("-1px");
	mainLayout.addComponent(areaField, "top:17.0px;left:200.0px;");
	
	// messageField
	messageField = new TextField();
	messageField.setCaption("Message");
	messageField.setImmediate(false);
	messageField.setWidth("480px");
	messageField.setHeight("164px");
	mainLayout.addComponent(messageField, "top:100.0px;left:20.0px;");
	
	// organizationField
	organizationField = new TextField();
	organizationField.setCaption("Organización");
	organizationField.setImmediate(false);
	organizationField.setWidth("160px");
	organizationField.setHeight("-1px");
	mainLayout.addComponent(organizationField, "top:17.0px;left:20.0px;");
	
	// alarmTypeField
	alarmTypeField = new ComboBox();
	alarmTypeField.setCaption("Tipo alarma");
	alarmTypeField.setImmediate(false);
	alarmTypeField.setWidth("180px");
	alarmTypeField.setHeight("-1px");
	mainLayout.addComponent(alarmTypeField, "top:60.0px;left:20.0px;");
	
	// alarmStatusField
	alarmStatusField = new ComboBox();
	alarmStatusField.setCaption("Estado alarma");
	alarmStatusField.setImmediate(false);
	alarmStatusField.setWidth("180px");
	alarmStatusField.setHeight("-1px");
	mainLayout.addComponent(alarmStatusField, "top:60.0px;left:220.0px;");
	
	return mainLayout;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:66,代码来源:AlarmViewForm.java


注:本文中的com.vaadin.ui.DateField.setResolution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。