Example #1
0
  /**
   * Defines the display mode of the calendar and perform a redraw.
   *
   * @param displayMode Style of the calendar (day, week or month).
   * @see CalendarWidget.DisplayMode
   */
  public void setDisplayMode(DisplayMode displayMode) {
    final FlexTable grid = (FlexTable) getWidget();

    clear();

    // Resetting the CSS style
    grid.removeStyleName(this.displayMode.getStyleName());

    this.displayMode = displayMode;

    // Applying the CSS style associated with the new display mode
    grid.addStyleName(displayMode.getStyleName());

    refresh();
  }
Example #2
0
  public CalendarWidget(
      int displayHeaders, boolean displayWeekNumber, Authentication authentication) {
    this.calendars = new ArrayList<Calendar>();
    this.displayHeaders = displayHeaders;
    this.displayWeekNumber = displayWeekNumber;
    this.authentication = authentication;

    // final SimplePanel container;

    final FlexTable grid = new FlexTable();
    grid.addStyleName("calendar");
    grid.addStyleName(displayMode.getStyleName());

    initWidget(grid);

    final Date now = new Date();
    today = new Date(now.getYear(), now.getMonth(), now.getDate());
    startDate = new Date(0, 0, 0);

    today();
  }