Jump to: navigation, search

Difference between revisions of "Team FAQ"

(What is the lifecyle of an IHistoryPage?)
(What is the lifecyle of an IHistoryPage?)
Line 21: Line 21:
 
*#Check to see if the resource is currently being displayed in the History View; if it is then '''IHistoryPage.refresh''' gets called to refresh the HistoryPage's contents.
 
*#Check to see if the resource is currently being displayed in the History View; if it is then '''IHistoryPage.refresh''' gets called to refresh the HistoryPage's contents.
 
*#* If the resource is not found in the current page being displayed in the view, check to see if there are other view instances around (i.e. some History Views have been pinned) and if they contain the resource. If they do, bring them to the top, and refresh the page.
 
*#* If the resource is not found in the current page being displayed in the view, check to see if there are other view instances around (i.e. some History Views have been pinned) and if they contain the resource. If they do, bring them to the top, and refresh the page.
 +
*# If the view that the resource has been dropped on is pinned, we first check to see if another view already contains that resource (if it does it is brought to the top and refreshed), if none does a new History View instance gets created.
 +
*# Try to get the RepositoryProvider from the resource, and get the IFileHistoryProvider from the RepositoryProvider. If an IFileHistoryProvider can be obtained, adapt it to a IHistoryPageSource. If no IFileHistoryProvider can be obtained from the RepositoryProvider, try to adapt the RepositoryProvider itself to an IHistoryPageSource.
  
 
==== How do I add drag-and-drop for my IHistoryPage? ====
 
==== How do I add drag-and-drop for my IHistoryPage? ====

Revision as of 16:02, 19 June 2006


Team API Questions

History API

I have an IHistoryPage implementation. How do I hook it up into the History View?

You have a number of options here:

  • Provide your own action that will show your object in the History View. You can get a handle to the History View by calling TeamUI.getHistoryView().You then call IHistoryView.showHistoryFor(Object) and pass the object that your action is triggered from.
  • Supply your own drag and drop adapter (see below)

What is the lifecyle of an IHistoryPage?

  • The user requests the history for an object (either by selecting an action, or dragging and dropping the object on the History View, or by clicking on an object with linking enabled on the History View).
  • If the dropped object is a resource:
    1. Check to see if the resource is currently being displayed in the History View; if it is then IHistoryPage.refresh gets called to refresh the HistoryPage's contents.
      • If the resource is not found in the current page being displayed in the view, check to see if there are other view instances around (i.e. some History Views have been pinned) and if they contain the resource. If they do, bring them to the top, and refresh the page.
    2. If the view that the resource has been dropped on is pinned, we first check to see if another view already contains that resource (if it does it is brought to the top and refreshed), if none does a new History View instance gets created.
    3. Try to get the RepositoryProvider from the resource, and get the IFileHistoryProvider from the RepositoryProvider. If an IFileHistoryProvider can be obtained, adapt it to a IHistoryPageSource. If no IFileHistoryProvider can be obtained from the RepositoryProvider, try to adapt the RepositoryProvider itself to an IHistoryPageSource.

How do I add drag-and-drop for my IHistoryPage?

  • The History View supplies a GenericHistoryDropAdapter which will handle DND for all IResources.
  • If you wish to add handling of custom objects, you need to provide an implementation of IDropActionDelegate and extend the org.eclipse.ui.dropActions extension point.