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:
    • 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