Package jfxtras.scene.control

Examples of jfxtras.scene.control.CalendarTimePicker


    // add to self
    getSkinnable().getStyleClass().add(this.getClass().getSimpleName()); // always add self as style class, because CSS should relate to the skin not the control
    getChildren().add(gridPane);
   
    // prep the picker
    calendarTimePicker = new CalendarTimePicker();
    // bind our properties to the picker's
    //Bindings.bindBidirectional(calendarTimePicker.calendarProperty(), getSkinnable().calendarProperty()); // order is important, because the value of the first field is overwritten initially with the value of the last field
    Bindings.bindBidirectional(calendarTimePicker.minuteStepProperty(), getSkinnable().minuteStepProperty()); // order is important, because the value of the first field is overwritten initially with the value of the last field
    Bindings.bindBidirectional(calendarTimePicker.secondStepProperty(), getSkinnable().secondStepProperty()); // order is important, because the value of the first field is overwritten initially with the value of the last field
  }
View Full Code Here


   * construct the nodes
   */
  private void createNodes()
  {
    // setup the grid so all weekday togglebuttons will grow, but the weeknumbers do not
    calendarTimePicker = new CalendarTimePicker();
    getChildren().add(calendarTimePicker);
   
    // setup CSS
        getSkinnable().getStyleClass().add(this.getClass().getSimpleName()); // always add self as style class, because CSS should relate to the skin not the control
  }
View Full Code Here

   * Implementation of Builder interface
   */
  @Override
  public CalendarTimePicker build()
  {
    CalendarTimePicker lCalendarTimePicker = new CalendarTimePicker();
    if (locale != null) {
      lCalendarTimePicker.setLocale(locale);
    }
    if (calendar != null) {
      lCalendarTimePicker.setCalendar(calendar);
    }
    if (minuteStep != null) {
      lCalendarTimePicker.setMinuteStep(minuteStep);
    }
    if (secondStep != null) {
      lCalendarTimePicker.setSecondStep(secondStep);
    }
    applyCommonProperties(lCalendarTimePicker);
    return lCalendarTimePicker;
  }
View Full Code Here

  {
    // show the correct tab
    click("#defaultControl");
   
    // get the node
    CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    Text lLabelText = (Text)find(".timeLabel");
   
    // default value is not null
    Assert.assertNotNull(lCalendarTimePicker.getCalendar());
    Assert.assertEquals(1, lCalendarTimePicker.getMinuteStep().intValue());
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setCalendar(new GregorianCalendar(2013, 0, 1, 20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("8:30 PM", lLabelText.getText());
  }
View Full Code Here

  {
    // show the correct tab
    click("#slideStep15");
   
    // get the node
    CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
   
    // assert
    Assert.assertEquals(15, lCalendarTimePicker.getMinuteStep().intValue());
    Assert.assertEquals(15, lCalendarTimePicker.getSecondStep().intValue());
  }
View Full Code Here

  {
    // show the correct tab
    click("#locale");
   
    // get the node
    CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    Text lLabelText = (Text)find(".timeLabel");
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setCalendar(new GregorianCalendar(2013, 0, 1, 20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("20:30", lLabelText.getText());
  }
View Full Code Here

    // set a value and a format
    final Calendar lCalendar = new GregorianCalendar(2013, 00, 01, 12, 34, 56);
    TestUtil.runThenWaitForPaintPulse( () -> {
      calendarPicker.setShowTime(true);
    });
    final CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setStyle("-fxx-label-dateformat:\"HH:mm:ss\";");
      calendarPicker.setCalendar( (Calendar)lCalendar.clone() );
    });
    Assert.assertEquals("2013-01-01T12:34:56.000", TestUtil.quickFormatCalendarAsDateTime(calendarPicker.getCalendar()));

    // change date, time should not change
View Full Code Here

    final private List<String> expected = FXCollections.observableArrayList("CalendarTimePicker");
    private volatile boolean pass = true;

    @Test
    public void TestAnonymousCalendarPicker() throws Exception {
        final CalendarTimePicker spinner = new CalendarTimePicker() {};
        Assert.assertEquals(expected, spinner.getStyleClass());
        FXTestUtils.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                root.getChildren().add(spinner);
            }
View Full Code Here

  {
    Locale.setDefault(Locale.ENGLISH);
   
    VBox box = new VBox();

    calendarTimePicker = new CalendarTimePicker();
    box.getChildren().add(calendarTimePicker);

    // make sure there is enough room for the time sliders
    box.setPrefSize(300, 300);
    return box;
View Full Code Here

TOP

Related Classes of jfxtras.scene.control.CalendarTimePicker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.