hunthu2000 / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

Extendable DayView* classes #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Description of the new feature:
Generate getters and setters for the DayView* classes in the DayView class,
or make them protected. Then it is possible to extend and create, for
instance, your own DayViewHeader.

Use Case:
One example is to modify the DayViewHeader to show icons for "all-day"
appointments.

Assumptions:
1. The private DayView* members of DayView are made protected -OR-
2. Getters and setters for the DayView* members of DayView are generated

Code / psuedo-code:

public class DayView extends CalendarView {
   [...]
   protected DayViewHeader dayViewHeader = null;
   [...]
}

public class MyDayView extends DayView {
   public void setDayViewHeader(DayViewHeader dvh) {
      this.dayViewHeader = dvh;
   }
}

public class MyDayViewHeader extends DayViewHeader {
   public MyDayViewHeader(DayView dayView) {
      // Creates my own header
   }
}

MyDayView dayView = new MyDayView();
dayView.setDayViewHeader(new MyDayViewHeader(dayView));

Original issue reported on code.google.com by lunn...@gmail.com on 27 Jul 2009 at 2:21

GoogleCodeExporter commented 9 years ago
Why not modify the source code to handle multi-day appointments and 
re-contribute 
back to the project? It is a GPL license, so any changes or extensions of the 
code 
should be posted anyway...

I do plan to do a few things to help out:
1) add multi-day appointments some time within the next couple of months
2) do some MAJOR refactoring to make this library a bit more configurable

So I will definitely keep this request in mind as I work on #2

Original comment by Brad.Ryd...@gmail.com on 30 Jul 2009 at 1:24

GoogleCodeExporter commented 9 years ago
Yes, I've actually started on a patch to handle multi-day appointments and to 
show
them correctly. To get everything to work properly I had to do some 
restructuring of
the code.  Still have some bugs to take care of...

Original comment by lunn...@gmail.com on 30 Jul 2009 at 8:28

GoogleCodeExporter commented 9 years ago
that's great! the reason I have held off on multi-day appointments is because I 
have 
a month view (not yet released). Multi-day appointments are straight forward in 
the 
dayView, but in monthView a single appointment may be displayed on multiple 
rows. 
Example:
http://news.cnet.com/i/ne/p/2006/GoogleCalendar_550x400.jpg

Notice an appointment may start on Sunday (1st row) and end on Monday (2nd 
row). An 
appointment then effectively becomes 2 panels instead of 1. Interested to know 
if you 
have considered this scenario and how you solved for it

Original comment by Brad.Ryd...@gmail.com on 30 Jul 2009 at 4:04

GoogleCodeExporter commented 9 years ago
Yes I've considered that scenario and that's mainly the reason why I 
restructured the
code a bit. The class named Appointment changed purpose. I made it into a clean
appointment data model. Then an appointment can contain multiple panels. The 
panels,
represented by a class called AppointmentView (an extension and rebuild of
AppointmentAdapter), is then created in the appointment by the AppointmentUtil. 
In
this way it's possible to select an appointment by clicking any of its panels.

These modifications also needed some changes in TimeBlock and some other 
classes. I'm
currently working with the last bug, shown when the appointments are shown in 
the
grid. For some reason apptCell.getIntersectingBlocks().get(0).getTotalColumns()
doesn't return the correct value at the end of doLayout() so I'm searching for a
reference problem...

Original comment by lunn...@gmail.com on 31 Jul 2009 at 6:36

GoogleCodeExporter commented 9 years ago
Merging this with Issue #5, since both are related to handling of multi-day 
appointments in the DayView

Original comment by Brad.Ryd...@gmail.com on 15 Feb 2010 at 6:00