Class CalendarView

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, DataBoundComponent, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragCompleteHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropCompleteHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFetchDataHandlers, HasFocusChangedHandlers, HasFormulaUpdatedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasBodyKeyPressHandlers, HasCellClickHandlers, HasCellContextClickHandlers, HasCellDoubleClickHandlers, HasCellErrorIconHoverHandlers, HasCellErrorIconOutHandlers, HasCellErrorIconOverHandlers, HasCellHoverHandlers, HasCellMouseDownHandlers, HasCellMouseUpHandlers, HasCellOutHandlers, HasCellOverHandlers, HasCellSavedHandlers, HasCellSelectionChangedHandlers, HasCellValueHoverHandlers, HasCriteriaChangedHandlers, HasDataArrivedHandlers, HasDataChangedHandlers, HasDrawAreaChangedHandlers, HasEditCompleteHandlers, HasEditFailedHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFieldStateChangedHandlers, HasFilterEditorSubmitHandlers, HasGroupByCompleteHandlers, HasGroupByHandlers, HasGroupStateChangedHandlers, HasGroupTreeChangedHandlers, HasHeaderClickHandlers, HasHeaderDoubleClickHandlers, HasHeaderHoverHandlers, HasHilitesChangedHandlers, HasRecordClickHandlers, HasRecordCollapseHandlers, HasRecordDoubleClickHandlers, HasRecordDropHandlers, HasRecordExpandHandlers, HasRegroupHandlers, HasRemoveRecordClickHandlers, HasRowContextClickHandlers, HasRowEditorEnterHandlers, HasRowEditorExitHandlers, HasRowHoverHandlers, HasRowMouseDownHandlers, HasRowMouseUpHandlers, HasRowOutHandlers, HasRowOverHandlers, HasSelectionChangedHandlers, HasSelectionUpdatedHandlers, HasSetSortHandlers, HasSortChangedHandlers, HasSorterClickHandlers, HasSorterContextClickHandlers, HasViewStateChangedHandlers, HasMembersChangedHandlers

public class CalendarView extends ListGrid
CalendarView is a base class, extended by the various views available in a Calendar.
  • Constructor Details

    • CalendarView

      public CalendarView()
    • CalendarView

      public CalendarView(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static CalendarView getOrCreateRef(JavaScriptObject jsObj)
    • getTestInstance

      protected CalendarView getTestInstance()
      Overrides:
      getTestInstance in class ListGrid
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class ListGrid
    • getCalendar

      public Calendar getCalendar() throws IllegalStateException
      The calendar this view is in.

      Note : This method should be called only after the widget has been rendered.

      Returns:
      Current calendar value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • getEventDragCanvas

      public Canvas getEventDragCanvas() throws IllegalStateException
      Canvas displayed while dragging or resizing an event in this view and styled according to eventDragCanvasStyleName.

      This component is an AutoChild named "eventDragCanvas". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current eventDragCanvas value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setEventDragCanvasStyleName

      public CalendarView setEventDragCanvasStyleName(String eventDragCanvasStyleName) throws IllegalStateException
      CSS class applied to the eventDragCanvas.
      Parameters:
      eventDragCanvasStyleName - New eventDragCanvasStyleName value. Default value is "eventDragCanvas"
      Returns:
      CalendarView instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEventDragCanvasStyleName

      public String getEventDragCanvasStyleName()
      CSS class applied to the eventDragCanvas.
      Returns:
      Current eventDragCanvasStyleName value. Default value is "eventDragCanvas"
      See Also:
    • setEventStyleName

      public CalendarView setEventStyleName(String eventStyleName)
      If specified, overrides Calendar.eventStyleName and dictates the CSS style to use for events rendered in this view. Has no effect on events that already have a style specified.
      Parameters:
      eventStyleName - New eventStyleName value. Default value is null
      Returns:
      CalendarView instance, for chaining setter calls
      See Also:
    • getEventStyleName

      public String getEventStyleName()
      If specified, overrides Calendar.eventStyleName and dictates the CSS style to use for events rendered in this view. Has no effect on events that already have a style specified.
      Returns:
      Current eventStyleName value. Default value is null
      See Also:
    • getLongEventsLayout

      public Canvas getLongEventsLayout()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      A separate container that provides an intuitive way for users to view and interact with multi-day events, or events marked as lasting all day. If you've seen the calendars provided by Google, Apple or Microsoft, you'll already be familiar with the approach.

      In the day and week views, this component appears beneath the headers and does not scroll with the main body. In the month view, multiple instances of this component are created and shown beneath the headers for each week.

      Users may click in this component to create an all-day event on the clicked date, or drag to create an event that spans multiple days, and weeks in the month view. Either shows the new event for editing in the usual Calendar.eventEditor.

      When an event spans multiple days, or is marked as an all-day event, its associated eventCanvas is displayed in this component instead of in the main body of a given CalendarView. Each such event appears as a narrow horizontal bar spanning the full width of the columns its start and end dates involve. In the Month-view, if an event spans multiple weeks, the longEvents component in each week will show parts of this event.

      If a multi-day event spans beyond the current view's date-range at one or both ends, those ends are styled to indicate the event continues in that direction. Otherwise, if an event can be edited, users may drag -move or -resize it, or click it to show the eventEditor window.

      If multiple long-events occupy the same date-range, they are stacked vertically and this component will resize to accommodate them.

      This component is an com.smartgwt.client.types.AutoChild and as such may be customized via calendarView.longEventsLayoutProperties and calendarView.longEventsLayoutDefaults.

      Returns:
      null
      See Also:
    • setUseEventCanvasPool

      public CalendarView setUseEventCanvasPool(Boolean useEventCanvasPool)
      Should event canvas instances be reused when visible events change?
      Parameters:
      useEventCanvasPool - New useEventCanvasPool value. Default value is true
      Returns:
      CalendarView instance, for chaining setter calls
    • getUseEventCanvasPool

      public Boolean getUseEventCanvasPool()
      Should event canvas instances be reused when visible events change?
      Returns:
      Current useEventCanvasPool value. Default value is true
    • getViewName

      public String getViewName() throws IllegalStateException
      The name of this view, used to identify it in the calendar.

      Note : This method should be called only after the widget has been rendered.

      Returns:
      Current viewName value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • isDayView

      public boolean isDayView()
      Returns true if this is the day view, false otherwise.
      Returns:
      true if this is a Day view
    • isMonthView

      public boolean isMonthView()
      Returns true if this is the month view, false otherwise.
      Returns:
      true if this is a Month view
    • isSelectedView

      public Boolean isSelectedView()
      Returns true if this view is the currently selected view in the parent calendar.
      Returns:
      true if the view is selected in the parent calendar, false otherwise
    • isTimelineView

      public boolean isTimelineView()
      Returns true if this is the timeline view, false otherwise.
      Returns:
      true if this is a Timeline view
    • isWeekView

      public boolean isWeekView()
      Returns true if this is the week view, false otherwise.
      Returns:
      true if this is a Week view
    • rebuild

      public void rebuild()
      Rebuild this CalendarView, including re-fetching its data as necessary. To avoid re-fetching the data, pass 'false' to this method, or call refreshEvents() instead.
    • rebuild

      public void rebuild(Boolean refreshData)
      Rebuild this CalendarView, including re-fetching its data as necessary. To avoid re-fetching the data, pass 'false' to this method, or call refreshEvents() instead.
      Parameters:
      refreshData - If false, prevents data from bing refreshed.
    • refreshEvents

      public void refreshEvents()
      Clear, recalculate and redraw the events for the current range, without causing a fetch.
    • scrollToEnd

      public void scrollToEnd()
      Move the viewport of this CalendarView to the end of its scrollable range.
    • scrollToStart

      public void scrollToStart()
      Move the viewport of this CalendarView to the start of its scrollable range.
    • setDefaultProperties

      public static void setDefaultProperties(CalendarView calendarViewProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      calendarViewProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(CalendarViewLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class ListGrid