org.uberfire.ext.widgets.common.client.common.DatePicker.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.uberfire.ext.widgets.common.client.common.DatePicker.getValue()方法的一些代码示例,展示了DatePicker.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DatePicker.getValue()方法的具体详情如下:
包路径:org.uberfire.ext.widgets.common.client.common.DatePicker
类名称:DatePicker
方法名:getValue

DatePicker.getValue介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

class Controller {

  public static Calendar cal = Calendar.getInstance();

  public static long getEpoch_fromDatePicker( DatePicker datePicker ) {

    Controller.cal.set(Calendar.DAY_OF_MONTH, datePicker.getValue().getDayOfMonth() );
    Controller.cal.set(Calendar.MONTH, datePicker.getValue().getMonthValue() );
    Controller.cal.set(Calendar.YEAR, datePicker.getValue().getYear() );

    return Controller.cal.getTimeInMillis() /1000;
  }
}

代码示例来源:origin: stackoverflow.com

public class DatePickerController
{
  @FXML
  private Text actiontarget;

  @FXML
  private DatePicker datepicker;

  @FXML
  protected void handleDatePickerAction(ActionEvent event)
  {
  actiontarget.setText(datepicker.getValue().toString());
  }
}

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

public DSLVariableValue getSelectedValue() {
  final Date date = datePicker.getValue();
  final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
  return new DSLVariableValue(sDate);
}

代码示例来源:origin: stackoverflow.com

final DatePicker datePicker = new DatePicker();
datePicker.setOnAction(new EventHandler() {
  public void handle(Event t) {
    LocalDate date = datePicker.getValue();
    System.err.println("Selected date: " + date);
  }
});

代码示例来源:origin: kiegroup/drools-wb

public DSLVariableValue getSelectedValue() {
  final Date date = datePicker.getValue();
  final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
  return new DSLVariableValue(sDate);
}

代码示例来源:origin: kiegroup/drools-wb

@Override
  public void onValueChange(ValueChangeEvent<Date> event) {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    value.setValue(sDate);
  }
});

代码示例来源:origin: org.jbpm/jbpm-console-ng-generic-client

/**
 * Returns the date value specified by the DateBox measured in number of
 * milliseconds since January 1, 1970, 00:00:00 GMT. This time will always
 * correspond to midnight in GMT on the date selected.
 *
 * @return The time selected or null if no value is specified by the
 *         DateBox.
 */
@Override
public Long getValue() {
  return UTCDateBox.date2utc(datePicker.getValue());
}

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

@Override
  public void onValueChange(ValueChangeEvent<Date> event) {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    value.setValue(sDate);
  }
});

代码示例来源:origin: kiegroup/drools-wb

@Override
  public void onValueChange(final ValueChangeEvent<Date> event) {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    boolean update = constraint.getValue() == null || !constraint.getValue().equals(sDate);
    constraint.setValue(sDate);
    if (update) {
      executeOnValueChangeCommand();
    }
  }
});

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

@Override
  public void onValueChange(final ValueChangeEvent<Date> event) {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    boolean update = constraint.getValue() == null || !constraint.getValue().equals(sDate);
    constraint.setValue(sDate);
    if (update) {
      executeOnValueChangeCommand();
    }
  }
});

代码示例来源:origin: org.drools/drools-wb-guided-dtree-editor-client

@Override
  public void onValueChange(final ValueChangeEvent<Date> event) {
    hasValue.getValue().setValue(valueEditor.getValue());
  }
});

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

protected void initDatePickerByRuleAttribute(final DatePicker datePicker, final RuleAttribute ruleAttribute) {
  datePicker.addValueChangeHandler(event -> {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    ruleAttribute.setValue(sDate);
  });
  datePicker.setFormat(DATE_FORMAT);
  datePicker.setValue(assertDateValue(ruleAttribute));
}

代码示例来源:origin: kiegroup/drools-wb

protected void initDatePickerByRuleAttribute(final DatePicker datePicker, final RuleAttribute ruleAttribute) {
  datePicker.addValueChangeHandler(event -> {
    final Date date = datePicker.getValue();
    final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
    ruleAttribute.setValue(sDate);
  });
  datePicker.setFormat(DATE_FORMAT);
  datePicker.setValue(assertDateValue(ruleAttribute));
}

代码示例来源:origin: kiegroup/drools-wb

@Override
protected Date getValue() {
  if (getWidget() != null) {
    return convertToServerTimeZone(getWidget().getValue());
  }
  return null;
}

代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client

@Override
protected Date getValue() {
  if (getWidget() != null) {
    return convertToServerTimeZone(getWidget().getValue());
  }
  return null;
}

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

@Test
public void testDatePickerValueChangeHandler() {
  final DatePicker datePicker = mock(DatePicker.class);
  final Date datePickerValue = new Date();
  doReturn(datePickerValue).when(datePicker).getValue();
  factory.initDatePickerByRuleAttribute(datePicker, ruleAttribute);
  verify(datePicker).addValueChangeHandler(valueChangeHandlerArgumentCaptor.capture());
  valueChangeHandlerArgumentCaptor.getValue().onValueChange(null);
  // not robust verifications because of Date formatting / parsing is mocked by GwtMockito
  verify(ruleAttribute).setValue(anyString());
}

代码示例来源:origin: org.drools/drools-wb-guided-rule-editor-client

@Test
  public void testDatePickerValueChangeHandlerNullValue() {
    final DatePicker datePicker = mock(DatePicker.class);
    final Date datePickerValue = null;
    doReturn(datePickerValue).when(datePicker).getValue();

    factory.initDatePickerByRuleAttribute(datePicker, ruleAttribute);
    verify(datePicker).addValueChangeHandler(valueChangeHandlerArgumentCaptor.capture());

    valueChangeHandlerArgumentCaptor.getValue().onValueChange(null);
    verify(ruleAttribute).setValue(eq(null));
  }
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-decorated-grid-widget

@Test
public void testCommit() {
  final Date clientDate = makeDate("04-01-2018 00:00:00 -0300");
  final Date serverDate = makeDate("04-01-2018 06:00:00 +0300");
  when(datePicker.getValue()).thenReturn(clientDate);
  doReturn(serverDate).when(cell).convertToServerTimeZone(clientDate);
  cell.commit();
  verify(cell).setValue(any(Cell.Context.class), any(Element.class), eq(serverDate));
  verify(valueUpdater).update(eq(serverDate));
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-decorated-grid-widget

@Test
public void testCommitWhenValueUpdaterIsNull() {
  final Date clientDate = makeDate("04-01-2018 00:00:00 -0300");
  final Date serverDate = makeDate("04-01-2018 06:00:00 +0300");
  when(datePicker.getValue()).thenReturn(clientDate);
  doReturn(null).when(cell).getValueUpdater();
  doReturn(serverDate).when(cell).convertToServerTimeZone(clientDate);
  cell.commit();
  verify(cell).setValue(any(Cell.Context.class), any(Element.class), eq(serverDate));
  verify(valueUpdater, never()).update(any(Date.class));
}

代码示例来源:origin: kiegroup/drools-wb

@Test
public void testGetValue() {
  final DatePickerSingletonDOMElementFactory factory = spy(makeFactory());
  final Date date = mock(Date.class);
  final Date convertedDate = mock(Date.class);
  doReturn(datePicker).when(factory).getWidget();
  when(datePicker.getValue()).thenReturn(date);
  mockStatic(TimeZoneUtils.class);
  PowerMockito.when(TimeZoneUtils.convertToServerTimeZone(date)).thenReturn(convertedDate);
  final Date actualDate = factory.getValue();
  assertEquals(convertedDate, actualDate);
}

相关文章