User:Jminta:Views: Difference between revisions

No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
===current trunk===
==Migration to the new views==
*not pluggable
So, it looks like the xbl model won out.  Unlike my previous patches to bring in the new views, this one cannot be easily implemented in one step.  Here's how I'm proposing to go about this:
*4 vboxes in deck, each with its own view-element
===Step 1:===
*plug-hack:
*Create xbl elements for each of the 4 views we want to implement
**add element to deck
*These views will implement the following API
**add functions to gCalendarWindow
**readonly attribute observerID (not used until Step 2)
**over-ride currentView at correct times
**readonly attribute startDay
**readonly attribute endDay
**attribute selectedDay
**attribute controller
**void goToDay(day)
**void moveView(numberOfTimes)
*These views will still be controlled by a shell of gCalendarWindow, mostly to control enabling/disabling commands
===Step 2:===
Make the views truly pluggable:
*Remove all traces of gCalendarWindow
**make CalendarEventSelection stand on its own
*switching to a view will activate its observer.  Commands related to the view should update themselves accordingly (disable/enable)


==New view implementation models==
===xbl model===
===everything_v1===
<deck id="view-deck">
*not pluggable
  <cal-day-view id="day-view"/>
*2 elements in deck
  <cal-week-view id="week-view"/>
*plug
  <cal-multiweek-view id="multiweek-view"/>
**add element to deck(optional)
  <cal-month-view id="month-view"/>
**over-ride viewManager functions
</deck>
===re-use overlay===
 
*not pluggable
Javascript:
*4 vboxes in deck, each with its own view-element
function switchView(elementId) {
*plug-hack:
    document.getElementById('view-deck').selectedPanel = document.getElementById(elementId);
**add element to deck
}
**add methods to gCalendarWindow
 
**over-ride currentView at correct times
gCalendarWindow.currentView becomes document.getElementById('view-deck').selectedPanel
===everything_v2===
 
*pluggable
gCalendarWindow.switchToDayView() becomes switchView('day-view');
*2 elements in deck
*plug:
**add element to deck(optional)
**call addView()

Latest revision as of 21:46, 16 November 2005

Migration to the new views

So, it looks like the xbl model won out. Unlike my previous patches to bring in the new views, this one cannot be easily implemented in one step. Here's how I'm proposing to go about this:

Step 1:

  • Create xbl elements for each of the 4 views we want to implement
  • These views will implement the following API
    • readonly attribute observerID (not used until Step 2)
    • readonly attribute startDay
    • readonly attribute endDay
    • attribute selectedDay
    • attribute controller
    • void goToDay(day)
    • void moveView(numberOfTimes)
  • These views will still be controlled by a shell of gCalendarWindow, mostly to control enabling/disabling commands

Step 2:

Make the views truly pluggable:

  • Remove all traces of gCalendarWindow
    • make CalendarEventSelection stand on its own
  • switching to a view will activate its observer. Commands related to the view should update themselves accordingly (disable/enable)

xbl model

<deck id="view-deck">

 <cal-day-view id="day-view"/>
 <cal-week-view id="week-view"/>
 <cal-multiweek-view id="multiweek-view"/>
 <cal-month-view id="month-view"/>

</deck>

Javascript: function switchView(elementId) {

   document.getElementById('view-deck').selectedPanel = document.getElementById(elementId);

}

gCalendarWindow.currentView becomes document.getElementById('view-deck').selectedPanel

gCalendarWindow.switchToDayView() becomes switchView('day-view');