Class ReviserDisplayable<T,U extends VDisplayable<U>>

java.lang.Object
jfxtras.scene.control.agenda.icalendar.editors.revisors.ReviserDisplayable<T,U>
Type Parameters:
T - concrete implementation of this class
U - concrete VDisplayable class
All Implemented Interfaces:
Reviser
Direct Known Subclasses:
ReviserLocatable, ReviserVJournal

public abstract class ReviserDisplayable<T,U extends VDisplayable<U>> extends Object implements Reviser
Handles revising one or all recurrences of a VDisplayable
  • Field Details

  • Constructor Details

    • ReviserDisplayable

      public ReviserDisplayable(U vComponent)
  • Method Details

    • getVComponentCopyEdited

      public U getVComponentCopyEdited()
      Gets the value of the edited VDisplayable copy. Note: don't pass original or the changes will be instantaneous and cancel is not possible.
    • setVComponentCopyEdited

      public void setVComponentCopyEdited(U vComponentEdited)
      Sets the value of the edited VDisplayable copy. Note: don't pass original or the changes will be instantenous and cancel is not possible.
    • withVComponentCopyEdited

      public T withVComponentCopyEdited(U vComponentEdited)
      Sets the value of the edited VDisplayable
      Returns:
      - this class for chaining
      See Also:
    • getVComponentOriginal

      public U getVComponentOriginal()
      Gets the value of the original VDisplayable
    • setVComponentOriginal

      public void setVComponentOriginal(U vComponentOriginal)
      Sets the value of the original VDisplayable
    • withVComponentOriginal

      public T withVComponentOriginal(U vComponentOriginal)
      Sets the value of the edited VDisplayable
      Returns:
      - this class for chaining
      See Also:
    • getStartOriginalRecurrence

      public Temporal getStartOriginalRecurrence()
      Gets the value of the start of the selected recurrence, before changes
    • setStartOriginalRecurrence

      public void setStartOriginalRecurrence(Temporal startOriginalRecurrence)
      Sets the value of the start of the selected recurrence, before changes
    • withStartOriginalRecurrence

      public T withStartOriginalRecurrence(Temporal startOriginalRecurrence)
      Sets the value of the start of the selected recurrence, before changes
      Returns:
      - this class for chaining
    • getStartRecurrence

      public Temporal getStartRecurrence()
      Gets the value of the start of the selected recurrence, after changes
    • setStartRecurrence

      public void setStartRecurrence(Temporal startRecurrence)
      Sets the value of the start of the selected recurrence, after changes
    • withStartRecurrence

      public T withStartRecurrence(Temporal startRecurrence)
      Sets the value of the start of the selected recurrence, after changes
      Returns:
      - this class for chaining
    • getDialogCallback

      public javafx.util.Callback<Map<ChangeDialogOption,javafx.util.Pair<Temporal,Temporal>>,ChangeDialogOption> getDialogCallback()
      Gets the value of the dialog callback to prompt the user to select revision option
    • setDialogCallback

      public void setDialogCallback(javafx.util.Callback<Map<ChangeDialogOption,javafx.util.Pair<Temporal,Temporal>>,ChangeDialogOption> dialogCallback)
      Sets the value of the dialog callback to prompt the user to select revision option
    • withDialogCallback

      public T withDialogCallback(javafx.util.Callback<Map<ChangeDialogOption,javafx.util.Pair<Temporal,Temporal>>,ChangeDialogOption> dialogCallback)
      Sets the value of the dialog callback to prompt the user to select revision option
      Returns:
      - this class for chaining
    • isValid

      boolean isValid()
      Tests the object state is valid and revision can proceed. Returns true if valid, false otherwise
    • revise

      public List<VCalendar> revise()
      Description copied from interface: Reviser
      Revise list of iTIP VCalendar components that represent the changes.
      Specified by:
      revise in interface Reviser
    • adjustRecurrenceChildren

      private List<VDisplayable<?>> adjustRecurrenceChildren(Temporal startRecurrence, Temporal startOriginalRecurrence)
    • validateStartRecurrenceAndDTStart

      void validateStartRecurrenceAndDTStart(U vComponentEditedCopy, Temporal startRecurrence)
      If startRecurrence isn't valid due to a RRULE change, change startRecurrence and endRecurrence to closest valid values
    • becomeNonRecurring

      void becomeNonRecurring(U vComponentEditedCopy)
      Make changes necessary for making a repeating component into a non-repeating component
    • adjustDateTime

      void adjustDateTime(U vComponentEditedCopy)
      Adjust start date/time according to changes in selected recurrence
    • findChangedProperties

      Collection<VPropertyElement> findChangedProperties(U vComponentEditedCopy, U vComponentOriginalCopy)
      Generates a list of VPropertyElement that have changed between the original and edited VComponents.
      Parameters:
      vComponentEditedCopy - edited VComponent
      vComponentOriginalCopy - original VComponent
      Returns:
      list of changed VPropertyElement
    • dialogRequiredProperties

      public List<VPropertyElement> dialogRequiredProperties()
      Returned list of VPropertyElement values, that when changed, necessitate a user dialog to determine scope of change. If changes do not contain ANY VPropertyElement in the returned list then changes can proceed automatically without a user dialog.
      Returns:
      List<VPropertyElement> that when any are changed require a user dialog to request scope of change (e.g. ONE, ALL or THIS_AND_FUTURE)
    • editOne

      void editOne(U vComponentEditedCopy)
      ONE Edit one instance of a VEvent with a RRule. The instance becomes a new VEvent without a RRule as with the same UID as the parent and a recurrence-id for the replaced date or date/time.
    • editThisAndFuture

      U editThisAndFuture(U vComponentEditedCopy, U vComponentOriginal)
      THIS AND FUTURE Handles changing this-and-future recurrences in a VComponent by ending the original VComponent with a UNTIL date or date/time, then starting a new VComponent from the selected recurrence. EXDATE, RDATE and RECURRENCES are split between both VComponents.
      Parameters:
      vComponentEditedCopy - VComponent with changes
      vComponentOriginalCopy - Unchanged VComponent, except for addition of the UNTIL element.
    • thisAndFutureIgnoreRecurrences

      @Deprecated private void thisAndFutureIgnoreRecurrences(List<U> revisedVComponents, U vComponentEditedCopy)
      Deprecated.
      Handle changing the UniqueIdentifier of recurrence children, if any exist, to match the UniqueIdentifier of the revised VComponent
    • adjustStartAndEnd

      void adjustStartAndEnd(U vComponentEditedCopy, U vComponentOriginalCopy)