Examples of YearPeriod


Examples of com.peusoft.widget.calendar.YearPeriod

     */
    public void testDateSelected() {
        System.out.println("dateSelected");

        AbstractDatePicker date_picker = getDatePicker();
        YearPeriod yp = new YearPeriod(2000, 2010);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("PropertyVetoException is expected!", ex);
            fail("PropertyVetoException is expected!");
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

    public void testSetYear() {
        System.out.println("setYear");

        AbstractDatePicker date_picker = getDatePicker();
        DefaultCalendarNavigatorModel model = new DefaultCalendarNavigatorModel(
                new YearPeriod(2004, 2009));
        model.setSelectedYear(2005);
        date_picker.setModel(model);

        date_picker.setYear(2009);
        int res = model.getSelectedYear();
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

            fail("IllegalArgumentException is expected!");
        } catch (IllegalArgumentException ex) {
            // ok
        }

        YearPeriod yp = new YearPeriod(2003, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

    public void testYearPeriod() {
        System.out.println("yearPeriod");

        AbstractDatePicker date_picker = getDatePicker();

        YearPeriod yp = new YearPeriod(2004, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
        }
        assertEquals("Wrong year period:", yp, date_picker.getYearPeriod());

        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.set(java.util.Calendar.YEAR, 2005);
        try {
            date_picker.setDate(cal);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
        }

        yp = new YearPeriod(2007, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

   * Test of property yearPeriod of class com.peu.widget.calendar.model.DefaultCalendarNavigatorModel.
   */
  public void testSetYearPeriod() {
    System.out.println("yearPeriod");
   
    YearPeriod yearPeriod = new YearPeriod(2000, 2007);
    DefaultCalendarNavigatorModel model =
      new DefaultCalendarNavigatorModel(yearPeriod);
    assertEquals("Wrong period", yearPeriod, model.getYearPeriod());
   
    Calendar date = Calendar.getInstance();
    date.set(Calendar.YEAR, 2003);
    try {
      model.setSelectedDate(date);
    } catch (IllegalArgumentException e) {
      LOGGER.error("IllegalArgumentException", e);
      fail("IllegalArgumentException!");
    }
    yearPeriod = new YearPeriod(2004, 2005);
    model.setYearPeriod(yearPeriod);
    int y = model.getSelectedDate().get(Calendar.YEAR);
    assertEquals("Wrong year", yearPeriod.getBegin(), y);
    assertEquals("Wrong year", yearPeriod.getBegin(), model.getSelectedYear());
  }
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

    public void testSetYear() {
        System.out.println("setYear");

        AbstractDatePickerTableCellEditor date_picker = getDatePickerTableCellEditor();
        DefaultCalendarNavigatorModel model = new DefaultCalendarNavigatorModel(
                new YearPeriod(2004, 2009));
        model.setSelectedYear(2005);
        date_picker.setModel(model);

        date_picker.setYear(2009);
        int res = model.getSelectedYear();
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

            fail("IllegalArgumentException is expected!");
        } catch (IllegalArgumentException ex) {
            // ok
        }

        YearPeriod yp = new YearPeriod(2003, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

    public void testYearPeriod() {
        System.out.println("yearPeriod");

        AbstractDatePickerTableCellEditor date_picker = getDatePickerTableCellEditor();

        YearPeriod yp = new YearPeriod(2004, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
        }
        assertEquals("Wrong year period:", yp, date_picker.getYearPeriod());

        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.set(java.util.Calendar.YEAR, 2005);
        try {
            date_picker.setDate(cal);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
        }

        yp = new YearPeriod(2007, 2009);
        try {
            date_picker.setYearPeriod(yp);
        } catch (PropertyVetoException ex) {
            LOGGER.error("yearPeriod", ex);
            fail(ex.getLocalizedMessage());
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

     */
        @Override
    protected void verify(String value) throws ParseException {
      java.util.Calendar cal = Converter.convert2Calendar(value);
      int year = cal.get(java.util.Calendar.YEAR);
      YearPeriod yp = getYearPeriod();
      if (year < yp.getBegin() || year > yp.getEnd()) {
        String msg = ERROR_FACTORY.getErrorMessage(CalendarErrorCode.YEAR_OUTSIDE_OF_PERIOD);
        LOGGER.error(msg);
        throw new ParseException(msg, 0);
      }
    }
View Full Code Here

Examples of com.peusoft.widget.calendar.YearPeriod

   
    initComponents();
    try {
     
      calNavigatorSpinner.setYearPeriod(
        new YearPeriod(2000, 2050));
    } catch (PropertyVetoException ex) {
      ex.printStackTrace();
    }
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.