javajavafxjfxtras

FXtras agenda: set allowDragging property for individual appointments instead of whole agenda


I am working with FXtras (version 8.0-r5) Agenda from http://jfxtras.org/, where I have defined two types of appointments: personal(group1) and shared(group2). Users can edit the times of their personal appointments, but not the shared appointments on their calendar; so I want to set group1 appointments as draggable, and group2 as undraggable on the calendar.

I am aware of the allowDragging attribute in the Agenda class (http://jfxtras.org/doc/8.0/jfxtras-agenda/jfxtras/scene/control/agenda/Agenda.html) that does the trick of allowing and restricting dragging, but this works only for the whole of the agenda, and cannot be set for specific appointments groups separately.

I've tried looking through the documentation for the Agenda class but couldn't find a draggable property that could be set for individual appointments. To work around it, I tried the following hack:

  1. Set the whole of agenda non-draggable
  2. On selection a personal appointment(group1), set the the whole of agenda as draggable.
  3. On any change in the agenda, set the whole of agenda as non-draggable again.

Using this I have a non-draggable agenda by default, which lets the user move appointments but only if they click on a personal appointment first. After they move it the agenda will lock to non-draggable again. The problem with this is that a user might first click a personal(group1) appointment, then proceed to moving a shared one(group2). So it is less than ideal :(

Does JFxtras have any functionality to allow specifying a draggable property for individual appointments, instead of the whole agenda?


Solution

  • I've released JFXtras 8.0-r7-SNAPSHOT and 9.0-r2-SNAPSHOT in which each appointment has a draggable property