dart-lang/spark — pull request #645 by devoncarew (2014-01-12 05:36:57+00:00)
Title: add a FocusManager class, to track the current file the user has selecte...

This adds a new `FocusManager` API, to allow us to track what file the user has selected / is editing. This may help us with #631, to let us track the current project and enable and disable actions appropriately.

The FocusManager:

- is notified by the Files view and the editor tabs about selection changes and the current file being edited
- provides getters for the currently selected resource, the current file being edited, and the currently selected project
- provides event streams for the 3 items above, so client's of the API can take action when any one of those items changes.

So for example, a Git branch command could listen to the FocusManager for project change events, and enable and disable itself based on whether the current project supported git. And, when invoked, it would be able to query the FocusManager to determine the current project.

@gaurave for review