User:Jminta: Difference between revisions
(Added more good first bugs) |
(Calendar itemSelectionManager) |
||
| Line 1: | Line 1: | ||
== | == Calendar itemSelectionManager== | ||
I want to re-do the way Sunbird/Calendar handle selected events/tasks/calendars. This will hopefully make it easier to solve [https://bugzilla.mozilla.org/show_bug.cgi?id=195582 Bug 195580] (can't delete task/calendar with delete button) and [https://bugzilla.mozilla.org/show_bug.cgi?id=195582 Bug 195582] (can't edit a task/calender with edit button.) | |||
Basically, I want to create a new Sunbird/Calendar component called itemSelectionManager. First and foremost, this will be independent of gCalendarManager, which should make switch to the new views in 0.3a2 easier. The way I'm currently envisioning this, it will tighly integrate the task list with the normal calendar views. That is, selecting a task in the task list will highlight the corresponding item-box in the calendarView (if 'Tasks in View') is selected. Similarly, selecting an item-box representing a task in the calendar view will selected that item in the task list. | |||
The downside of this is that selecting a task in the task list clears the event selection in the view. Still, I prefer this to maintaining separate lists of selected events and trying to make the edit/delete buttons follow the focus. That has a better chance of confusing the user. | |||
=== | === General Outline of Methods === | ||
'''addObserver(observer)''' - Adds an observer that should be notified of item selection changes and changes in item focus. Observers should implement 'onItemSelectionChange' and 'onItemFocusChange'. | |||
'''removeObserver(observer)''' - Removes an observer. | |||
'''select(itemOrArray, doNotOverwrite)''' - This method passes in either a single item, or an array of items to be selected. If doNotOverwrite (optional parameter) is set and is 'true', the item/array will be appended to the current list of selected items. Otherwise, it will overwrite that list. | |||
'''clearSelection()''' - clears all selected events/tasks. Calling this and select(item, false) is redundant. | |||
'''setItemFocus(itemsAreFocused)''' - This should be called with 'false' when another part of the calendar (ie the calendar-listbox) gains focus. It should be called with 'true' when either the calendar view or tasklist is clicked. Probably also when the new/edit event dialog box finishes. It will call the 'onItemFocusChange' method in all observers. The observers can then (if necessary) make changes to the appearance of the items they deal with. | |||
'''getItemFocus()''' - Returns true if items are focused or false if they are blurred. | |||
Revision as of 12:13, 16 July 2005
Calendar itemSelectionManager
I want to re-do the way Sunbird/Calendar handle selected events/tasks/calendars. This will hopefully make it easier to solve Bug 195580 (can't delete task/calendar with delete button) and Bug 195582 (can't edit a task/calender with edit button.)
Basically, I want to create a new Sunbird/Calendar component called itemSelectionManager. First and foremost, this will be independent of gCalendarManager, which should make switch to the new views in 0.3a2 easier. The way I'm currently envisioning this, it will tighly integrate the task list with the normal calendar views. That is, selecting a task in the task list will highlight the corresponding item-box in the calendarView (if 'Tasks in View') is selected. Similarly, selecting an item-box representing a task in the calendar view will selected that item in the task list.
The downside of this is that selecting a task in the task list clears the event selection in the view. Still, I prefer this to maintaining separate lists of selected events and trying to make the edit/delete buttons follow the focus. That has a better chance of confusing the user.
General Outline of Methods
addObserver(observer) - Adds an observer that should be notified of item selection changes and changes in item focus. Observers should implement 'onItemSelectionChange' and 'onItemFocusChange'.
removeObserver(observer) - Removes an observer.
select(itemOrArray, doNotOverwrite) - This method passes in either a single item, or an array of items to be selected. If doNotOverwrite (optional parameter) is set and is 'true', the item/array will be appended to the current list of selected items. Otherwise, it will overwrite that list.
clearSelection() - clears all selected events/tasks. Calling this and select(item, false) is redundant.
setItemFocus(itemsAreFocused) - This should be called with 'false' when another part of the calendar (ie the calendar-listbox) gains focus. It should be called with 'true' when either the calendar view or tasklist is clicked. Probably also when the new/edit event dialog box finishes. It will call the 'onItemFocusChange' method in all observers. The observers can then (if necessary) make changes to the appearance of the items they deal with.
getItemFocus() - Returns true if items are focused or false if they are blurred.