Package rabbit.ui.internal

Examples of rabbit.ui.internal.CalendarAction


  @Test
  public void testDateTimeWidget() {
    Format format = new SimpleDateFormat(CalendarAction.DATE_FORMAT);
    Calendar date = new GregorianCalendar(2100, Calendar.JANUARY, 1);
    CalendarAction action = CalendarAction.create(manager, shell, date, null,
        null);

    SWTBotDateTime bot = new SWTBotDateTime(action.getDateTime());
    assertEquals(format.format(date.getTime()), format.format(bot.getDate()));

    date = new GregorianCalendar(2012, Calendar.DECEMBER, 21);
    bot.setDate(date.getTime());
    assertEquals(format.format(date.getTime()), action.getText());

    Calendar cal = action.getCalendar();
    assertEquals(format.format(date.getTime()), format.format(cal.getTime()));
  }
View Full Code Here


  @Test
  public void testTodayLink() {
    Calendar today = Calendar.getInstance();
    Calendar notToday = (Calendar) today.clone();
    notToday.add(Calendar.MONTH, 1);
    final CalendarAction action = CalendarAction.create(manager, shell,
        notToday, null, null);

    shell.getDisplay().syncExec(new Runnable() {
      @Override
      public void run() {
        action.getShell().open();
      }
    });

    SWTBotShell bot = new SWTBotShell(action.getShell());
    bot.bot().link().click();

    Format format = new SimpleDateFormat(CalendarAction.DATE_FORMAT);
    assertEquals(format.format(today.getTime()), action.getText());

    Calendar cal = action.getCalendar();
    assertEquals(format.format(today.getTime()), format.format(cal.getTime()));
  }
View Full Code Here

TOP

Related Classes of rabbit.ui.internal.CalendarAction

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.